Added on screen button in maemo and hardware zoom buttons
[mdictionary] / trunk / src / base / gui / TranslationWidget.h
index 957f243..6d77227 100644 (file)
@@ -30,6 +30,8 @@
 #include <QtGui>
 #include "../backbone/backbone.h"
 #include "TranslationWidgetAutoResizer.h"
+#include "TranslationTextEdit.h"
+#include <QPropertyAnimation>
 
 //! Displays translation of word found in dictionaries
 /*!
@@ -43,6 +45,8 @@ public:
 Q_SIGNALS:
     void updateSize();
 
+    void search(QString);
+
 public Q_SLOTS:
     //! Show widget.
     void show();
@@ -50,21 +54,45 @@ public Q_SLOTS:
     //! Request to show translation of word list passed as parameter.
     void show(QStringList);
 
+protected:
+    #ifdef Q_WS_MAEMO_5
+        void keyPressEvent(QKeyEvent *);
+    #endif
+
+private Q_SLOTS:
+    void searchSelected();
+    #ifdef Q_WS_MAEMO_5
+        void showButtons(bool);
+    #endif
 
 private:
-    QTextEdit *textEdit;
-    QToolButton* zoomInToolButton;
-    QToolButton* zoomOutToolButton;
+    TranslationTextEdit *textEdit;
     #ifdef Q_WS_MAEMO_5
-        QToolButton* fullScreenButton;
-        QToolButton* backButton;
+        QToolButton* zoomInButton;
+        QToolButton* zoomOutButton;
+        QToolButton* selectAllButton;
+        QToolButton* copyButton;
+        QToolButton* searchButton;
+        QToolButton* showButtonsButton;
+
+        QPropertyAnimation* zoomInButtonAnimation;
+        QPropertyAnimation* zoomOutButtonAnimation;
+        QPropertyAnimation* copyButtonAnimation;
+        QPropertyAnimation* selectAllButtonAnimation;
+        QPropertyAnimation* searchButtonAnimation;
+        QAnimationGroup* buttonsAnimation;
+
+        void initButtons();
+        bool buttonsInitialized;
+        bool buttonsVisible;
+
+        void grabZoomKeys(bool);
     #endif
     QVBoxLayout *verticalLayout;
     QHBoxLayout* horizontalLayout;
     TranslationWidgetAutoResizer* resizer;
 
     void initializeUI();
-
 };
 
 #endif // TRANSLATIONWIDGET_H