1 /*
2  * This file is part of Licq, an instant messaging client for UNIX.
3  * Copyright (C) 2007-2012 Licq developers <licq-dev@googlegroups.com>
4  *
5  * Licq is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * Licq is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with Licq; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18  */
19 
20 #ifndef SETTINGS_STATUS_H
21 #define SETTINGS_STATUS_H
22 
23 #include <config.h>
24 
25 #include <QObject>
26 
27 class QComboBox;
28 class QGridLayout;
29 class QGroupBox;
30 class QLabel;
31 class QPushButton;
32 class QVBoxLayout;
33 
34 namespace LicqQtGui
35 {
36 class MLEdit;
37 class SettingsDlg;
38 class SpecialSpinBox;
39 
40 namespace Settings
41 {
42 class Status : public QObject
43 {
44   Q_OBJECT
45 
46 public:
47   Status(SettingsDlg* parent);
~Status()48   virtual ~Status() {}
49 
50   void load();
51   void apply();
52 
53 private slots:
54   void sarMsgChanged(int msg);
55   void sarGroupChanged(int group);
56   void saveSar();
57   void showSarHints();
58 
59 private:
60   /**
61    * Setup the status page.
62    *
63    * @return a widget with the status settings
64    */
65   QWidget* createPageStatus(QWidget* parent);
66 
67   /**
68    * Setup the response messages page.
69    *
70    * @return a widget with the response message settings
71    */
72   QWidget* createPageRespMsg(QWidget* parent);
73 
74   void buildAutoStatusCombos(bool firstTime);
75 
76   // Widgets for status settings
77   QGroupBox* myGeneralBox;
78   QVBoxLayout* myGeneralLayout;
79   QGroupBox* myAutoAwayBox;
80   QGridLayout* myAutoAwayLayout;
81   QLabel* myAutoAwayLabel;
82   QLabel* myAutoNaLabel;
83   QLabel* myAutoOfflineLabel;
84   SpecialSpinBox* myAutoAwaySpin;
85   SpecialSpinBox* myAutoNaSpin;
86   SpecialSpinBox* myAutoOfflineSpin;
87   QComboBox* myAutoAwayMessCombo;
88   QComboBox* myAutoNaMessCombo;
89 
90   // Widgets for response message settings
91   QGroupBox* myDefRespMsgBox;
92   QGridLayout* myDefRespMsgLayout;
93   QLabel* mySarGroupLabel;
94   QLabel* mySarMsgLabel;
95   QComboBox* mySarGroupCombo;
96   QComboBox* mySarMsgCombo;
97   MLEdit* mySartextEdit;
98   QPushButton* mySarsaveButton;
99   QPushButton* mySarhintsButton;
100 };
101 
102 } // namespace Settings
103 } // namespace LicqQtGui
104 
105 #endif
106