Clean and order documentation in source files. Source ready to beta 2 release
[mdictionary] / src / desktopWidget / MainWidget.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 MainWidget.h
23     \brief Implements widget for maemo that allows user to search quickly right from home screen using mdictionary.
24
25     \author Mateusz Półrola <mateusz.polrola@comarch.pl>
26 */
27
28 #ifndef MAINWIDGET_H
29 #define MAINWIDGET_H
30
31 #include <QWidget>
32 #include <QtGui>
33 #include <QtDBus/QDBusConnection>
34 #include <QPushButton>
35
36 /*!
37   Shows tool button with logo of mDictionary which can start application.
38   In line edit user inputs word, and after using button next to it or pressing enter, widget runs mDictionary which immediately starts searching for a given word.
39   If mDictionary is already running in background it will show the program.
40   */
41 class HomeWidget : public QWidget
42 {
43     Q_OBJECT
44 public:
45     HomeWidget(QWidget *parent = 0);
46
47 private slots:
48     void search();
49     void logoClicked();
50
51 protected:
52     /*! Reimplemented paintEvent to display rounded corners with transparency */
53     void paintEvent(QPaintEvent *);
54
55 private:
56     /*! Initializes ui of widget*/
57     void initializeUI();
58
59     /*! Initializes X11 to set application type as home widget*/
60     void initializeX11();
61
62
63     QLineEdit* searchStringLineEdit;
64     QPushButton* searchButton;
65     QToolButton* logo;
66     QHBoxLayout* horizontalLayout;
67 };
68
69 #endif // MAINWIDGET_H