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

mmscheckboxwidget.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 MMSCHECKBOXWIDGET_H_
00034 #define MMSCHECKBOXWIDGET_H_
00035 
00036 #include "mmsgui/mmswidget.h"
00037 
00038 
00039 //! With this class you can display an on/off switch.
00040 /*!
00041 The checkbox is focusable.
00042 \author Jens Schneider
00043 */
00044 class MMSCheckBoxWidget : public MMSWidget {
00045     private:
00046         string                  className;
00047         MMSCheckBoxWidgetClass  *checkBoxWidgetClass;
00048         MMSCheckBoxWidgetClass  myCheckBoxWidgetClass;
00049 
00050         MMSFBSurface    *checked_bgimage;
00051         MMSFBSurface    *checked_selbgimage;
00052         MMSFBSurface    *checked_bgimage_p;
00053         MMSFBSurface    *checked_selbgimage_p;
00054         MMSFBSurface    *checked_bgimage_i;
00055         MMSFBSurface    *checked_selbgimage_i;
00056 
00057         //! current checked background values set?
00058         bool            current_checked_bgset;
00059 
00060         //! current checked background color
00061         MMSFBColor      current_checked_bgcolor;
00062 
00063         //! current checked background image
00064         MMSFBSurface    *current_checked_bgimage;
00065 
00066         bool create(MMSWindow *root, string className, MMSTheme *theme);
00067 
00068         bool init();
00069         bool release();
00070 
00071         void getCheckedBackground(MMSFBColor *color, MMSFBSurface **image);
00072         bool enableRefresh(bool enable = true);
00073         bool checkRefreshStatus();
00074 
00075         bool draw(bool *backgroundFilled = NULL);
00076 
00077         void handleInput(MMSInputEvent *inputevent);
00078 
00079     public:
00080         MMSCheckBoxWidget(MMSWindow *root, string className, MMSTheme *theme = NULL);
00081         ~MMSCheckBoxWidget();
00082 
00083         MMSWidget *copyWidget();
00084 
00085     public:
00086         // theme access methods
00087         bool    getCheckedBgColor(MMSFBColor &checked_bgcolor);
00088         bool    getCheckedSelBgColor(MMSFBColor &checked_selbgcolor);
00089         bool    getCheckedBgColor_p(MMSFBColor &checked_bgcolor_p);
00090         bool    getCheckedSelBgColor_p(MMSFBColor &checked_selbgcolor_p);
00091         bool    getCheckedBgColor_i(MMSFBColor &checked_bgcolor_i);
00092         bool    getCheckedSelBgColor_i(MMSFBColor &checked_selbgcolor_i);
00093         bool    getCheckedBgImagePath(string &checked_bgimagepath);
00094         bool    getCheckedBgImageName(string &checked_bgimagename);
00095         bool    getCheckedSelBgImagePath(string &checked_selbgimagepath);
00096         bool    getCheckedSelBgImageName(string &checked_selbgimagename);
00097         bool    getCheckedBgImagePath_p(string &checked_bgimagepath_p);
00098         bool    getCheckedBgImageName_p(string &checked_bgimagename_p);
00099         bool    getCheckedSelBgImagePath_p(string &checked_selbgimagepath_p);
00100         bool    getCheckedSelBgImageName_p(string &checked_selbgimagename_p);
00101         bool    getCheckedBgImagePath_i(string &checked_bgimagepath_i);
00102         bool    getCheckedBgImageName_i(string &checked_bgimagename_i);
00103         bool    getCheckedSelBgImagePath_i(string &checked_selbgimagepath_i);
00104         bool    getCheckedSelBgImageName_i(string &checked_selbgimagename_i);
00105         bool    getChecked(bool &checked);
00106 
00107         void setCheckedBgColor(MMSFBColor checked_bgcolor, bool refresh = true);
00108         void setCheckedSelBgColor(MMSFBColor checked_selbgcolor, bool refresh = true);
00109         void setCheckedBgColor_p(MMSFBColor checked_bgcolor_p, bool refresh = true);
00110         void setCheckedSelBgColor_p(MMSFBColor checked_selbgcolor_p, bool refresh = true);
00111         void setCheckedBgColor_i(MMSFBColor checked_bgcolor_i, bool refresh = true);
00112         void setCheckedSelBgColor_i(MMSFBColor checked_selbgcolor_i, bool refresh = true);
00113         void setCheckedBgImagePath(string checked_bgimagepath, bool load = true, bool refresh = true);
00114         void setCheckedBgImageName(string checked_bgimagename, bool load = true, bool refresh = true);
00115         void setCheckedSelBgImagePath(string checked_selbgimagepath, bool load = true, bool refresh = true);
00116         void setCheckedSelBgImageName(string checked_selbgimagename, bool load = true, bool refresh = true);
00117         void setCheckedBgImagePath_p(string checked_bgimagepath_p, bool load = true, bool refresh = true);
00118         void setCheckedBgImageName_p(string checked_bgimagename_p, bool load = true, bool refresh = true);
00119         void setCheckedSelBgImagePath_p(string checked_selbgimagepath_p, bool load = true, bool refresh = true);
00120         void setCheckedSelBgImageName_p(string checked_selbgimagename_p, bool load = true, bool refresh = true);
00121         void setCheckedBgImagePath_i(string checked_bgimagepath_i, bool load = true, bool refresh = true);
00122         void setCheckedBgImageName_i(string checked_bgimagename_i, bool load = true, bool refresh = true);
00123         void setCheckedSelBgImagePath_i(string checked_selbgimagepath_i, bool load = true, bool refresh = true);
00124         void setCheckedSelBgImageName_i(string checked_selbgimagename_i, bool load = true, bool refresh = true);
00125         void setChecked(bool checked, bool refresh = true);
00126 
00127         void updateFromThemeClass(MMSCheckBoxWidgetClass *themeClass);
00128 };
00129 
00130 #endif /*MMSCHECKBOXWIDGET_H_*/

Generated by doxygen