Logo
  • Main Page
  • Related Pages
  • Modules
  • Classes
  • Files

mmsdialogmanager.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2005-2007 Stefan Schwarzer, Jens Schneider,             *
00003  *                           Matthias Hardt, Guido Madaus                  *
00004  *                                                                         *
00005  *   Copyright (C) 2007-2008 BerLinux Solutions GbR                        *
00006  *                           Stefan Schwarzer & Guido Madaus               *
00007  *                                                                         *
00008  *   Copyright (C) 2009-2013 BerLinux Solutions GmbH                       *
00009  *                                                                         *
00010  *   Authors:                                                              *
00011  *      Stefan Schwarzer   <stefan.schwarzer@diskohq.org>,                 *
00012  *      Matthias Hardt     <matthias.hardt@diskohq.org>,                   *
00013  *      Jens Schneider     <jens.schneider@diskohq.org>,                   *
00014  *      Guido Madaus       <guido.madaus@diskohq.org>,                     *
00015  *      Patrick Helterhoff <patrick.helterhoff@diskohq.org>,               *
00016  *      René Bählkow       <rene.baehlkow@diskohq.org>                     *
00017  *                                                                         *
00018  *   This library is free software; you can redistribute it and/or         *
00019  *   modify it under the terms of the GNU Lesser General Public            *
00020  *   License version 2.1 as published by the Free Software Foundation.     *
00021  *                                                                         *
00022  *   This library is distributed in the hope that it will be useful,       *
00023  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00024  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00025  *   Lesser General Public License for more details.                       *
00026  *                                                                         *
00027  *   You should have received a copy of the GNU Lesser General Public      *
00028  *   License along with this library; if not, write to the                 *
00029  *   Free Software Foundation, Inc.,                                       *
00030  *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA            *
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 // support old renamed methods
00042 #define searchForWidget findWidget
00043 
00044 
00045 
00046 //! With this class you can load dialog files written in disko's XML syntax.
00047 /*!
00048 It is recommended to use XML files to describe the layout of your dialog windows.
00049 So you can change it (design it) without changing your C++ code. With the
00050 dialog manager you also minimize the lines of your C++ code.
00051 \author Jens Schneider
00052 */
00053 class MMSDialogManager {
00054     private:
00055         //! if leave_window, then you can use a single MMSDialogManager instance to load
00056         //! more than one dialog window with the loadDialog() method
00057         bool                    leave_window;
00058 
00059         //! pointer to the instantiated window
00060         MMSWindow               *rootWindow;
00061 
00062         //! is window instantiated by me?
00063         bool                    rootWindow_is_mine;
00064 
00065         //! loaded child windows
00066         vector<MMSChildWindow*> childWins;
00067 
00068         //! filename of dialog's XML source
00069         string                  filename;
00070 
00071         //! description of the dialog
00072         MMSDescriptionClass     description;
00073 
00074         //! list of widgets with a name
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 /*MMSDIALOGMANAGER_H_*/

Generated by doxygen