00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
#ifndef koautoformatdia_h
00022
#define koautoformatdia_h
00023
00024
#include <kdialogbase.h>
00025
#include <qlineedit.h>
00026
#include <koAutoFormat.h>
00027
00028
class QPushButton;
00029
class QCheckBox;
00030
class QVBox;
00031
class QHBox;
00032
class KCharSelect;
00033
class KListView;
00034
class KLineEdit;
00035
class QListBox;
00036
class QSpinBox;
00037
class KIntNumInput;
00041
class KoAutoFormatLineEdit :
public QLineEdit
00042 {
00043 Q_OBJECT
00044
public:
00045 KoAutoFormatLineEdit (
QWidget * parent,
const char * name=0 );
00046
00047
protected:
00048
virtual void keyPressEvent (
QKeyEvent * );
00049 signals:
00050
void keyReturnPressed();
00051 };
00052
00053
00054
00055
00056
00057
class KoAutoFormatExceptionWidget :
public QWidget
00058 {
00059 Q_OBJECT
00060
00061
public:
00062 KoAutoFormatExceptionWidget(
QWidget *_parent,
const QString &name,
const QStringList &_list,
bool _autoInclude,
bool _abbreviation=
false);
00063
00064
void setListException(
const QStringList &list);
00065
QStringList getListException(){
return m_listException;}
00066
bool autoInclude();
00067
void setAutoInclude(
bool b );
00068
protected slots:
00069
void slotAddException();
00070
void slotRemoveException();
00071
void textChanged (
const QString & );
00072
void slotExceptionListSelected();
00073
private:
00074
QListBox *exceptionList;
00075 KoAutoFormatLineEdit *exceptionLine;
00076
QPushButton *pbAddException,*pbRemoveException;
00077
QCheckBox *cbAutoInclude;
00078
QStringList m_listException;
00079
bool m_bAbbreviation;
00080 };
00081
00082
00083
00084
00085
00086
class KoAutoFormatDia :
public KDialogBase
00087 {
00088 Q_OBJECT
00089
00090
public:
00091 KoAutoFormatDia(
QWidget *parent,
const char *name, KoAutoFormat * autoFormat );
00092 ~KoAutoFormatDia();
00093
void addEntryList(
const QString &key, KoAutoFormatEntry *_autoEntry);
00094
void editEntryList(
const QString &key,
const QString &newFindString, KoAutoFormatEntry *_autoEntry);
00095
protected:
00096
bool applyConfig();
00097
void setupTab1();
00098
void setupTab2();
00099
void setupTab3();
00100
void setupTab4();
00101
00102
void refreshEntryList();
00103
00104
void initTab1();
00105
void initTab2();
00106
void initTab3();
00107
void initTab4();
00108
00109
typedef QMap<QString, QString> KoExceptionLanguageName;
00110 KoExceptionLanguageName exceptionLanguageName;
00111
00112
QWidget *tab1;
00113
QWidget *tab2;
00114
QWidget *tab3;
00115
QWidget *tab4;
00116
00117
QComboBox *autoFormatLanguage;
00118
00119
QCheckBox *cbTypographicSimpleQuotes, *cbTypographicDoubleQuotes,*cbUpperCase, *cbUpperUpper, *cbDetectUrl,
00120 *cbBackgroundSpellCheck, *cbAdvancedAutoCorrection,*cbIgnoreDoubleSpace , *cbRemoveSpaceBeginEndLine, *cbUseBulletStyle, *cbAutoChangeFormat, *cbAutoReplaceNumber, *cbUseNumberStyle, *cbAutoSuperScript, *cbAutoCorrectionWithFormat, *cbCapitalizeDaysName;
00121
QPushButton *pbDoubleQuote1, *pbDoubleQuote2, *pbRemove, *pbAdd, *pbDoubleDefault,
00122 *pbSpecialChar1, *pbSpecialChar2, *pbBulletStyle, *pbDefaultBulletStyle;
00123
00124
QPushButton *pbSimpleQuote1, *pbSimpleQuote2, *pbSimpleDefault;
00125
QPushButton *pbChangeFormat, *pbClearFormat;
00126 KCharSelect *charselect;
00127 KoAutoFormatLineEdit *m_find, *m_replace;
00128 KListView *m_pListView;
00129
00130
QChar oSimpleBegin, oSimpleEnd;
00131
QChar oDoubleBegin, oDoubleEnd;
00132
00133
QChar bulletStyle;
00134 KoAutoFormat m_autoFormat;
00135 KoAutoFormat * m_docAutoFormat;
00136
00137 KoAutoFormatExceptionWidget *abbreviation;
00138 KoAutoFormatExceptionWidget *twoUpperLetter;
00139
00140 KoAutoFormatEntry *newEntry;
00141
00142
QString initialLanguage;
00143
bool noSignal;
00144
bool changeLanguage;
00145
00146
bool autocorrectionEntryChanged;
00147
protected slots:
00148
virtual void slotOk();
00149
virtual void slotCancel();
00150
00151
void slotBulletStyleToggled(
bool );
00152
void slotItemRenamed(
QListViewItem * item,
const QString & newText,
int column);
00153
void slotRemoveEntry();
00154
void slotEditEntry();
00155
void slotfind(
const QString & );
00156
void slotfind2(
const QString & );
00157
void chooseSpecialChar1();
00158
void chooseSpecialChar2();
00159
void chooseDoubleQuote1();
00160
void chooseDoubleQuote2();
00161
void defaultDoubleQuote();
00162
00163
void chooseSimpleQuote1();
00164
void chooseSimpleQuote2();
00165
void defaultSimpleQuote();
00166
00167
void slotChangeStateSimple(
bool);
00168
void slotChangeStateDouble(
bool);
00169
00170
void slotAddEntry();
00171
void chooseBulletStyle();
00172
void defaultBulletStyle();
00173
void slotChangeTextFormatEntry();
00174
void slotResetConf();
00175
void changeAutoformatLanguage(
const QString & );
00176
void slotClearTextFormatEntry();
00177
void slotChangeAdvancedAutoCorrection();
00178 };
00179
00180
class KoCompletionDia :
public KDialogBase
00181 {
00182 Q_OBJECT
00183
00184
public:
00185 KoCompletionDia(
QWidget *parent,
const char *name, KoAutoFormat * autoFormat );
00186
protected slots:
00187
virtual void slotOk();
00188
void slotRemoveCompletionEntry();
00189
void slotCompletionWordSelected(
const QString & );
00190
void slotSaveCompletionEntry();
00191
void slotAddCompletionEntry();
00192
void slotResetConf();
00193
bool applyConfig();
00194
void changeButtonStatus();
00195
protected:
00196
void setup();
00197 KoAutoFormat m_autoFormat;
00198 KoAutoFormat * m_docAutoFormat;
00199
QStringList m_listCompletion;
00200
QCheckBox *cbAllowCompletion, *cbAppendSpace, *cbAddCompletionWord;
00201
QPushButton *pbRemoveCompletionEntry;
00202
QPushButton *pbSaveCompletionEntry;
00203
QPushButton *pbAddCompletionEntry;
00204
QListBox *m_lbListCompletion;
00205 KIntNumInput *m_minWordLength;
00206 KIntNumInput *m_maxNbWordCompletion;
00207
00208 };
00209
#endif
00210
00211