00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef MMSDIALOGMANAGER_H_
00034 #define MMSDIALOGMANAGER_H_
00035
00036 #include "mmsgui/mmswindow.h"
00037 #include "mmsgui/mmschildwindow.h"
00038 #include "mmsgui/mmsmenuwidget.h"
00039 #include "mmsgui/mmscanvaswidget.h"
00040
00041
00042 #define searchForWidget findWidget
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053 class MMSDialogManager {
00054 private:
00055
00056
00057 bool leave_window;
00058
00059
00060 MMSWindow *rootWindow;
00061
00062
00063 bool rootWindow_is_mine;
00064
00065
00066 vector<MMSChildWindow*> childWins;
00067
00068
00069 string filename;
00070
00071
00072 MMSDescriptionClass description;
00073
00074
00075 vector<MMSWidget*> namedWidgets;
00076
00077 void insertNamedWidget(MMSWidget *widget);
00078
00079 void throughDoc(MMSTaffFile *tafff, MMSWidget *currentWidget, MMSWindow *rootWindow,
00080 MMSTheme *theme, bool only_first_child = false);
00081
00082 void getDescriptionValues(MMSTaffFile *tafff, MMSTheme *theme);
00083
00084 void getMainWindowValues(MMSTaffFile *tafff, MMSTheme *theme);
00085 void getPopupWindowValues(MMSTaffFile *tafff, MMSTheme *theme);
00086 void getRootWindowValues(MMSTaffFile *tafff, MMSTheme *theme);
00087 void getChildWindowValues(MMSTaffFile *tafff, MMSWindow *rootWindow, MMSTheme *theme);
00088 string getTemplateValues(MMSTaffFile *tafff, MMSWidget *currentWidget, MMSWindow *rootWindow, MMSTheme *theme);
00089 string getVBoxValues(MMSTaffFile *tafff, MMSWidget *currentWidget, MMSWindow *rootWindow, MMSTheme *theme);
00090 string getHBoxValues(MMSTaffFile *tafff, MMSWidget *currentWidget, MMSWindow *rootWindow, MMSTheme *theme);
00091 string getLabelValues(MMSTaffFile *tafff, MMSWidget *currentWidget, MMSWindow *rootWindow, MMSTheme *theme);
00092 string getButtonValues(MMSTaffFile *tafff, MMSWidget *currentWidget, MMSWindow *rootWindow, MMSTheme *theme);
00093 string getCanvasValues(MMSTaffFile *tafff, MMSWidget *currentWidget, MMSWindow *rootWindow, MMSTheme *theme);
00094 string getImageValues(MMSTaffFile *tafff, MMSWidget *currentWidget, MMSWindow *rootWindow, MMSTheme *theme);
00095 string getProgressBarValues(MMSTaffFile *tafff, MMSWidget *currentWidget, MMSWindow *rootWindow, MMSTheme *theme);
00096 bool getMenuItems(MMSTaffFile *tafff, MMSMenuWidget *menu, MMSTheme *theme);
00097 string getMenuValues(MMSTaffFile *tafff, MMSWidget *currentWidget, MMSWindow *rootWindow, MMSTheme *theme);
00098 string getTextBoxValues(MMSTaffFile *tafff, MMSWidget *currentWidget, MMSWindow *rootWindow, MMSTheme *theme);
00099 string getArrowValues(MMSTaffFile *tafff, MMSWidget *currentWidget, MMSWindow *rootWindow, MMSTheme *theme);
00100 string getSliderValues(MMSTaffFile *tafff, MMSWidget *currentWidget, MMSWindow *rootWindow, MMSTheme *theme);
00101 string getInputValues(MMSTaffFile *tafff, MMSWidget *currentWidget, MMSWindow *rootWindow, MMSTheme *theme);
00102 string getCheckBoxValues(MMSTaffFile *tafff, MMSWidget *currentWidget, MMSWindow *rootWindow, MMSTheme *theme);
00103 string getGapValues(MMSTaffFile *tafff, MMSWidget *currentWidget, MMSWindow *rootWindow, MMSTheme *theme);
00104
00105 void updateTAFFAttributes(MMSTaffFile *tafff, MMSWidget *widget, string &widgetName);
00106
00107 public:
00108 MMSDialogManager(bool leave_window = false);
00109 MMSDialogManager(MMSWindow *rootWindow);
00110 ~MMSDialogManager();
00111 bool isLoaded();
00112 MMSWindow* loadDialog(string filename, MMSTheme *theme = NULL);
00113 MMSChildWindow* loadChildDialog(string filename, MMSTheme *theme = NULL);
00114 MMSWidget* findWidget(string name);
00115 MMSWidget* operator[](string name);
00116 MMSWindow* getWindow();
00117
00118 MMSDescriptionClass getDescription();
00119
00120 MMSWidget *createWidgetFromTemplate(string className, MMSWidget *parentWidget, MMSWindow *rootWindow = NULL, MMSTheme *theme = NULL);
00121 MMSWidget *addWidgetFromTemplate(string className, MMSWidget *parentWidget, MMSWindow *rootWindow = NULL, MMSTheme *theme = NULL);
00122 };
00123
00124 MMS_CREATEERROR(MMSDialogManagerError);
00125
00126 #endif