Changed include folder name
[mdictionary] / src / mdictionary / gui / SettingsWidget.h
1 /*******************************************************************************
2
3     This file is part of mDictionary.
4
5     mDictionary 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 3 of the License, or
8     (at your option) any later version.
9
10     mDictionary 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 mDictionary.  If not, see <http://www.gnu.org/licenses/>.
17
18     Copyright 2010 Comarch S.A.
19
20 *******************************************************************************/
21
22 //! \file DictManagerWidget.h
23 //! \author Mateusz Półrola <mateusz.polrola@comarch.pl>
24
25 #ifndef SETTINGSWIDGET_H
26 #define SETTINGSWIDGET_H
27
28 #include <QWidget>
29 #include <QtGui>
30 #include <QPushButton>
31 #include "../../include/GUIInterface.h"
32 #include "../../include/settings.h"
33
34 //! Implements applications settings widget
35 /*!
36   Shows settings that user can change.
37   It allows to change limit of searches and limit of history.
38   It also allows to select if application has to search in dictionaries or in
39   bookmarks or in both of them. All changes are saved automatically after
40   hiding of this widget.
41   */
42 class SettingsWidget : public QDialog
43 {
44     Q_OBJECT
45 public:
46     //! Constructor
47     /*!
48       \param parent parent of this widget, which must be subclass of
49       GUIInterface, because it will use it to get current settings and
50       set new ones.
51       */
52     explicit SettingsWidget(GUIInterface *parent = 0);
53
54
55 protected:
56     void showEvent(QShowEvent *);
57     void hideEvent(QHideEvent *);
58
59 private Q_SLOTS:
60     void changed();
61     #ifndef Q_WS_MAEMO_5
62         void save();
63     #endif
64
65 private:
66     void initalizeUI();
67     QSpinBox* historySizeSpinBox;
68     QSpinBox* searchResultSizeSpinBox;
69     QVBoxLayout* verticalLayout;
70     QFormLayout* spinBoxesFormLayout;
71
72     QLabel* checkBoxesLabel;
73     QCheckBox* searchInDictionariesCheckBox;
74     QCheckBox* searchInBookmarksCheckBox;
75
76     GUIInterface* guiInterface;
77     Settings* settings;
78     bool _changed;
79     QString limitTip;
80     #ifndef Q_WS_MAEMO_5
81         QPushButton* closeButton;
82         QHBoxLayout* footerLayout;
83         bool _save;
84     #endif
85
86
87
88 };
89
90 #endif // SETTINGSWIDGET_H