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 MMSBUTTONWIDGETCLASS_H_ 00034 #define MMSBUTTONWIDGETCLASS_H_ 00035 00036 #include "mmsgui/theme/mmswidgetclass.h" 00037 00038 //! describe attributes for MMSButtonWidget which are additional to the MMSWidgetClass 00039 namespace MMSGUI_BUTTONWIDGET_ATTR { 00040 00041 #define MMSGUI_BUTTONWIDGET_ATTR_INIT { \ 00042 MMSGUI_BASE_ATTR_ATTRDESC, \ 00043 MMSGUI_BORDER_ATTR_ATTRDESC, \ 00044 MMSGUI_WIDGET_ATTR_ATTRDESC, \ 00045 { NULL, TAFF_ATTRTYPE_NONE } \ 00046 } 00047 00048 typedef enum { 00049 MMSGUI_BASE_ATTR_IDS, 00050 MMSGUI_BORDER_ATTR_IDS, 00051 MMSGUI_WIDGET_ATTR_IDS 00052 } ids; 00053 } 00054 00055 extern TAFF_ATTRDESC MMSGUI_BUTTONWIDGET_ATTR_I[]; 00056 00057 00058 //! A data access class for the button widget. 00059 /*! 00060 This class is the base for the MMSButtonWidget class. 00061 With this data store you have access to all changeable widget attributes. 00062 It is also one of the base classes for MMSThemeManager and MMSDialogManager 00063 which are main features of the MMSGUI. 00064 \note This class will be internally used by class MMSButtonWidget. 00065 \author Jens Schneider 00066 */ 00067 class MMSButtonWidgetClass { 00068 private: 00069 //! name of the theme class 00070 string className; 00071 00072 //! Read and set all attributes from the given TAFF buffer. 00073 /*! 00074 \param tafff pointer to the TAFF buffer 00075 \param prefix optional, prefix to all attribute names (<prefix><attrname>=<attrvalue>) 00076 \param path optional, path needed for empty path values from the TAFF buffer 00077 \param reset_paths optional, should reset all path attributes? 00078 */ 00079 void setAttributesFromTAFF(MMSTaffFile *tafff, string *prefix = NULL, string *path = NULL, 00080 bool reset_paths = false); 00081 00082 public: 00083 //! stores base widget attributes 00084 MMSWidgetClass widgetClass; 00085 00086 //! Constructor of class MMSButtonWidgetClass. 00087 MMSButtonWidgetClass(); 00088 00089 //! Mark all attributes as not set. 00090 void unsetAll(); 00091 00092 //! Set the name of the theme class. 00093 /*! 00094 \param className name of the class 00095 */ 00096 void setClassName(string className); 00097 00098 //! Get the name of the theme class. 00099 /*! 00100 \return name of the class 00101 */ 00102 string getClassName(); 00103 00104 /* friends */ 00105 friend class MMSThemeManager; 00106 friend class MMSDialogManager; 00107 }; 00108 00109 #endif /*MMSBUTTONWIDGETCLASS_H_*/