-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinputform.h
58 lines (51 loc) · 1.65 KB
/
inputform.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
#ifndef INPUTFORM_H
#define INPUTFORM_H
#include "adjdecloader.h"
#include "dictloader_edict.h"
#include "dictloadersep.h"
#include "hanzisearch.h"
#include <QObject>
#include <QWebView>
#include <QClipboard>
#include <QLineEdit>
#include <ui_mainwindow.h>
#include <QStringListModel>
// copys the text from the clipboard and calls a certain input form in the webview
class InputForm : public QObject
{
Q_OBJECT
public:
explicit InputForm(Ui::MainWindow *ui, QObject *parent = 0);
void updateModels();
void loadSimplified();
void loadTraditional();
public slots:
private slots:
void onLoadFinished(bool);
void clipboardChanged(QClipboard::Mode mode);
void replyFinished(QNetworkReply *reply);
void onAdjListItemClicked(QModelIndex index);
void onDecListItemClicked(QModelIndex index);
void stToggle(bool pressed); // toggle between simplified and traditional characters
private:
QWebView *webView_;
// QWebView *webView1_;
QLineEdit * RTHLineEdit_;
QLineEdit * translationLineEdit_;
QLineEdit *translationEnLineEdit_;
QTextEdit * decTextEdit_;
QTextEdit *adjTextEdit_;
HanziSearch * hanziSearch;
QSharedPointer<AdjDecLoader> adjLoader;
QSharedPointer<AdjDecLoader> decLoader;
DictLoaderSep * dictLoader;
QSharedPointer<DictLoaderEdict> dictLoaderEn;
QClipboard * clipboard;
QChar currentChar; // the characters that are currently in the clipboard or that have ben clicked
QNetworkAccessManager *manager;
QTextEdit *ceTextEdit_;
Ui::MainWindow *ui_;
QStringListModel * adjModel_;
QStringListModel * decModel_;
};
#endif // INPUTFORM_H