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 <kpagedialog.h>
00025 #include <QLineEdit>
00026
00027 #include <QKeyEvent>
00028 #include <KoAutoFormat.h>
00029 #include <k3listview.h>
00030
00031 class QCheckBox;
00032 class KCharSelect;
00033 class QComboBox;
00034 class Q3ListBox;
00035
00039 class KoAutoFormatLineEdit : public QLineEdit
00040 {
00041 Q_OBJECT
00042 public:
00043 KoAutoFormatLineEdit ( QWidget * parent, const char * name=0 );
00044
00045 protected:
00046 virtual void keyPressEvent ( QKeyEvent * );
00047 signals:
00048 void keyReturnPressed();
00049 };
00050
00051
00052
00053
00054
00055 class KoAutoFormatExceptionWidget : public QWidget
00056 {
00057 Q_OBJECT
00058
00059 public:
00060 KoAutoFormatExceptionWidget(QWidget *_parent, const QString &name,const QStringList &_list, bool _autoInclude, bool _abbreviation=false);
00061
00062 void setListException( const QStringList &list);
00063 QStringList getListException(){return m_listException;}
00064 bool autoInclude();
00065 void setAutoInclude( bool b );
00066 protected slots:
00067 void slotAddException();
00068 void slotRemoveException();
00069 void textChanged ( const QString & );
00070 void slotExceptionListSelected();
00071 private:
00072 Q3ListBox *exceptionList;
00073 KoAutoFormatLineEdit *exceptionLine;
00074 QPushButton *pbAddException,*pbRemoveException;
00075 QCheckBox *cbAutoInclude;
00076 QStringList m_listException;
00077 bool m_bAbbreviation;
00078 };
00079
00080
00081
00082
00083
00084 class KOTEXT_EXPORT KoAutoFormatDia : public KPageDialog
00085 {
00086 Q_OBJECT
00087
00088 public:
00089 KoAutoFormatDia( QWidget *parent, const char *name, KoAutoFormat * autoFormat );
00090 ~KoAutoFormatDia();
00091 void addEntryList(const QString &key, KoAutoFormatEntry *_autoEntry);
00092 void editEntryList(const QString &key,const QString &newFindString, KoAutoFormatEntry *_autoEntry);
00093 protected:
00094 bool applyConfig();
00095 void setupTab1();
00096 void setupTab2();
00097 void setupTab3();
00098 void setupTab4();
00099
00100 void refreshEntryList();
00101
00102 void initTab1();
00103 void initTab2();
00104 void initTab3();
00105 void initTab4();
00106
00107 typedef QMap<QString, QString> KoExceptionLanguageName;
00108 KoExceptionLanguageName exceptionLanguageName;
00109
00110 QWidget *tab1;
00111 QWidget *tab2;
00112 QWidget *tab3;
00113 QWidget *tab4;
00114 KPageWidgetItem *p1, *p2, *p3, *p4;
00115
00116 QComboBox *autoFormatLanguage;
00117
00118 QCheckBox *cbTypographicSimpleQuotes, *cbTypographicDoubleQuotes,*cbUpperCase, *cbUpperUpper, *cbDetectUrl,
00119 *cbBackgroundSpellCheck, *cbAdvancedAutoCorrection,*cbIgnoreDoubleSpace , *cbRemoveSpaceBeginEndLine, *cbUseBulletStyle, *cbAutoChangeFormat, *cbAutoReplaceNumber, *cbUseNumberStyle, *cbAutoSuperScript, *cbAutoCorrectionWithFormat, *cbCapitalizeDaysName;
00120 QPushButton *pbDoubleQuote1, *pbDoubleQuote2, *pbRemove, *pbAdd, *pbDoubleDefault,
00121 *pbSpecialChar1, *pbSpecialChar2, *pbBulletStyle, *pbDefaultBulletStyle;
00122
00123 QPushButton *pbSimpleQuote1, *pbSimpleQuote2, *pbSimpleDefault;
00124 QPushButton *pbChangeFormat, *pbClearFormat;
00125 KCharSelect *charselect;
00126 KoAutoFormatLineEdit *m_find, *m_replace;
00127 K3ListView *m_pListView;
00128
00129 QChar oSimpleBegin, oSimpleEnd;
00130 QChar oDoubleBegin, oDoubleEnd;
00131
00132 QChar bulletStyle;
00133 KoAutoFormat m_autoFormat;
00134 KoAutoFormat * m_docAutoFormat;
00135
00136 KoAutoFormatExceptionWidget *abbreviation;
00137 KoAutoFormatExceptionWidget *twoUpperLetter;
00138
00139 KoAutoFormatEntry *newEntry;
00140
00141 QString initialLanguage;
00142 bool noSignal;
00143 bool changeLanguage;
00144
00145 bool autocorrectionEntryChanged;
00146 protected slots:
00147 virtual void slotOk();
00148 virtual void slotCancel();
00149
00150 void slotBulletStyleToggled( bool );
00151 void slotItemRenamed(Q3ListViewItem * item, const QString & newText, int column);
00152 void slotRemoveEntry();
00153 void slotEditEntry();
00154 void slotfind( const QString & );
00155 void slotfind2( const QString & );
00156 void chooseSpecialChar1();
00157 void chooseSpecialChar2();
00158 void chooseDoubleQuote1();
00159 void chooseDoubleQuote2();
00160 void defaultDoubleQuote();
00161
00162 void chooseSimpleQuote1();
00163 void chooseSimpleQuote2();
00164 void defaultSimpleQuote();
00165
00166 void slotChangeStateSimple(bool);
00167 void slotChangeStateDouble(bool);
00168
00169 void slotAddEntry();
00170 void chooseBulletStyle();
00171 void defaultBulletStyle();
00172 void slotChangeTextFormatEntry();
00173 void slotResetConf();
00174 void changeAutoformatLanguage(const QString & );
00175 void slotClearTextFormatEntry();
00176 void slotChangeAdvancedAutoCorrection();
00177 };
00178
00179 #endif