lib

KoAutoFormatDia.h
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>
4
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.
9
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.
14
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.
19*/
20
21#ifndef koautoformatdia_h
22#define koautoformatdia_h
23
24#include <kdialogbase.h>
25#include <tqlineedit.h>
26#include <KoAutoFormat.h>
27class TQCheckBox;
28class KCharSelect;
29class TQComboBox;
30
31
35class KoAutoFormatLineEdit : public TQLineEdit
36{
37 TQ_OBJECT
38
39public:
40 KoAutoFormatLineEdit ( TQWidget * parent, const char * name=0 );
41
42protected:
43 virtual void keyPressEvent ( TQKeyEvent * );
44 signals:
45 void keyReturnPressed();
46};
47
48/******************************************************************/
49/* Class: KoAutoFormatExceptionWidget */
50/******************************************************************/
51
52class KoAutoFormatExceptionWidget : public TQWidget
53{
54 TQ_OBJECT
55
56
57public:
58 KoAutoFormatExceptionWidget(TQWidget *_parent, const TQString &name,const TQStringList &_list, bool _autoInclude, bool _abbreviation=false);
59
60 void setListException( const TQStringList &list);
61 TQStringList getListException(){return m_listException;}
62 bool autoInclude();
63 void setAutoInclude( bool b );
64protected slots:
65 void slotAddException();
66 void slotRemoveException();
67 void textChanged ( const TQString & );
68 void slotExceptionListSelected();
69 private:
70 TQListBox *exceptionList;
71 KoAutoFormatLineEdit *exceptionLine;
72 TQPushButton *pbAddException,*pbRemoveException;
73 TQCheckBox *cbAutoInclude;
74 TQStringList m_listException;
75 bool m_bAbbreviation;
76};
77
78/******************************************************************/
79/* Class: KoAutoFormatDia */
80/******************************************************************/
81
82class KOTEXT_EXPORT KoAutoFormatDia : public KDialogBase
83{
84 TQ_OBJECT
85
86
87public:
88 KoAutoFormatDia( TQWidget *parent, const char *name, KoAutoFormat * autoFormat );
89 ~KoAutoFormatDia();
90 void addEntryList(const TQString &key, KoAutoFormatEntry *_autoEntry);
91 void editEntryList(const TQString &key,const TQString &newFindString, KoAutoFormatEntry *_autoEntry);
92protected:
93 bool applyConfig();
94 void setupTab1();
95 void setupTab2();
96 void setupTab3();
97 void setupTab4();
98
99 void refreshEntryList();
100
101 void initTab1();
102 void initTab2();
103 void initTab3();
104 void initTab4();
105
106 typedef TQMap<TQString, TQString> KoExceptionLanguageName;
107 KoExceptionLanguageName exceptionLanguageName;
108
109 TQWidget *tab1;
110 TQWidget *tab2;
111 TQWidget *tab3;
112 TQWidget *tab4;
113
114 TQComboBox *autoFormatLanguage;
115
116 TQCheckBox *cbTypographicSimpleQuotes, *cbTypographicDoubleQuotes,*cbUpperCase, *cbUpperUpper, *cbDetectUrl,
117 *cbBackgroundSpellCheck, *cbAdvancedAutoCorrection,*cbIgnoreDoubleSpace , *cbRemoveSpaceBeginEndLine, *cbUseBulletStyle, *cbAutoChangeFormat, *cbAutoReplaceNumber, *cbUseNumberStyle, *cbAutoSuperScript, *cbAutoCorrectionWithFormat, *cbCapitalizeDaysName;
118 TQPushButton *pbDoubleQuote1, *pbDoubleQuote2, *pbRemove, *pbAdd, *pbDoubleDefault,
119 *pbSpecialChar1, *pbSpecialChar2, *pbBulletStyle, *pbDefaultBulletStyle;
120
121 TQPushButton *pbSimpleQuote1, *pbSimpleQuote2, *pbSimpleDefault;
122 TQPushButton *pbChangeFormat, *pbClearFormat;
123 KCharSelect *charselect;
124 KoAutoFormatLineEdit *m_find, *m_replace;
125 TDEListView *m_pListView;
126
127 TQChar oSimpleBegin, oSimpleEnd;
128 TQChar oDoubleBegin, oDoubleEnd;
129
130 TQChar bulletStyle;
131 KoAutoFormat m_autoFormat; // The copy we're working on
132 KoAutoFormat * m_docAutoFormat; // Pointer to the real one (in KWDocument)
133
134 KoAutoFormatExceptionWidget *abbreviation;
135 KoAutoFormatExceptionWidget *twoUpperLetter;
136
137 KoAutoFormatEntry *newEntry;
138
139 TQString initialLanguage;
140 bool noSignal;
141 bool changeLanguage;
142
143 bool autocorrectionEntryChanged;
144protected slots:
145 virtual void slotOk();
146 virtual void slotCancel();
147
148 void slotBulletStyleToggled( bool );
149 void slotItemRenamed(TQListViewItem * item, const TQString & newText, int column);
150 void slotRemoveEntry();
151 void slotEditEntry();
152 void slotfind( const TQString & );
153 void slotfind2( const TQString & );
154 void chooseSpecialChar1();
155 void chooseSpecialChar2();
156 void chooseDoubleQuote1();
157 void chooseDoubleQuote2();
158 void defaultDoubleQuote();
159
160 void chooseSimpleQuote1();
161 void chooseSimpleQuote2();
162 void defaultSimpleQuote();
163
164 void slotChangeStateSimple(bool);
165 void slotChangeStateDouble(bool);
166
167 void slotAddEntry();
168 void chooseBulletStyle();
169 void defaultBulletStyle();
170 void slotChangeTextFormatEntry();
171 void slotResetConf();
172 void changeAutoformatLanguage(const TQString & );
173 void slotClearTextFormatEntry();
174 void slotChangeAdvancedAutoCorrection();
175};
176
177#endif
virtual void slotCancel()
virtual void slotOk()