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