-
Notifications
You must be signed in to change notification settings - Fork 0
/
zhscwidget.h
157 lines (119 loc) · 2.87 KB
/
zhscwidget.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
/*
ZHSC
zhscwidget.h
v 0.0.1
2003/06/23
Copyright (C) 2003 Cavendish
cavendish@qiliang.net
http://www.qiliang.net/software/zhsc.html
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
*/
#ifndef ZHSCWIDGET_H
#define ZHSCWIDGET_H
#include <qwidget.h>
#include <qlayout.h>
#include <qsplitter.h>
#include <qcombobox.h>
#include <qtextedit.h>
#include <qmap.h>
#include <qstring.h>
#include <qfont.h>
#include <qdatetime.h>
#include <qvaluelist.h>
#include "bookmark.h"
#include "bmdialog.h"
class ZhscWidget : public QWidget
{
Q_OBJECT
public:
ZhscWidget( QWidget* parent, const char* name );
~ZhscWidget();
void init();
public slots:
void dynastyActivated( int index );
void poetActivated( int index );
void poemActivated( int index );
void changeFont( QFont font );
void educe();
void loadHistory();
void addHistory();
void history();
void historyPrev();
void historyNext();
void clearHistory();
void record();
void recordFirst();
void recordPrev();
void recordNext();
void recordLast();
void recordRandom();
void recordNumber();
void bookmark();
void addBookmark();
void modifyBookmark();
void clearBookmark();
void selectBookmark( QString bm );
signals:
void poemCount( int count );
void poetCount( QString poet, int count );
void poemIndex( int index );
void historyPrevEnabled( bool enable );
void historyNextEnabled( bool enable );
void recordFirstEnabled( bool enable );
void recordPrevEnabled( bool enable );
void recordNextEnabled( bool enable );
void recordLastEnabled( bool enable );
void bookmarkChanged( BookmarkList bml );
private:
void setPoem();
void changeDynasty( int index );
void changePoet( int index );
void changePoem( int index );
void buildCBDynasty();
void buildCBPoet();
void buildCBPoem();
void buildTEPoet();
void buildTEPoem();
void calPoemCount();
void calPoetCount();
void calPoemIndex();
int dynastyNoKey();
int poetNoKey();
int poemNoKey();
private:
QGridLayout *lmain;
QSplitter *spPoem;
QSplitter *spPoet;
QComboBox *cbDynasty;
QComboBox *cbPoet;
QComboBox *cbPoem;
QTextEdit *tePoem;
QTextEdit *teMemo;
QTextEdit *tePoet;
QString sDynastyNo;
QString sPoetNo;
QString sPoemNo;
bool bConStatus;
StringMap smDynasty;
StringMap smPoet;
StringMap smPoem;
int nDynasty;
int nPoet;
int nPoem;
int nPoemCount;
int nPoetCount;
int nPoemIndex;
int nPoemMin;
int nPoemMax;
int nHistoryCount;
int nHistoryIndex;
int nHistoryMin;
int nHistoryMax;
QDateTime dtHistoryDT;
bool bManualSign;
BookmarkList bml;
};
#endif //ZHSCWIDGET_H