QVisu
Qt-based visualization for smart homes
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
C:/Users/max/ti/qt5/qvisu/qvswitchicon.h
1 /* QVisu (c) 2015 Maximilian Gauger mgauger@kalassi.de
2  *
3  * This program is free software: you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License as published by
5  * the Free Software Foundation, either version 2 of the License, or
6  * (at your option) any later version.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12 
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  */
16 
17 #ifndef QVSWITCHICON_H
18 #define QVSWITCHICON_H
19 
20 #include <QtXml>
21 #include <QByteArray>
22 #include "qviconwidget.h"
23 
24 class QVSwitchIcon : public QVIconWidget
25 {
26  Q_OBJECT
27 public:
28  explicit QVSwitchIcon(QDomElement e_item, QWidget *parent);
29  explicit QVSwitchIcon(QString icon_file, QString color, QString active_color, QString s_color_mode, QWidget *parent);
30 
31  const static int ColorModeReplace = 0;
32  const static int ColorModeStroke = 1;
33  const static int ColorModeFill = 2;
34  const static int ColorModeAll = 3;
35 
36  void setColorMode(int);
37  QSize defaultSize() const;
38  QSize sizeHint() const;
39 
40 signals:
41 
42 public slots:
43  void setStatus(bool);
44 
45 private:
46  QByteArray icon_default, icon_on;
47  bool icon_loaded;
48  int color_mode;
49  QString color_orig, color_default, color_on;
50 
51  void init(QString icon_file, QString color, QString active_color, QString s_color_mode);
52 };
53 
54 #endif // QVSWITCHICON_H
Definition: qvswitchicon.h:24
Definition: qviconwidget.h:26