Delete some debug symbols
[mverbiste] / mainwindow.h
1 #ifndef MAINWINDOW_H
2 #define MAINWINDOW_H
3
4 #include <QtGui/QMainWindow>
5 #include <QtGui/QTextEdit>
6 #include <QtGui/QPushButton>
7 #include <QtGui/QCheckBox>
8 #include <QtGui/QVBoxLayout>
9 #include <QtGui/QLineEdit>
10 #include <QtGui/QScrollArea>
11 #include <QtGui/QLabel>
12 #include <QtGui/QTableWidget>
13 #include <QtGui/QMessageBox>
14 #include <QtGui/QActionGroup>
15
16 #if defined(Q_WS_MAEMO_5)
17 #include <QtMaemo5>
18 #endif
19
20 /* Verbiste */
21 #include <iostream>
22 #include <vector>
23 #include <string.h>
24 #include <verbiste/FrenchVerbDictionary.h>
25 #include "gui/conjugation.h"
26 #include "about.h"
27
28 #ifndef QT_NO_DEBUG
29 #include <QtCore/QDebug>
30 #include <QtCore/QElapsedTimer>
31 #endif
32
33 using namespace verbiste;
34
35 namespace Ui {
36     class MainWindow;
37     class ResultPage;
38 }
39
40 class ResultPage
41 {
42 public:
43     QScrollArea *page;
44     QGridLayout *grid;
45
46     ResultPage();
47     // No destructor because this object does not own the two widgets.
48     void packContent();
49
50 private:
51     QWidget *immediate;
52 };
53
54 class MainWindow : public QMainWindow
55 {
56     Q_OBJECT
57 public:
58     enum ScreenOrientation {
59         ScreenOrientationLockPortrait,
60         ScreenOrientationLockLandscape,
61         ScreenOrientationAuto
62     };
63
64     explicit MainWindow(QWidget *parent = 0);
65     virtual ~MainWindow();
66
67     // Setup UI by coding, not by QtDesigner
68     void setupcodedUI();
69
70     // Note that this will only have an effect on Symbian and Fremantle.
71     void setOrientation(ScreenOrientation orientation);
72
73     void showExpanded();
74     void initverbiste();
75     QVBoxLayout* makeResultCell(const VVS &tenseIterator,
76                                 const std::string &tenseName,
77                                 const std::string &inputWord,
78                                 FrenchVerbDictionary *verbDict);
79
80 public slots:
81     void startLookup();
82     void switchLang();
83
84 private:
85     Ui::MainWindow *ui;
86     QWidget     *cent;               // Central widget
87     QVBoxLayout *mlayout;            // Main layout
88     QTabWidget  *resultPages;
89     QHBoxLayout *btlayout;           // Layout to pack the functional buttons
90     QPushButton *btnClear;           // Clear button
91     QCheckBox   *btnPron;
92     QLineEdit   *wordinput;          //  Word input
93     QPushButton *btnLookup;          // Lookup button
94     QAction     *filFrench;
95     QAction     *filItalian;
96     QMessageBox *msgbox;
97     std::string langCode;
98     FrenchVerbDictionary *freVerbDic;
99     AboutDialog *aboutDialog;
100
101     ResultPage* addResultPage(const std::string &labelText);
102 #ifndef QT_NO_DEBUG
103     QElapsedTimer timer;
104 #endif
105
106 private slots:
107     void clearResults();
108     void startAgain();
109 };
110
111
112 #endif // MAINWINDOW_H