[go: up one dir, main page]

Menu

[r734]: / wordpreview.h  Maximize  Restore  History

Download this file

223 lines (189 with data), 6.5 kB

  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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
/* Marcion
Copyright (C) 2009-2016 Milan Konvicka
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.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */
#ifndef WORDPREVIEW_H
#define WORDPREVIEW_H
//
#include <QWidget>
#include <QList>
#include <QTreeWidgetItem>
#include <QAction>
#include <QMenu>
#include <QButtonGroup>
#include "addword.h"
#include "messages.h"
#include "settings.h"
#include "ctranslit.h"
#include "cwordtemplate.h"
#include "reorder.h"
#include "worditem.h"
#include "crumwidget.h"
#include "cmysql.h"
#include "crumresulttree.h"
#include "booktextbrowser.h"
#include "lsj.h"
#include "libsearchbase.h"
#include "libbase.h"
#include "mcmbboxresult.h"
#include "mwindowswidget.h"
//
class CWTStore{
public:
CWTStore();
~CWTStore(){}
QString init_line,init_line_d,last_line;
QList<QString> h_line,h_line_d;
QList<CWordTemplate> _wt,_wt_d;
int count,count_d;
void appendItemW(QString const &, CWordTemplate const &);
void appendItemD(QString const &, CWordTemplate const &);
void clear();
};
class CWTStoreTbr
{
public:
CWTStoreTbr();
~CWTStoreTbr(){}
void clear();
CWordTemplate _wt;
CWordTemplate::Mode _mode;
QStringList c_lines;
QStringList combs;
};
class CWTStoreTbr2
{
public:
CWTStoreTbr2();
~CWTStoreTbr2(){}
void clear();
void appendItem(CWordTemplate const & wt,CWordTemplate::Mode mode, QString const & line);
QList<CWordTemplate> _wt;
QList<CWordTemplate::Mode> _mode;
QStringList _lines;
int count;
};
namespace Ui {
class frmWordPreview;
}
class CWordPreview : public QWidget
{
Q_OBJECT
public:
enum Pg{Search,Printed,DictGk};
CWordPreview( CMessages * const messages,
QWidget * parent = 0);
~CWordPreview();
void queryCoptic(QString const & word);
void queryId(short,int);
CCrumResultTree * resultTree() const;
//CLatCopt * inputCoptic(){return ui->inpWord;}
//void prepareCreateIndex();
static QDate latestUpdate();
void showPage(Pg current_page);
private slots:
//void on_rbDirect_toggled(bool checked);
//void on_rbIndex_toggled(bool checked);
void on_rbCrumPg_clicked();
void on_rbDate_clicked();
void on_rbIdSearch_clicked();
void on_btInvert_clicked();
void on_txtQuot_anchorClicked(QUrl );
void on_btHideQuot_clicked();
void on_btAllInTree_clicked();
void on_btTop_clicked();
void on_btDown_clicked();
void on_btBottom_clicked();
void on_btUp_clicked();
void on_btShow_clicked();
void on_cmbChilds_currentIndexChanged(int index);
void slot_tbrTwo_anchorClicked(QUrl );
void slot_tbrOne_anchorClicked(QUrl );
void on_treeResult_customContextMenuRequested(QPoint pos);
void on_treeResult_currentItemChanged(QTreeWidgetItem* current, QTreeWidgetItem* previous);
void on_btTreeD_clicked();
void on_btTreeW_clicked();
void on_tbPreview_currentChanged(int index);
void on_trGreek_query();
void on_inpWord_query();
void on_btFullD_clicked();
void on_btFullW_clicked();
void on_btUncheckAll_clicked();
void on_btCheckAll_clicked();
void on_cmbCrum_activated(int index);
void on_btPrev_clicked();
void on_btNext_clicked();
void on_txtCzEn_returnPressed();
void on_cmbW_activated(int index);
void on_cmbD_activated(int index);
void on_btWord_clicked();
void on_btDeriv_clicked();
void slot_brPreview_anchorClicked(QUrl);
void on_btQuery_clicked();
void settings_fontChanged(CTranslit::Script, QFont);
void on_brPreview_contentChanged(bool,bool,bool*);
void on_tbrOne_contentChanged(bool,bool,bool*);
void on_tbrTwo_contentChanged(bool,bool,bool*);
void on_brPreview_dictionaryRequested(int,QString const &);
void on_tbrOne_dictionaryRequested(int,QString const &);
void on_tbrTwo_dictionaryRequested(int,QString const &);
void on_btAction2_clicked(bool checked);
void on_btAutoHL_clicked(bool checked);
void on_btGoToW_clicked();
void on_btGoToD_clicked();
void on_btWPrev_clicked();
void on_btWNext_clicked();
void on_btDPrev_clicked();
void on_btDNext_clicked();
void slot_bgr_clicked(int id);
private:
Ui::frmWordPreview * ui;
CMessages * const messages;
CCrumWidget * _crumw;
CCrumWidget * crumw();
CLSJ * _gkdict;
CLSJ * gkdict();
int crumw_index,gkdict_index;
QButtonGroup bgr;
void showfull(QString),
reorder(QString),afterquery(),beforequery(),
query(QString const & where,short table=-1);
void startQuery();
QList<CWordItem> words,derivs;
static unsigned int count;
void checkalld(bool);
int dialects() const;
QString dialectsAsStr() const;
void clearTree();
void resolveLine(CResultItem * ri);
QString copyAsRegexp(CResultItem * ri) const;
void printInfo();
void showDictionary(int,QString const &);
MButtonMenu popup;
QAction * a_exp,* a_coll,/**a_wrap,*/* clr,* show_panel,*resolve,*a_srchregexp,*a_cpregexp,*a_labels;
CWTStore _store;
CWTStoreTbr _store_tbr;
CWTStoreTbr2 _store_tbr2;
void displayStore();
void displayStoreTbr();
void displayStoreTbr2();
RtfTextDelegate cmbw_delegate,
cmbd_delegate,
treeres_delegate,
childs_delegate;
//signals:
//void copticBookRequested(int,int,int);
//void searchInLibrary(QString);
protected:
void keyPressEvent(QKeyEvent * event);
};
#endif