13ae5eef663af01467f737a89c5086dcaf66cc2d
[mdictionary] / trunk / src / plugins / google / src / GoogleSettingsDialog.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 GoogleSettingsDialog.h
23     \brief Class create dialog to get or change settings for Google Plagin
24     \author Jakub Jaszczynski <j.j.jaszczynski@gmail.com>
25 */
26
27 #ifndef GOOGLESETTINGSDIALOG_H
28 #define GOOGLESETTINGSDIALOG_H
29
30 #include <QDialog>
31 #include "../../../includes/settings.h"
32 #include <QtGui>
33 #include "GooglePlugin.h"
34
35 class GooglePlugin;
36
37 class GoogleSettingsDialog : public QDialog
38 {
39     Q_OBJECT
40 public:
41     explicit GoogleSettingsDialog(QWidget *parent = 0,QString langTo ="",QString langFrom ="");
42
43     /*!
44         \param parent parent widget on which will be displayed dialog
45         \param langTo language witch is display in the comboBox as a startup item
46         \param langFrom language witch is display in the comboBox as a startup item
47         \returns function return settings to GooglePlugin
48     */
49     static Settings* getSettings(QWidget *parent,QString langTo ="",QString langFrom ="");
50
51     /*!
52         function set a new settings in plugin;
53         \param plugin plugin whose settings you will change
54         \param parent parent widget on which will be displayed dialog
55     */
56     static void changeSettings(GooglePlugin* plugin, QWidget *parent);
57
58     //! \return source language code iso 639-2
59     QString langFrom();
60
61     //! \return destination language code iso 639-2
62     QString langTo();
63
64 public slots:
65     void activatedFrom(int);
66     void activatedTo(int);
67     void changeLangButtonClicked();
68
69 private:
70     QLabel* infoLabel;
71     QLabel* langFromLabel;
72     QLabel* langToLabel;
73     QLabel* connectInfoLabel;
74     QPushButton* saveButton;
75     QPushButton* changeLangButton;
76     QComboBox *langFromComboBox;
77     QComboBox *langToComboBox;
78
79     QVBoxLayout* verticalLayout;
80     QVBoxLayout* langLayout;
81     QHBoxLayout* langFromLayout;
82     QHBoxLayout* langToLayout;
83     QHBoxLayout* changelangLayout;
84
85     QString _langFrom;
86     QString _langTo;
87
88
89 /*    QPushButton* browseButton;
90     QLabel* browseLabel;
91     QCheckBox* cacheCheckBox;
92
93     QHBoxLayout* browseLayout;
94     QHBoxLayout* cacheLayout;
95 */
96 };
97
98 #endif // GOOGLESETTINGSDIALOG_H