DumontEXE 0.0.1
cmcConnectionDef.h
00001 /* ***************************************************************************
00002 **
00003 ** Copyright (C) 2007 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/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/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_CONNECTION_DEF_H_422FD07F_0597_4cbb_A034_9AE85166472E
00026 #define CDA_CONNECTION_DEF_H_422FD07F_0597_4cbb_A034_9AE85166472E
00027 
00028 #include "cmcObject.h"
00029 
00030 namespace cmcDatabaseApi {
00031 
00032 class cmcApplication;
00033 class cmcConnectionDefs;
00034 class cmcCategoryDef;
00035 
00036 /*!
00037 ** \brief Connection Definition
00038 **
00039 **
00040 */
00041 class cmcConnectionDef:
00042   public cmcObject
00043 {
00044   Q_OBJECT
00045 
00046   /*!
00047   ** \brief 
00048   **
00049   **
00050   */
00051   Q_PROPERTY( QString pairedName       READ pairedName     WRITE setPairedName       DESIGNABLE true  SCRIPTABLE true  STORED true  )
00052 
00053   public:
00054 
00055     /*!
00056     ** \brief Copy Constructor
00057     **
00058     */
00059     cmcConnectionDef( const cmcConnectionDef & copy );
00060 
00061     /*!
00062     ** \brief
00063     **
00064     */
00065     cmcConnectionDef
00066     (
00067       const QString & conCatName,
00068       cmcConnectionDefs * parent
00069     );
00070 
00071     /*!
00072     ** \brief
00073     **
00074     **
00075     */
00076     cmcConnectionDef
00077     (
00078       const QString & conName,
00079       const QString & toCategory,
00080       cmcConnectionDefs * parent
00081     );
00082 
00083     /*!
00084     ** \brief Primary Destructor
00085     **
00086     ** This destructor handles cleanup of the object.
00087     **
00088     */
00089     virtual ~cmcConnectionDef();
00090 
00091   public slots:
00092 
00093     cmcConnectionDefs * connectionDefs();
00094 
00095     cmcCategoryDef * categoryDef();
00096 
00097     /*!
00098     ** \brief Return the 'Connection Name' of the connection
00099     **
00100     ** This is an enhanced function that returns the 'connection name' portion
00101     **  of the connection.  The Connection Name portion is that first part of
00102     **  the connection name that distinguishes one connection from another.
00103     **  This function is not normally provided by Commence so it is stored
00104     **  locally so as to be available for use in other operations.
00105     **
00106     ** \par vbScript Example:
00107     ** \code
00108     ** Sub Form_onEnterField(FieldName)
00109     **   '
00110     **   ' This test for the connection name...
00111     **   '
00112     **   if( dfrm.Connection(FieldName).conName = "pRD" ) then
00113     **     msgbox "Read Connection of some sort"
00114     **   end if' 
00115     **
00116     **   '
00117     **   ' ...is the same as this test.
00118     **   '
00119     **   if( dfrm.Connection(FieldName).definition.name = "pRD" ) then
00120     **     msgbox "Read Connection of some sort"
00121     **   end if' 
00122     **
00123     ** \endcode
00124     **
00125     ** \sa name, toCategory
00126     */
00127     QString conName();
00128 
00129     /*!
00130     ** \brief Return the target Category of this connection
00131     **
00132     ** This is a pass-through function provided natively by Commence.  Commence 
00133     **  does provide this value, but it is also cached here locally so that 
00134     **  the number of requests into the Commence API are reduced.
00135     **
00136     ** \par vbScript Example:
00137     ** \code
00138     ** dim cursor: set cursor = dfrm.DB.GetCursor( 0, oxConn.toCategory, 0 )
00139     ** \endcode
00140     **
00141     ** \sa name, conName
00142     **
00143     */
00144     QString toCategory();
00145 
00146     /*!
00147     ** \brief Return the Paired connection Name
00148     **
00149     ** This handy function requires an entry in the databaseDef.xml to define this
00150     **  reverse connection since is it not available from the API directly.  The 
00151     **  content is as follows:
00152     **
00153     ** \par Connection Definition Extension (exerpt)
00154     ** \code
00155     **  <connectionDefs>
00156     **    <connectionDef name="in->Court">
00157     **      <pairedName>for->Matters</pairedName>
00158     **      <limit1>0</limit1>
00159     **      <comment>This connection designates the court for this matter</comment>
00160     **    </connectionDef>
00161     **  </connectionDefs>
00162     ** \endcode
00163     **
00164     */
00165     QString pairedName();
00166 
00167     void setPairedName( const QString & value );
00168 
00169     /*!
00170     ** \brief Return a pointer back to the target Category definition
00171     **
00172     ** This method returns object of the target category definition of 
00173     **  the Connection.  If this connection is "Relates to Company" then fetching
00174     **  this object would return the category definition for "Company".
00175     **  From there, all the regular properties of that category definition
00176     **  are available.
00177     **
00178     */
00179     cmcCategoryDef * toCategoryDef();
00180 
00181   signals:
00182 
00183   protected:
00184 
00185   private:
00186 
00187     QString m_conName;
00188 
00189     QString m_toCategory;
00190 
00191 }; // endclass cmcConnectionDef
00192 
00193 } // namespace cmcDatabaseApi
00194 
00195 #endif // #ifndef CDA_CONNECTION_DEF_H
00196 
 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