[go: up one dir, main page]

Menu

[r692]: / latcopt.h  Maximize  Restore  History

Download this file

137 lines (113 with data), 4.0 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
/* Marcion
Copyright (C) 2009-2015 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 LATCOPT_H
#define LATCOPT_H
//
#include <QWidget>
#include <QMenu>
#include <QClipboard>
#include <QCompleter>
#include <QMessageBox>
#include <QWidgetAction>
#include <QKeyEvent>
#include <QLineEdit>
#include "settings.h"
#include "ctranslit.h"
#include "marckeyb.h"
#include "regexpbuilder.h"
//
namespace Ui{
class frmLatCopt;
}
class CLatCopt : public QWidget
{
Q_OBJECT
public:
enum InputType{Latin,Unicode};
CLatCopt( QWidget * parent = 0);
~CLatCopt();
void setMaxInputChars(int value);
QString text() const;
QString text_utf8() const;
//QString specText() const;
void setText(QString const &);
void setScript(CTranslit::Script,bool cmb=true);
short script_int() const;
//CTranslit::Script script_scr() const;
//QFont font() const;
//void setLFont(QFont const &);
void refreshFonts();
void setSwitch(bool visible);
void setSwitchState(bool state);
bool rmNonWordChars() const;
void setRmNonWordChars(bool);
CTranslit::Tr Tr() const;
void setTr(CTranslit::Tr tr);
bool strip() const;
void setStrip(bool strip);
//bool rmSpc() const;
CTranslit::SpaceMode spcMode() const;
//void setRmSpc(bool rm_spc);
void setSpcMode(CTranslit::SpaceMode space_mode);
void setVAsPreferred();
void allowChangeScript(),
allowChangeScript(bool);
void setNumeric(bool numeric) {_numeric=numeric;}
CTranslit::Script getScript() const{return script;}
QString updateL(bool strip,CTranslit::SpaceMode space_mode);
QString updateL_na(bool strip,CTranslit::SpaceMode space_mode) const;
void updateHistory();
static void updateHistory(QComboBox * comboBox,bool top=true);
void showKeyboard(bool);
void showRegExp(bool);
void copyText() const;
void hideRegExpButton();
void activate();
private slots:
void on_cmbChooseScript_currentIndexChanged(int index);
void on_tbReg_clicked();
void on_tbKeyb_clicked();
void on_cbTranslit_toggled(bool checked);
//void on_cmbLatin_activated(QString );
void on_cmbLatin_editTextChanged(QString );
void on_lblCoptic_customContextMenuRequested(QPoint pos);
void slot_keyb_aboutToShow();
void slot_keyb_aboutToHide();
void slot_reg_aboutToShow();
void slot_reg_aboutToHide();
void on_btActionFT_clicked(bool checked);
private:
Ui::frmLatCopt * ui;
QActionGroup agrp;
CTranslit::Script script;
CTranslit::Tr _tr;
MButtonMenu popupFT;
QMenu keyb,reg,scrmnu;
QAction * copy,*clear,*rm_nw,*upd,*upd_st,*clr_hist,*scr_l,*scr_g,*scr_c,*scr_h;
bool rmnw,_strip;
CTranslit::SpaceMode _spc_mode;
QWidgetAction wkeyb,wreg;
//QFont orig_lfont;
//QFont _font;
CMarcKeyb * mk;
MRegExpBuilder * rb;
bool _numeric;
QPixmap _lblpix;
protected:
void keyPressEvent ( QKeyEvent * event );
signals:
void query();
void textChanged(QString const &);
};
#endif