1
/* This file is part of the KDE project
2
Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
3
2001 Sven Leiber <s.leiber@web.de>
5
This library is free software; you can redistribute it and/or
6
modify it under the terms of the GNU Library General Public
7
License as published by the Free Software Foundation; either
8
version 2 of the License, or (at your option) any later version.
10
This library is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
Library General Public License for more details.
15
You should have received a copy of the GNU Library General Public License
16
along with this library; see the file COPYING.LIB. If not, write to
17
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18
* Boston, MA 02110-1301, USA.
21
#ifndef koautoformatdia_h
22
#define koautoformatdia_h
24
#include <kdialogbase.h>
25
#include <qlineedit.h>
26
#include <KoAutoFormat.h>
35
class KoAutoFormatLineEdit : public QLineEdit
39
KoAutoFormatLineEdit ( QWidget * parent, const char * name=0 );
42
virtual void keyPressEvent ( QKeyEvent * );
44
void keyReturnPressed();
47
/******************************************************************/
48
/* Class: KoAutoFormatExceptionWidget */
49
/******************************************************************/
51
class KoAutoFormatExceptionWidget : public QWidget
56
KoAutoFormatExceptionWidget(QWidget *_parent, const QString &name,const QStringList &_list, bool _autoInclude, bool _abbreviation=false);
58
void setListException( const QStringList &list);
59
QStringList getListException(){return m_listException;}
61
void setAutoInclude( bool b );
63
void slotAddException();
64
void slotRemoveException();
65
void textChanged ( const QString & );
66
void slotExceptionListSelected();
68
QListBox *exceptionList;
69
KoAutoFormatLineEdit *exceptionLine;
70
QPushButton *pbAddException,*pbRemoveException;
71
QCheckBox *cbAutoInclude;
72
QStringList m_listException;
76
/******************************************************************/
77
/* Class: KoAutoFormatDia */
78
/******************************************************************/
80
class KOTEXT_EXPORT KoAutoFormatDia : public KDialogBase
85
KoAutoFormatDia( QWidget *parent, const char *name, KoAutoFormat * autoFormat );
87
void addEntryList(const QString &key, KoAutoFormatEntry *_autoEntry);
88
void editEntryList(const QString &key,const QString &newFindString, KoAutoFormatEntry *_autoEntry);
96
void refreshEntryList();
103
typedef QMap<QString, QString> KoExceptionLanguageName;
104
KoExceptionLanguageName exceptionLanguageName;
111
QComboBox *autoFormatLanguage;
113
QCheckBox *cbTypographicSimpleQuotes, *cbTypographicDoubleQuotes,*cbUpperCase, *cbUpperUpper, *cbDetectUrl,
114
*cbBackgroundSpellCheck, *cbAdvancedAutoCorrection,*cbIgnoreDoubleSpace , *cbRemoveSpaceBeginEndLine, *cbUseBulletStyle, *cbAutoChangeFormat, *cbAutoReplaceNumber, *cbUseNumberStyle, *cbAutoSuperScript, *cbAutoCorrectionWithFormat, *cbCapitalizeDaysName;
115
QPushButton *pbDoubleQuote1, *pbDoubleQuote2, /**pbEdit,*/ *pbRemove, *pbAdd, *pbDoubleDefault,
116
*pbSpecialChar1, *pbSpecialChar2, *pbBulletStyle, *pbDefaultBulletStyle;
118
QPushButton *pbSimpleQuote1, *pbSimpleQuote2, *pbSimpleDefault;
119
QPushButton *pbChangeFormat, *pbClearFormat;
120
KCharSelect *charselect;
121
KoAutoFormatLineEdit *m_find, *m_replace;
122
KListView *m_pListView;
124
QChar oSimpleBegin, oSimpleEnd;
125
QChar oDoubleBegin, oDoubleEnd;
128
KoAutoFormat m_autoFormat; // The copy we're working on
129
KoAutoFormat * m_docAutoFormat; // Pointer to the real one (in KWDocument)
131
KoAutoFormatExceptionWidget *abbreviation;
132
KoAutoFormatExceptionWidget *twoUpperLetter;
134
KoAutoFormatEntry *newEntry;
136
QString initialLanguage;
140
bool autocorrectionEntryChanged;
142
virtual void slotOk();
143
virtual void slotCancel();
145
void slotBulletStyleToggled( bool );
146
void slotItemRenamed(QListViewItem * item, const QString & newText, int column);
147
void slotRemoveEntry();
148
void slotEditEntry();
149
void slotfind( const QString & );
150
void slotfind2( const QString & );
151
void chooseSpecialChar1();
152
void chooseSpecialChar2();
153
void chooseDoubleQuote1();
154
void chooseDoubleQuote2();
155
void defaultDoubleQuote();
157
void chooseSimpleQuote1();
158
void chooseSimpleQuote2();
159
void defaultSimpleQuote();
161
void slotChangeStateSimple(bool);
162
void slotChangeStateDouble(bool);
165
void chooseBulletStyle();
166
void defaultBulletStyle();
167
void slotChangeTextFormatEntry();
168
void slotResetConf();
169
void changeAutoformatLanguage(const QString & );
170
void slotClearTextFormatEntry();
171
void slotChangeAdvancedAutoCorrection();