e3d55029462f0b767788bced9deb28ef79151673
[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 using namespace verbiste;
20
21 namespace Ui {
22     class MainWindow;
23     class ResultPage;
24 }
25
26 class ResultPage
27 {
28 public:
29     QScrollArea *page;
30     QTableWidget *table;
31
32     ResultPage();
33     // No destructor because this object does not own the two widgets.
34 };
35
36 class MainWindow : public QMainWindow
37 {
38     Q_OBJECT
39 public:
40     enum ScreenOrientation {
41         ScreenOrientationLockPortrait,
42         ScreenOrientationLockLandscape,
43         ScreenOrientationAuto
44     };
45
46     explicit MainWindow(QWidget *parent = 0);
47     virtual ~MainWindow();
48
49     // Setup UI by coding, not by QtDesigner
50     void setupcodedUI();
51
52     // Note that this will only have an effect on Symbian and Fremantle.
53     void setOrientation(ScreenOrientation orientation);
54
55     void showExpanded();
56     void initverbiste();
57
58 public slots:
59     void startLookup();
60
61 private:
62     Ui::MainWindow *ui;
63     QWidget     *cent;               // Central widget
64     QVBoxLayout *mlayout;            // Main layout
65     QTabWidget  *resultPages;
66     QHBoxLayout *btlayout;           // Layout to pack the functional buttons
67     QPushButton *btnClear;           // Clear button
68     QLineEdit   *wordinput;          //  Word input
69     QPushButton *btnLookup;          // Lookup button
70     QLabel      *labVerb;
71     std::string langCode;
72     FrenchVerbDictionary *freVerbDic;
73
74     ResultPage* addResultPage(const std::string &labelText);
75
76 private slots:
77     void clearResults();
78 };
79
80
81 #endif // MAINWINDOW_H