DumontEXE 0.0.1
cmcCdaItem.h
00001 /* ***************************************************************************
00002 **
00003 ** Copyright (C) 2007, 2008 Lorimark Solutions, LLC. All rights reserved.
00004 **
00005 ** This file is part of the DumontEXE Scripting Extension Kit
00006 **
00007 ** This file may be used under the terms of the GNU General Public
00008 ** License version 2.0 as published by the Free Software Foundation
00009 ** and appearing in the file LICENSE.GPL included in the packaging of
00010 ** this file.  Please review the following information to ensure GNU
00011 ** General Public Licensing requirements will be met:
00012 ** http://dumont.showoff-db.org/exe/opensource.html
00013 **
00014 ** If you are unsure which license is appropriate for your use, please
00015 ** review the following information:
00016 ** http://dumont.showoff-db.org/exe/licensing.html 
00017 ** or contact the sales department at sales@lorimarksolutions.com.
00018 **
00019 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00020 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00021 **
00022 ** author: Mark Petryk ~ Lorimark Solutions, LLC
00023 ** **************************************************************************/
00024 
00025 #ifndef CDA_CDAITEM_H_422FD07F_0597_4cbb_A034_9AE85166472E
00026 #define CDA_CDAITEM_H_422FD07F_0597_4cbb_A034_9AE85166472E
00027 
00028 #include <QString>
00029 #include <QUuid>
00030 #include <QDateTime>
00031 #include <QMap>
00032 #include <QVariant>
00033 
00034 #include "cmcObject.h"
00035 #include "cmcCursor.h"
00036 
00037 namespace cmcDatabaseApi {
00038 
00039 class cmcCda;
00040 class cmcRowSet;
00041 
00042 /*!
00043 ** \brief Commence CDA Item
00044 **
00045 **
00046 */
00047 class cmcCdaItem:
00048   public cmcObject
00049 {
00050   Q_OBJECT
00051   public:
00052 
00053     cmcCdaItem( const cmcCdaItem & copy );
00054 
00055     /*!
00056     ** \brief empty constructor
00057     **
00058     */
00059     cmcCdaItem( QObject * parent = NULL );
00060 
00061     /*!
00062     ** \brief Item Name Constructor
00063     **
00064     ** This constructor is used when we know the name of the item, but we do
00065     **  not know the guid of the item.
00066     **
00067     */
00068     cmcCdaItem( const QString & name, cmcCda * cda, cmcCdaItem * parent = NULL );
00069 
00070     /*!
00071     ** \brief Item ID Constructor
00072     **
00073     ** This constructor is used when we know the guid of the item.  We might
00074     **  also know the name of the item, but the guid method of item-fetch is
00075     **  preferred since it's more reliable.
00076     **
00077     */
00078     cmcCdaItem( const QUuid & uuid, cmcCda * cda, cmcCdaItem * parent = NULL );
00079 
00080     /*!
00081     ** \brief Default Destructor
00082     **
00083     */
00084     virtual ~cmcCdaItem();
00085 
00086   public slots:
00087 
00088     /*!
00089     ** \brief cda engine reference
00090     **
00091     ** This makes reference back to the cda engine.  Every item references
00092     **  an engine, which provides the connectivity to the database.
00093     **
00094     */
00095     virtual cmcCda * cda();
00096 
00097     /*!
00098     ** \brief Return a cursor for this item
00099     **
00100     ** This returned cursor is automatically filtered on this item.  The filter
00101     **  is based upon either the itemName or the id.
00102     **
00103     */
00104     virtual cmcCursor * getCursor();
00105 
00106     /*!
00107     ** \brief Return a reference to the parent item
00108     **
00109     ** Not every item has a parent - it's not required.
00110     **
00111     */
00112     virtual cmcCdaItem * parentItem();
00113 
00114     virtual cmcCdaItem * childItem( const QString & name );
00115 
00116     virtual cmcCdaItem * childItem( const QUuid & uuid );
00117 
00118     virtual bool valid();
00119 
00120     virtual bool dirty();
00121 
00122     virtual void setDirty( bool state );
00123 
00124     /*!
00125     ** \brief Return the item ID
00126     **
00127     ** 
00128     */
00129     virtual QUuid id();
00130 
00131     virtual QUuid idGroup();
00132 
00133     virtual QUuid idLock();
00134 
00135     virtual QUuid idOwner();
00136 
00137     virtual QUuid idParent();
00138 
00139     virtual QUuid idSymlink();
00140 
00141     virtual bool isDeleted();
00142 
00143     virtual bool isHidden();
00144 
00145     virtual bool isLocked();
00146 
00147     virtual bool isParent();
00148 
00149     virtual bool isShared();
00150 
00151     virtual long itemAutoId();
00152 
00153     virtual QString itemData();
00154 
00155     virtual void setItemData( const QString & value );
00156 
00157     virtual long itemMode();
00158 
00159     virtual QString itemName();
00160 
00161     virtual QString itemSort();
00162 
00163     virtual QString itemType();
00164 
00165     virtual QString onCreated();
00166 
00167     virtual QString onChanged();
00168 
00169     virtual QString onDeleted();
00170 
00171     virtual QString version();
00172 
00173 
00174     virtual void setId( const QUuid & value );
00175 
00176     virtual void setIdGroup( const QUuid & value );
00177 
00178     virtual void setIdLock( const QUuid & value );
00179 
00180     virtual void setIdOwner( const QUuid & value );
00181 
00182     virtual void setIdSymlink( const QUuid & value );
00183 
00184     virtual void setIsDeleted( bool value );
00185 
00186     virtual void setIsHidden( bool value );
00187 
00188     virtual void setIsLocked( bool value );
00189 
00190     virtual void setIsParent( bool value );
00191 
00192     virtual void setIsShared( bool value );
00193 
00194     virtual void setItemMode( long value );
00195 
00196     virtual void setItemName( const QString & value );
00197 
00198     virtual void setItemSort( const QString & value );
00199 
00200     virtual void setItemType( const QString & value );
00201 
00202     virtual void setOnCreated( const QString & value );
00203 
00204     virtual void setOnChanged( const QString & value );
00205 
00206     virtual void setOnDeleted( const QString & value );
00207 
00208     virtual void setVersion( const QString & value );
00209 
00210 
00211 
00212 
00213     virtual QVariant value( const QString & key );
00214 
00215     virtual void setValue( const QString & key, const QVariant & value );
00216 
00217     virtual bool clear();
00218 
00219     virtual bool load();
00220 
00221     virtual bool save();
00222 
00223     /*!
00224     ** \brief
00225     **
00226     **
00227     */
00228     virtual void dumpInfo();
00229 
00230   signals:
00231 
00232     void updated();
00233 
00234   protected:
00235 
00236   private:
00237 
00238     long updateRowSet( cmcRowSet * rowSet );
00239 
00240     cmcCda * m_cda;
00241 
00242     bool m_valid;
00243     bool m_dirty;
00244 
00245     QUuid m_id;
00246     QUuid m_idGroup;
00247     QUuid m_idLock;
00248     QUuid m_idOwner;
00249     QUuid m_idSymlink;
00250     bool m_isDeleted;
00251     bool m_isHidden;
00252     bool m_isLocked;
00253     bool m_isParent;
00254     bool m_isShared;
00255     long m_itemAutoId;
00256     QString m_itemData;
00257     long m_itemMode;
00258     QString m_itemSort;
00259     QString m_itemType;
00260     QString m_onChanged;
00261     QString m_onCreated;
00262     QString m_onDeleted;
00263     QString m_version;
00264 
00265 }; // endclass cmcCdaItem:
00266 
00267 
00268 } // endnamespace cmcDatabaseApi
00269 
00270 #endif // #ifndef CDA_CDAITEM_H
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties




~ ~ ~ ~ ~ ~
Source Code without Comments is like a Cranberry Garland
without the berries. Comment your Code!
 
Commence Database User Support Group Forum
http://newsgroup.showoff-db.org/
~ ~ ~ ~ ~ ~
Author: Mark Petryk
Lorimark Solutions, LLC
mark@lorimarksolutions.com