Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef XAP_DIALOGFACTORY_H
00023 #define XAP_DIALOGFACTORY_H
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #if defined(__MINGW32__)
00039 # undef snprintf
00040 # if __GNUC__ <= 3
00041 # define _GLIBCXX_USE_C99_DYNAMIC 1
00042 # endif
00043 #endif
00044
00045 #include <map>
00046
00047 #ifndef UT_TYPES_H
00048 #include "ut_types.h"
00049 #endif
00050 #include "ut_misc.h"
00051 #include "ut_vector.h"
00052
00053 #include "xap_Dialog.h"
00054 #include "xap_Types.h"
00055
00056 class XAP_Dialog;
00057 class XAP_App;
00058 class XAP_Frame;
00059
00060
00061
00062 class ABI_EXPORT XAP_DialogFactory
00063 {
00064 public:
00065 struct _dlg_table
00066 {
00067 XAP_Dialog_Id m_id;
00068 XAP_Dialog_Type m_type;
00069 XAP_Dialog * (*m_pfnStaticConstructor)(XAP_DialogFactory *, XAP_Dialog_Id id);
00070 bool m_tabbed;
00071 };
00072
00073 XAP_DialogFactory(XAP_App * pApp, int nrElem, const struct _dlg_table * pDlgTable, XAP_Frame * pFrame = NULL);
00074 virtual ~XAP_DialogFactory(void);
00075
00076 inline XAP_App * getApp(void) const { return m_pApp; };
00077
00078 XAP_Dialog * requestDialog(XAP_Dialog_Id id);
00079 XAP_Dialog * justMakeTheDialog(XAP_Dialog_Id id);
00080 void releaseDialog(XAP_Dialog * pDialog);
00081 XAP_Dialog_Id getNextId(void);
00082 XAP_Dialog_Id registerDialog(XAP_Dialog *(*pStaticConstructor)(XAP_DialogFactory *, XAP_Dialog_Id id),XAP_Dialog_Type iDialogType);
00083 void unregisterDialog(XAP_Dialog_Id id);
00084
00085 bool registerNotebookPage(XAP_Dialog_Id dialog, const XAP_NotebookDialog::Page * page);
00086 bool unregisterNotebookPage(XAP_Dialog_Id dialog, const XAP_NotebookDialog::Page * page);
00087
00088 protected:
00089 bool _findDialogInTable(XAP_Dialog_Id id, UT_sint32 * pIndex) const;
00090
00091 XAP_App * m_pApp;
00092 XAP_Frame * m_pFrame;
00093 XAP_Dialog_Type m_dialogType;
00094 UT_Vector m_vecDialogs;
00095 UT_NumberVector m_vecDialogIds;
00096
00097 UT_uint32 m_nrElementsDlgTable;
00098 UT_GenericVector<const _dlg_table *> m_vec_dlg_table;
00099 UT_GenericVector<_dlg_table *> m_vecDynamicTable;
00100
00101 private:
00102 void addPages(XAP_NotebookDialog * pDialog, XAP_Dialog_Id id);
00103 };
00104
00105 #endif