DumontEXE 0.0.1
cmcApplications.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_APPLICATIONS_H_422FD07F_0597_4cbb_A034_9AE85166472E
00026 #define CDA_APPLICATIONS_H_422FD07F_0597_4cbb_A034_9AE85166472E
00027 
00028 #include <QPointer>
00029 
00030 #include "cmcApplication.h"
00031 
00032 namespace cmcDatabaseApi {
00033 
00034 /*!
00035 ** \brief This is the Commence Running Applications Table
00036 **
00037 ** This object manages a list of running Commence applications.  When an application
00038 **  is added to the \ref ROT, it is scanned regularly to insure that the application is 
00039 **  still active.  If the user, through Commence, opens a different database then
00040 **  the entry in the ROT will be automatically removed.  This feature is timer
00041 **  driven.  Once per second, the \ref ROT scans each database to insure it is the 
00042 **  correct version for that ROT entry.  As long as the user doesn't close Commence
00043 **  or switch databases, then the entry in the \ref ROT will remain current, and will
00044 **  be available to other applications.
00045 **
00046 ** The short answer is, don't switch databases when Commence is open, and make sure
00047 **  the application is properly unregistered from the \ref ROT when it closes, otherwise
00048 **  Dumont will maintain a link to that database, and it will not close properly
00049 **  until Dumont is closed.
00050 **
00051 */
00052 class cmcApplications:
00053   public cmcObjects
00054 {
00055   Q_OBJECT
00056   Q_CLASSINFO( "DestroyObject", "no" )
00057 
00058   public:
00059 
00060     /*
00061     ** Copy Constructor
00062     **
00063     **
00064     */
00065     cmcApplications( const cmcApplications & copy );
00066 
00067     /*
00068     ** Standard Constructor
00069     **
00070     **
00071     */
00072     cmcApplications( cmcObject * parent = NULL );
00073 
00074     virtual ~cmcApplications();
00075 
00076   public slots:
00077 
00078     /*!
00079     ** \brief Add an Application to the R.O.T. <br>
00080     **
00081     ** This function adds an application object directly to the Application 
00082     **  \ref ROT in ROT Dumont.
00083     **
00084     ** \sa remove
00085     **
00086     ** \return long ~ Count of Applications in the R.O.T.
00087     */
00088     virtual long add
00089     (
00090       /*! interface pointer ~ Provided directly from vbScript "Application" object \n\n */
00091       IDispatch * dispatch,
00092 
00093       /*! string ~ name of core Dumont category.  Default value is 'Dumont' but can
00094                     be overridden by the registering application. \n\n */
00095       const QString & dumontCategory = "Dumont"
00096     );
00097 
00098     /*!
00099     ** \brief Fetch an Application by Index <br>
00100     **
00101     ** This function fetches an application from the Application \ref ROT by
00102     **  its instance number.
00103     **
00104     ** \sa \ref application(const QString &) "application(name)"
00105     **
00106     ** \return cmcApplication wrapper
00107     */
00108     virtual cmcApplication * application
00109     (
00110       /*! long ~ instance index */
00111       long index
00112     );
00113 
00114     /*!
00115     ** \brief Fetch an Application by Name <br>
00116     **
00117     ** This function fetches an application from the Applications \ref ROT by
00118     **  its application name or alias-name.
00119     **
00120     ** \sa \ref application(long) "application(index)"
00121     **
00122     ** \return cmcApplication wrapper
00123     */
00124     virtual cmcApplication * application
00125     (
00126       /*! String ~ Name or Alias Name of application */
00127       const QString & name
00128     );
00129 
00130     /*!
00131     ** \brief Remove an application from the ROT <br>
00132     **
00133     ** Applications are registered in the ROT with a reference to their dispatch
00134     **  interface, and removed from the ROT with a reference to the application's
00135     **  \ref cmcApplication.databaseName() "databaseName()".
00136     **
00137     */
00138     virtual long remove
00139     (
00140       /*! String ~ Name or Alias Name of application */
00141       const QString & name
00142     );
00143 
00144     /*!
00145     ** \brief Remove an application by handle <br>
00146     **
00147     ** This is a convenience function.
00148     **
00149     */
00150     virtual long remove
00151     (
00152       /*! disptch ~ Application Dispatch pointer */
00153       IDispatch * dispatch
00154     );
00155 
00156     /*!
00157     ** \brief Check Application References <br>
00158     **
00159     ** This routine loops through all the applications registered in the ROT
00160     **  and removes any application that is referencing the correct database.
00161     **
00162     */
00163     virtual void checkApps();
00164 
00165   signals:
00166 
00167     void updated();
00168 
00169   protected:
00170 
00171   private:
00172 
00173 }; // endclass cmcApplications:
00174 
00175 
00176 } // endnamespace cmcDatabaseApi
00177 
00178 #endif // #ifndef CDA_APPLICATIONS_H
00179 
 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