Some changes in look of xdxf dialog on desktop
[mdictionary] / src / plugins / xdxf / XdxfDialog.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 //Created by Mateusz Półrola
23
24 #ifndef XDXFDIALOG_H
25 #define XDXFDIALOG_H
26
27 #include <QDialog>
28 #include "../../include/settings.h"
29 #include <QtGui>
30 #include "xdxfplugin.h"
31
32 class XdxfDialog : public QDialog
33 {
34     Q_OBJECT
35 public:
36     enum XdxfDialogType {New, Change};
37
38     explicit XdxfDialog(XdxfPlugin* plugin = 0,
39                         XdxfDialogType type = New,
40                         QWidget *parent = 0);
41
42     Settings* getSettings();
43
44 Q_SIGNALS:
45     void notify(Notify::NotifyType, QString);
46
47 public Q_SLOTS:
48     void accept();
49
50 private Q_SLOTS:
51     void selectFile();
52     void saveSettings();
53     void setGenerateCache(bool);
54     void setAccents(bool);
55
56     #ifdef Q_WS_MAEMO_5
57         void showCacheInfo();
58         void showAccentsInfo();
59     #endif
60
61
62 private:
63     void initializeUI();
64
65     QLabel* infoLabel;
66     QPushButton* browseButton;
67     QHBoxLayout* browseLayout;
68
69
70     QCheckBox* cacheCheckBox;
71     QCheckBox* accentsCheckBox;
72     QHBoxLayout* cacheLayout;
73     QHBoxLayout* accentsLayout;
74
75     QString cacheToolTip;
76     QString accentsToolTip;
77
78     #ifdef Q_WS_MAEMO_5
79         QToolButton* cacheInfoToolButton;
80         QToolButton* accentsInfoToolButton;
81     #endif
82
83
84     QPushButton* confirmButton;
85
86     QString _dictionaryFilePath;
87
88     QScrollArea* scrollArea;
89
90     QWidget* widget;
91     QHBoxLayout* layout;
92
93     QVBoxLayout* mainVerticalLayout;
94     bool _generateCache;
95     bool _accents;
96     bool _lastAccents;
97
98     Settings* _settings;
99
100     XdxfPlugin* plugin;
101     XdxfDialogType type;
102 };
103
104 #endif // XDXFDIALOG_H