1 /*******************************************************************************
3 This file is part of mDictionary.
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.
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.
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/>.
18 Copyright 2010 Comarch S.A.
20 *******************************************************************************/
21 //! \file TranslationWidget.h
22 //! \brief Implements translation widget
23 //! \author Mateusz Półrola <mateusz.polrola@comarch.pl>
25 #ifndef TRANSLATIONWIDGET_H
26 #define TRANSLATIONWIDGET_H
29 #include <QModelIndex>
31 #include "../backbone/backbone.h"
32 #include "TranslationWidgetAutoResizer.h"
35 #include "TranslationTextEdit.h"
36 #include <QPropertyAnimation>
38 //! Displays translation of word found in dictionaries
40 Display many translation of word, formatted as html.
42 class TranslationWidget : public QScrollArea {
45 explicit TranslationWidget(QWidget *parent = 0);
56 //! Request to show translation of word list passed as parameter.
57 void show(QStringList);
61 void keyPressEvent(QKeyEvent *);
65 void searchSelected();
67 void showButtons(bool);
71 QString XslConversion(QString translation);
72 QToolButton* zoomInToolButton;
73 QToolButton* zoomOutToolButton;
74 TranslationTextEdit *textEdit;
76 QToolButton* zoomInButton;
77 QToolButton* zoomOutButton;
78 QToolButton* selectAllButton;
79 QToolButton* copyButton;
80 QToolButton* searchButton;
81 QToolButton* showButtonsButton;
83 QPropertyAnimation* zoomInButtonAnimation;
84 QPropertyAnimation* zoomOutButtonAnimation;
85 QPropertyAnimation* copyButtonAnimation;
86 QPropertyAnimation* selectAllButtonAnimation;
87 QPropertyAnimation* searchButtonAnimation;
88 QAnimationGroup* buttonsAnimation;
91 bool buttonsInitialized;
94 void grabZoomKeys(bool);
96 QVBoxLayout *verticalLayout;
97 QHBoxLayout* horizontalLayout;
98 TranslationWidgetAutoResizer* resizer;
103 #endif // TRANSLATIONWIDGET_H