D:/VS2010_SRC_JOBS/MDI_2.0/include/ApplicationInterface.h

Go to the documentation of this file.
00001 // Include ed implement this class in the application
00002 //
00003 #ifndef MULTI_DOCUMENT_INTERFACE
00004 #define MULTI_DOCUMENT_INTERFACE
00005 
00022 #ifdef IS_THE_LIBRARY
00023 # define LIB_MODE Q_DECL_EXPORT
00024 #else
00025 # define LIB_MODE Q_DECL_IMPORT
00026 #endif
00027 
00028 #include <Qt/qglobal.h>
00029 #include <QObject>
00030 #include <QMainWindow>
00031 #include <QHash>
00032 
00033 #include "mdiDef.h"
00034 
00035 class QIcon;
00036 class QWidget;
00037 class QDockWidget;
00038 class QString;
00039 class MdiInterface;
00040 
00041 
00042 class ApplicationInterface : public QObject
00043 {
00044         Q_OBJECT
00045  
00046         Q_CLASSINFO("ApplicationName",              "Name of the application")
00047         Q_CLASSINFO("Description",                  "Brief description of the application")
00048         Q_CLASSINFO("RegisteredFileName",           "Extension file name to be registered ex. txt,doc,log")
00049         Q_CLASSINFO("Classification",               "Specify the classification of the application ex. Software/Document/Editor/Text")
00050         // it is possible to add several aliases with the following syntax
00051 //      Q_CLASSINFO("Alias.1.ApplicationName",      "A second name of the application")
00052 //      Q_CLASSINFO("Alias.1.Description",          "Brief description of the application in this mode")
00053 //      Q_CLASSINFO("Alias.1.RegisteredFileName",   "Extension file name to be registered for the alias ex. txt,doc,log")
00054 //      Q_CLASSINFO("Alias.1.Classification",       "Specify the classification of the application ex. Software/Document/Editor/RichText")
00055         Q_CLASSINFO("Version",                      "1.0.0")
00056         Q_CLASSINFO("Author.1",                     "Your Name")
00057         Q_CLASSINFO("Email.1",                      "mail@org.com")
00058         Q_CLASSINFO("URL.1",                        "http://Your-site.com")
00059         Q_CLASSINFO("History.1",                    "1.0.0 1/01/2008 First release.")
00060 
00061 public:
00068         ApplicationInterface(MdiInterface * mdiInt) { mInt = mdiInt; }
00069         ~ApplicationInterface() {}
00070 
00072 
00073 
00084         virtual QIcon           * icon(unsigned index = 0)  { return 0; }
00085         
00098         virtual unsigned        uniqueId(void * objectPtr)  { return 0; } 
00100 
00106         virtual MdiInterface    * mdiInterface()            { return mInt; }
00107         
00109 
00110 
00124         virtual QWidget         * create(unsigned alias = 0, AppBatchList & par = AppBatchList()) { return 0; }
00125 
00142         virtual QWidget         * open(unsigned alias = 0, const char * fileNamePath = 0, AppBatchList & par = AppBatchList()) { return 0; }
00144 
00146 
00147         virtual const char      * fileName(void * objectPtr)    { return 0; }       // Associated file name
00148         virtual bool            saveAs(const char * filePath, void * objectPtr) { return false; }
00149         virtual bool            save(void * objectPtr)          { return false; }
00150         virtual bool            print(void * objectPtr)         { return false; }
00152 
00154 
00155         virtual void            undo(void * objectPtr)  {}
00156         virtual void            redo(void * objectPtr)  {}
00157         virtual void            cut(void * objectPtr)   {}
00158         virtual void            copy(void * objectPtr)  {}
00159         virtual void            paste(void * objectPtr) {}
00161 
00163 
00164         virtual bool            close(void * objectPtr)     { return false; }
00165         virtual void            update(void * objectPtr)  {}
00166         virtual void            help(unsigned alias = 0)  {}
00168 
00170 
00171         virtual void            script(void * sctx)     {}
00173 
00175 
00176         virtual void            basic(void * sctx)      {}
00178 
00179         MethodLibrary           library;
00180         
00181 protected:
00182         MdiInterface            * mInt;
00183 };
00184 
00185 // Used by MDI to recall the application
00186 typedef ApplicationInterface *  (* FuncApplicationInit)(MdiInterface * mdiInterface);
00187 
00188 // Application entry point in explicit mode
00189 extern "C" ApplicationInterface LIB_MODE * ApplicationInit(MdiInterface * mdiInterface);
00190 
00191 #endif

Generated on Thu Jun 22 12:01:32 2017 for Multi Document Interface by doxygen 1.3.1