[go: up one dir, main page]

Menu

[r379]: / latcopt.h  Maximize  Restore  History

Download this file

129 lines (108 with data), 3.7 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
/* Marcion
Copyright (C) 2009 - 2011 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; version 2 of the License.
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 */
#ifndef LATCOPT_H
#define LATCOPT_H
//
#include <QWidget>
#include <QMenu>
#include <QClipboard>
#include <QCompleter>
#include <QMessageBox>
#include <QWidgetAction>
#include <QKeyEvent>
#include "settings.h"
#include "ui_latcopt.h"
#include "ctranslit.h"
#include "marckeyb.h"
#include "regexpbuilder.h"
//
namespace Ui{
class CLatCopt;
}
class CLatCopt : public QWidget
{
Q_OBJECT
public:
enum InputType{Latin,Unicode};
/*CLatCopt(CTranslit::Script script,
QFont const & font,
bool tr_is_visible=true,
CTranslit::Tr tr=CTranslit::CopticDictC,
bool rmnw=false,
bool strip=false,
bool rm_spc=false,
QWidget * parent = 0, Qt::WFlags f = 0);*/
CLatCopt( QWidget * parent = 0, Qt::WFlags f = 0 );
~CLatCopt();
QString text() const;
QString text_utf8() const
{return ui->lblCoptic->text();}
//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;
void setRmSpc(bool rm_spc);
void setVAsPreferred();
void allowChangeScript(),
allowChangeScript(bool);
void setNumeric(bool numeric) {_numeric=numeric;}
CTranslit::Script getScript() const{return script;}
QString updateL(bool,bool);
void updateHistory();
void showKeyboard(bool);
void showRegExp(bool);
void copyText() const;
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();
private:
Ui::frmLatCopt * ui;
CTranslit::Script script;
CTranslit::Tr _tr;
QMenu popup,keyb,reg,scrmnu;
QAction * copy,*clear,*rm_nw,*upd,*upd_st,*clr_hist,*scr_l,*scr_g,*scr_c,*scr_h;
bool rmnw,_strip,_rm_spc;
QWidgetAction wkeyb,wreg;
//QFont orig_lfont;
//QFont _font;
CMarcKeyb * mk;
MRegExpBuilder * rb;
bool _numeric;
protected:
void keyPressEvent ( QKeyEvent * event );
signals:
void query();
void textChanged(QString const &);
};
#endif