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

mmstheme.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 MMSTHEME_H_
00034 #define MMSTHEME_H_
00035 
00036 #include "mmstools/mmserror.h"
00037 #include "mmsgui/theme/mmsthemeclass.h"
00038 #include "mmsgui/theme/mmsdescriptionclass.h"
00039 #include "mmsgui/theme/mmstemplateclass.h"
00040 #include "mmsgui/theme/mmsmainwindowclass.h"
00041 #include "mmsgui/theme/mmspopupwindowclass.h"
00042 #include "mmsgui/theme/mmsrootwindowclass.h"
00043 #include "mmsgui/theme/mmschildwindowclass.h"
00044 #include "mmsgui/theme/mmslabelwidgetclass.h"
00045 #include "mmsgui/theme/mmsimagewidgetclass.h"
00046 #include "mmsgui/theme/mmsbuttonwidgetclass.h"
00047 #include "mmsgui/theme/mmsprogressbarwidgetclass.h"
00048 #include "mmsgui/theme/mmsmenuwidgetclass.h"
00049 #include "mmsgui/theme/mmstextboxwidgetclass.h"
00050 #include "mmsgui/theme/mmsarrowwidgetclass.h"
00051 #include "mmsgui/theme/mmssliderwidgetclass.h"
00052 #include "mmsgui/theme/mmsinputwidgetclass.h"
00053 #include "mmsgui/theme/mmscheckboxwidgetclass.h"
00054 #include "mmsgui/theme/mmscanvaswidgetclass.h"
00055 
00056 
00057 MMS_CREATEERROR(MMSThemeError);
00058 
00059 
00060 extern TAFF_DESCRIPTION mmsgui_taff_description;
00061 
00062 typedef enum {
00063     MMSGUI_TAGTABLE_TAG_MMSTHEME,
00064     MMSGUI_TAGTABLE_TAG_MMSDIALOG,
00065     MMSGUI_TAGTABLE_TAG_DESCRIPTION,
00066     MMSGUI_TAGTABLE_TAG_VBOXWIDGET,
00067     MMSGUI_TAGTABLE_TAG_HBOXWIDGET,
00068     MMSGUI_TAGTABLE_TAG_TEMPLATE,
00069     MMSGUI_TAGTABLE_TAG_CLASS_TEMPLATE,
00070     MMSGUI_TAGTABLE_TAG_MAINWINDOW,
00071     MMSGUI_TAGTABLE_TAG_CLASS_MAINWINDOW,
00072     MMSGUI_TAGTABLE_TAG_CHILDWINDOW,
00073     MMSGUI_TAGTABLE_TAG_CLASS_CHILDWINDOW,
00074     MMSGUI_TAGTABLE_TAG_POPUPWINDOW,
00075     MMSGUI_TAGTABLE_TAG_CLASS_POPUPWINDOW,
00076     MMSGUI_TAGTABLE_TAG_ROOTWINDOW,
00077     MMSGUI_TAGTABLE_TAG_CLASS_ROOTWINDOW,
00078     MMSGUI_TAGTABLE_TAG_ARROWWIDGET,
00079     MMSGUI_TAGTABLE_TAG_CLASS_ARROWWIDGET,
00080     MMSGUI_TAGTABLE_TAG_BUTTONWIDGET,
00081     MMSGUI_TAGTABLE_TAG_CLASS_BUTTONWIDGET,
00082     MMSGUI_TAGTABLE_TAG_IMAGEWIDGET,
00083     MMSGUI_TAGTABLE_TAG_CLASS_IMAGEWIDGET,
00084     MMSGUI_TAGTABLE_TAG_LABELWIDGET,
00085     MMSGUI_TAGTABLE_TAG_CLASS_LABELWIDGET,
00086     MMSGUI_TAGTABLE_TAG_MENUWIDGET,
00087     MMSGUI_TAGTABLE_TAG_CLASS_MENUWIDGET,
00088     MMSGUI_TAGTABLE_TAG_MENUITEM,
00089     MMSGUI_TAGTABLE_TAG_PROGRESSBARWIDGET,
00090     MMSGUI_TAGTABLE_TAG_CLASS_PROGRESSBARWIDGET,
00091     MMSGUI_TAGTABLE_TAG_SLIDERWIDGET,
00092     MMSGUI_TAGTABLE_TAG_CLASS_SLIDERWIDGET,
00093     MMSGUI_TAGTABLE_TAG_TEXTBOXWIDGET,
00094     MMSGUI_TAGTABLE_TAG_CLASS_TEXTBOXWIDGET,
00095     MMSGUI_TAGTABLE_TAG_INPUTWIDGET,
00096     MMSGUI_TAGTABLE_TAG_CLASS_INPUTWIDGET,
00097     MMSGUI_TAGTABLE_TAG_CHECKBOXWIDGET,
00098     MMSGUI_TAGTABLE_TAG_CLASS_CHECKBOXWIDGET,
00099     MMSGUI_TAGTABLE_TAG_CANVASWIDGET,
00100     MMSGUI_TAGTABLE_TAG_CLASS_CANVASWIDGET,
00101     MMSGUI_TAGTABLE_TAG_GAPWIDGET,
00102 } MMSGUI_TAGTABLE_TAG;
00103 
00104 
00105 
00106 
00107 class MMSTheme {
00108     private:
00109         //! path to the theme
00110         string              path;
00111 
00112         //! name of the theme e.g. "default"
00113         string              themeName;
00114 
00115         //! path to theme files
00116         string              themePath;
00117 
00118         //! complete name of the theme file
00119         string              themeFile;
00120 
00121         //! attributes of the mmstheme tag
00122         MMSThemeClass       theme_tag;
00123 
00124         //! description of the theme
00125         MMSDescriptionClass description;
00126 
00127         vector<MMSTemplateClass*>           templateClasses;
00128         vector<MMSMainWindowClass*>         mainWindowClasses;
00129         vector<MMSPopupWindowClass*>        popupWindowClasses;
00130         vector<MMSRootWindowClass*>         rootWindowClasses;
00131         vector<MMSChildWindowClass*>        childWindowClasses;
00132         vector<MMSLabelWidgetClass*>        labelWidgetClasses;
00133         vector<MMSImageWidgetClass*>        imageWidgetClasses;
00134         vector<MMSCanvasWidgetClass*>       canvasWidgetClasses;
00135         vector<MMSButtonWidgetClass*>       buttonWidgetClasses;
00136         vector<MMSProgressBarWidgetClass*>  progressBarWidgetClasses;
00137         vector<MMSMenuWidgetClass*>         menuWidgetClasses;
00138         vector<MMSTextBoxWidgetClass*>      textBoxWidgetClasses;
00139         vector<MMSArrowWidgetClass*>        arrowWidgetClasses;
00140         vector<MMSSliderWidgetClass*>       sliderWidgetClasses;
00141         vector<MMSInputWidgetClass*>        inputWidgetClasses;
00142         vector<MMSCheckBoxWidgetClass*>     checkBoxWidgetClasses;
00143 
00144         bool addTemplateClass(MMSTemplateClass *themeClass);
00145         bool addMainWindowClass(MMSMainWindowClass *themeClass);
00146         bool addPopupWindowClass(MMSPopupWindowClass *themeClass);
00147         bool addRootWindowClass(MMSRootWindowClass *themeClass);
00148         bool addChildWindowClass(MMSChildWindowClass *themeClass);
00149         bool addLabelWidgetClass(MMSLabelWidgetClass *themeClass);
00150         bool addImageWidgetClass(MMSImageWidgetClass *themeClass);
00151         bool addCanvasWidgetClass(MMSCanvasWidgetClass *themeClass);
00152         bool addButtonWidgetClass(MMSButtonWidgetClass *themeClass);
00153         bool addProgressBarWidgetClass(MMSProgressBarWidgetClass *themeClass);
00154         bool addMenuWidgetClass(MMSMenuWidgetClass *themeClass);
00155         bool addTextBoxWidgetClass(MMSTextBoxWidgetClass *themeClass);
00156         bool addArrowWidgetClass(MMSArrowWidgetClass *themeClass);
00157         bool addSliderWidgetClass(MMSSliderWidgetClass *themeClass);
00158         bool addInputWidgetClass(MMSInputWidgetClass *themeClass);
00159         bool addCheckBoxWidgetClass(MMSCheckBoxWidgetClass *themeClass);
00160 
00161     public:
00162 
00163         MMSMainWindowClass          mainWindowClass;
00164         MMSPopupWindowClass         popupWindowClass;
00165         MMSRootWindowClass          rootWindowClass;
00166         MMSChildWindowClass         childWindowClass;
00167         MMSLabelWidgetClass         labelWidgetClass;
00168         MMSImageWidgetClass         imageWidgetClass;
00169         MMSCanvasWidgetClass        canvasWidgetClass;
00170         MMSButtonWidgetClass        buttonWidgetClass;
00171         MMSProgressBarWidgetClass   progressBarWidgetClass;
00172         MMSMenuWidgetClass          menuWidgetClass;
00173         MMSTextBoxWidgetClass       textBoxWidgetClass;
00174         MMSArrowWidgetClass         arrowWidgetClass;
00175         MMSSliderWidgetClass        sliderWidgetClass;
00176         MMSInputWidgetClass         inputWidgetClass;
00177         MMSCheckBoxWidgetClass      checkBoxWidgetClass;
00178 
00179         MMSTemplateClass*           getTemplateClass(string className = "");
00180         MMSMainWindowClass*         getMainWindowClass(string className = "");
00181         MMSPopupWindowClass*        getPopupWindowClass(string className = "");
00182         MMSRootWindowClass*         getRootWindowClass(string className = "");
00183         MMSChildWindowClass*        getChildWindowClass(string className = "");
00184         MMSLabelWidgetClass*        getLabelWidgetClass(string className = "");
00185         MMSImageWidgetClass*        getImageWidgetClass(string className = "");
00186         MMSCanvasWidgetClass*       getCanvasWidgetClass(string className = "");
00187         MMSButtonWidgetClass*       getButtonWidgetClass(string className = "");
00188         MMSProgressBarWidgetClass*  getProgressBarWidgetClass(string className = "");
00189         MMSMenuWidgetClass*         getMenuWidgetClass(string className = "");
00190         MMSTextBoxWidgetClass*      getTextBoxWidgetClass(string className = "");
00191         MMSArrowWidgetClass*        getArrowWidgetClass(string className = "");
00192         MMSSliderWidgetClass*       getSliderWidgetClass(string className = "");
00193         MMSInputWidgetClass*        getInputWidgetClass(string className = "");
00194         MMSCheckBoxWidgetClass*     getCheckBoxWidgetClass(string className = "");
00195 
00196         MMSTheme(bool initial_load, bool debug);
00197         ~MMSTheme();
00198 
00199         void setTheme(string path, string themeName);
00200         string getPath();
00201         string getThemeName();
00202         string getThemePath();
00203         string getThemeFile();
00204 
00205     /* friends */
00206     friend class MMSThemeManager;
00207 };
00208 
00209 
00210 /* access to global theme */
00211 extern MMSTheme *globalTheme;
00212 
00213 
00214 #endif /*MMSTHEME_H_*/
00215 
00216 
00217 

Generated by doxygen