qml ComboBox component and GoogleDialog complete
[mdictionary] / src / plugins / google / GoogleDialog.h
index 52464b1..6ca7c7b 100644 (file)
 
 #include <QDialog>
 #include "../../include/settings.h"
+#include "../../include/ComboBoxModel.h"
 #include <QtGui>
+
+
 #include <QDeclarativeView>
+#include <QDeclarativeContext>
+#include <QList>
 
 #include "GooglePlugin.h"
 
@@ -75,9 +80,17 @@ Q_SIGNALS:
     //! requests to show notification
     void notify(Notify::NotifyType, QString);
 
+#ifndef Q_WS_MAEMO_5
+    void setInfo(QVariant info);
+    void setNew(QVariant text);
+    void setStartValues(QVariant from, QVariant to, QVariant fromIndex, QVariant toIndex);
+#endif
+
 public Q_SLOTS:
+#ifdef Q_Ws_MAEMO_5
     //! reimplemented accept method, to save new settings
     void accept();
+#endif
 
 private Q_SLOTS:
     //! assigns the language chosen from a list(langFromComboBox) to _langFrom
@@ -89,14 +102,28 @@ private Q_SLOTS:
     //! handles the "swap languages" button
     void changeLangButtonClicked();
 
+
+#ifndef Q_Ws_MAEMO_5
+    void saveButtonClicked(QString langFrom, QString langTo);
+#endif
+
 private:
-    QVBoxLayout* mainLayout;
-    QDeclarativeView *view;
 
     void initializeUI();
 
     //! saves new settings after acceptance of dialog
+#ifdef Q_Ws_MAEMO_5
     void saveSettings();
+#else
+    void saveSettings(QString langFrom, QString langTo);
+
+    ComboBoxModel* model;
+    QVBoxLayout* mainLayout;
+    QDeclarativeView *view;
+    QDeclarativeContext* ctxt;
+#endif
+
+    int lastHeight;
 
     QLabel* infoLabel;
     QLabel* langFromLabel;
@@ -112,6 +139,8 @@ private:
     QHBoxLayout* changeLangLayout;
     QString _langFrom;
     QString _langTo;
+    int _actualLangTo;
+    int _actualLangFrom;
 
     Settings* _settings;
     GooglePlugin* plugin;