[go: up one dir, main page]

Menu

[r550]: / bookwithverses.h  Maximize  Restore  History

Download this file

145 lines (113 with data), 4.4 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
/* Marcion
Copyright (C) 2009-2013 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 BOOKWITHVERSES_H
#define BOOKWITHVERSES_H
#include "ui_bookwithverses.h"
#include "mdocumentbase.h"
#include "messages.h"
#include "settings.h"
#include "ctranslit.h"
#include "textbrowserext.h"
#include "msimulitem.h"
#include "libbase.h"
/*class BookRow
{
public:
BookRow(QString const & verse,
QString const & text,
QString const & note):_verse(verse),_text(text),_note(note){}
~BookRow(){}
QString const _verse,_text,_note;
};*/
class CSimulTreeItem : public QTreeWidgetItem
{
public:
CSimulTreeItem(bool is_book,QString const & title,int id,int text_format,int script);
bool _is_book;
QString _title;
int _id,_text_format,_script;
};
typedef QList<MTextLineItem> BookStore;
class CBookWithVerses : public QWidget, public MDocumentBase, private Ui::CBookWithVerses {
Q_OBJECT
Q_DISABLE_COPY(CBookWithVerses)
public:
enum Script{
Latin=1,Greek=2,Coptic=3,Hebrew=4
};
enum Mode{Book,Chapter};
enum TextFormat{Native=1,Beta=2,LatTr=3};
explicit CBookWithVerses(QString const & name,
Script script,
TextFormat textFormat,
int key,
Mode mode,
CMessages * const messages,
QString const & show_text=QString(),
QWidget *parent = 0);
void showBook(int book,int chapter);
void findVerse(int chapter, int verse);
void findChapter(int chapter, int verse=-1);
void cursorOnTop();
private slots:
void on_btShowPanel_clicked();
void on_btCopyExt2_clicked();
void on_btCopyExt_clicked();
void on_cbTable_toggled(bool checked);
void on_btShow_clicked();
void on_spnVerse_valueChanged(int );
void on_spnChapter_valueChanged(int );
void on_brBook_contentChanged(bool, bool, bool*);
//void on_brBook_highlightActivated(bool*);
//void on_brBook_highlightDeactivated(bool*);
void on_btBookMode_clicked(bool checked);
void on_tbSimul_toggled(bool checked);
void on_tbSimulAdd_clicked(bool checked);
void on_tbSimulRefreshLib_clicked();
void on_tbSimulHide_clicked();
void on_tbSimulToList_clicked();
void slot_simulAction(int);
void on_tbSimulUp_clicked();
void on_tbSimulDown_clicked();
void on_tbrSimulText_customContextMenuRequested(const QPoint & );
void on_tbSimulAction_clicked(bool checked);
/*void on_tbSimulFontPlus_clicked();
void on_tbSimulFontMinus_clicked();*/
void on_tbSimulPrev_clicked();
void on_tbSimulNext_clicked();
void on_treeSimulLibrary_customContextMenuRequested(const QPoint &);
void on_tblSimulTexts_customContextMenuRequested(const QPoint &);
private:
int key;
Mode mode;
CMessages * const messages;
Script script;
TextFormat textFormat;
BookStore store;
MButtonMenu popupSimul;
QAction *a_prev,*a_next,*a_lead,*a_wrap,*a_dict, *a_crum,*a_lsj,*a_searchlib,*a_copy,*a_copyall,*a_decf,*a_incf,*a_normf;
QMenu popupSimulC,popupSimulL;
QAction *ac_move,*ac_refresh,*al_remove,*al_rmall;
int _font_offset;
void displayStore();
QString get_query(int, int) const;
bool read_chapters(int book);
void convertTextItem(MTextLineItem & text_item,TextFormat text_format,Script script);
bool isSimulActivated() const;
void refresh_simul();
void setSimulHeaderLabels();
protected:
void keyPressEvent(QKeyEvent * event);
};
#endif // BOOKWITHVERSES_H