Change the debug directive.
[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/QVBoxLayout>
8 #include <QtGui/QLineEdit>
9 #include <QtGui/QScrollArea>
10 #include <QtGui/QLabel>
11 #include <QtGui/QTableWidget>
12
13 /* Verbiste */
14 #include <iostream>
15 #include <vector>
16 #include <string.h>
17 #include <verbiste/FrenchVerbDictionary.h>
18 #include "gui/conjugation.h"
19
20 #ifndef QT_NO_DEBUG
21 #include <QDebug>
22 #endif
23
24 using namespace verbiste;
25
26 namespace Ui {
27     class MainWindow;
28     class ResultPage;
29 }
30
31 class ResultPage
32 {
33 public:
34     QScrollArea *page;
35     QGridLayout *grid;
36
37     ResultPage();
38     // No destructor because this object does not own the two widgets.
39     void packContent();
40
41 private:
42     QWidget *immediate;
43 };
44
45 class MainWindow : public QMainWindow
46 {
47     Q_OBJECT
48 public:
49     enum ScreenOrientation {
50         ScreenOrientationLockPortrait,
51         ScreenOrientationLockLandscape,
52         ScreenOrientationAuto
53     };
54
55     explicit MainWindow(QWidget *parent = 0);
56     virtual ~MainWindow();
57
58     // Setup UI by coding, not by QtDesigner
59     void setupcodedUI();
60
61     // Note that this will only have an effect on Symbian and Fremantle.
62     void setOrientation(ScreenOrientation orientation);
63
64     void showExpanded();
65     void initverbiste();
66     QVBoxLayout* makeResultCell(const VVS &tenseIterator,
67                                      const std::string &tenseName,
68                                      const std::string &inputWord,
69                                      FrenchVerbDictionary *verbDict);
70
71 public slots:
72     void startLookup();
73
74 private:
75     Ui::MainWindow *ui;
76     QWidget     *cent;               // Central widget
77     QVBoxLayout *mlayout;            // Main layout
78     QTabWidget  *resultPages;
79     QHBoxLayout *btlayout;           // Layout to pack the functional buttons
80     QPushButton *btnClear;           // Clear button
81     QLineEdit   *wordinput;          //  Word input
82     QPushButton *btnLookup;          // Lookup button
83     std::string langCode;
84     FrenchVerbDictionary *freVerbDic;
85
86     ResultPage* addResultPage(const std::string &labelText);
87
88 private slots:
89     void clearResults();
90     void startAgain();
91 };
92
93
94 #endif // MAINWINDOW_H