lib Library API Documentation

koAutoFormatDia.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
00003                  2001       Sven Leiber         <s.leiber@web.de>
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00018    Boston, MA 02111-1307, USA.
00019 */
00020 
00021 #ifndef koautoformatdia_h
00022 #define koautoformatdia_h
00023 
00024 #include <kdialogbase.h>
00025 #include <qlineedit.h>
00026 #include <koAutoFormat.h>
00027 #include <koffice_export.h>
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 QComboBox;
00038 class KIntNumInput;
00042 class KoAutoFormatLineEdit : public QLineEdit
00043 {
00044     Q_OBJECT
00045 public:
00046     KoAutoFormatLineEdit ( QWidget * parent, const char * name=0 );
00047 
00048 protected:
00049     virtual void keyPressEvent ( QKeyEvent * );
00050  signals:
00051     void keyReturnPressed();
00052 };
00053 
00054 /******************************************************************/
00055 /* Class: KoAutoFormatExceptionWidget                             */
00056 /******************************************************************/
00057 
00058 class KoAutoFormatExceptionWidget : public QWidget
00059 {
00060     Q_OBJECT
00061 
00062 public:
00063     KoAutoFormatExceptionWidget(QWidget *_parent, const QString &name,const QStringList &_list, bool _autoInclude, bool _abbreviation=false);
00064 
00065     void setListException( const QStringList &list);
00066     QStringList getListException(){return m_listException;}
00067     bool autoInclude();
00068     void setAutoInclude( bool b );
00069 protected slots:
00070     void slotAddException();
00071     void slotRemoveException();
00072     void textChanged ( const QString & );
00073     void slotExceptionListSelected();
00074  private:
00075     QListBox *exceptionList;
00076     KoAutoFormatLineEdit *exceptionLine;
00077     QPushButton *pbAddException,*pbRemoveException;
00078     QCheckBox *cbAutoInclude;
00079     QStringList m_listException;
00080     bool m_bAbbreviation;
00081 };
00082 
00083 /******************************************************************/
00084 /* Class: KoAutoFormatDia                                         */
00085 /******************************************************************/
00086 
00087 class KOTEXT_EXPORT KoAutoFormatDia : public KDialogBase
00088 {
00089     Q_OBJECT
00090 
00091 public:
00092     KoAutoFormatDia( QWidget *parent, const char *name, KoAutoFormat * autoFormat );
00093     ~KoAutoFormatDia();
00094     void addEntryList(const QString &key, KoAutoFormatEntry *_autoEntry);
00095     void editEntryList(const QString &key,const QString &newFindString, KoAutoFormatEntry *_autoEntry);
00096 protected:
00097     bool applyConfig();
00098     void setupTab1();
00099     void setupTab2();
00100     void setupTab3();
00101     void setupTab4();
00102 
00103     void refreshEntryList();
00104 
00105     void initTab1();
00106     void initTab2();
00107     void initTab3();
00108     void initTab4();
00109 
00110     typedef QMap<QString, QString> KoExceptionLanguageName;
00111     KoExceptionLanguageName exceptionLanguageName;
00112 
00113     QWidget *tab1;
00114     QWidget *tab2;
00115     QWidget *tab3;
00116     QWidget *tab4;
00117 
00118     QComboBox *autoFormatLanguage;
00119 
00120     QCheckBox *cbTypographicSimpleQuotes, *cbTypographicDoubleQuotes,*cbUpperCase, *cbUpperUpper, *cbDetectUrl,
00121         *cbBackgroundSpellCheck, *cbAdvancedAutoCorrection,*cbIgnoreDoubleSpace , *cbRemoveSpaceBeginEndLine, *cbUseBulletStyle, *cbAutoChangeFormat, *cbAutoReplaceNumber, *cbUseNumberStyle, *cbAutoSuperScript, *cbAutoCorrectionWithFormat, *cbCapitalizeDaysName;
00122     QPushButton *pbDoubleQuote1, *pbDoubleQuote2,  *pbRemove, *pbAdd, *pbDoubleDefault,
00123                 *pbSpecialChar1, *pbSpecialChar2, *pbBulletStyle, *pbDefaultBulletStyle;
00124 
00125     QPushButton *pbSimpleQuote1, *pbSimpleQuote2, *pbSimpleDefault;
00126     QPushButton *pbChangeFormat, *pbClearFormat;
00127     KCharSelect *charselect;
00128     KoAutoFormatLineEdit *m_find, *m_replace;
00129     KListView *m_pListView;
00130 
00131     QChar oSimpleBegin, oSimpleEnd;
00132     QChar oDoubleBegin, oDoubleEnd;
00133 
00134     QChar bulletStyle;
00135     KoAutoFormat m_autoFormat; // The copy we're working on
00136     KoAutoFormat * m_docAutoFormat; // Pointer to the real one (in KWDocument)
00137 
00138     KoAutoFormatExceptionWidget *abbreviation;
00139     KoAutoFormatExceptionWidget *twoUpperLetter;
00140 
00141     KoAutoFormatEntry *newEntry;
00142 
00143     QString initialLanguage;
00144     bool noSignal;
00145     bool changeLanguage;
00146 
00147     bool autocorrectionEntryChanged;
00148 protected slots:
00149     virtual void slotOk();
00150     virtual void slotCancel();
00151 
00152     void slotBulletStyleToggled( bool );
00153     void slotItemRenamed(QListViewItem * item, const QString & newText, int column);
00154     void slotRemoveEntry();
00155     void slotEditEntry();
00156     void slotfind( const QString & );
00157     void slotfind2( const QString & );
00158     void chooseSpecialChar1();
00159     void chooseSpecialChar2();
00160     void chooseDoubleQuote1();
00161     void chooseDoubleQuote2();
00162     void defaultDoubleQuote();
00163 
00164     void chooseSimpleQuote1();
00165     void chooseSimpleQuote2();
00166     void defaultSimpleQuote();
00167 
00168     void slotChangeStateSimple(bool);
00169     void slotChangeStateDouble(bool);
00170 
00171     void slotAddEntry();
00172     void chooseBulletStyle();
00173     void defaultBulletStyle();
00174     void slotChangeTextFormatEntry();
00175     void slotResetConf();
00176     void changeAutoformatLanguage(const QString & );
00177     void slotClearTextFormatEntry();
00178     void slotChangeAdvancedAutoCorrection();
00179 };
00180 
00181 class KOTEXT_EXPORT KoCompletionDia : public KDialogBase
00182 {
00183     Q_OBJECT
00184 
00185 public:
00186     KoCompletionDia( QWidget *parent, const char *name, KoAutoFormat * autoFormat );
00187 protected slots:
00188     virtual void slotOk();
00189     void slotRemoveCompletionEntry();
00190     void slotCompletionWordSelected( const QString & );
00191     void slotSaveCompletionEntry();
00192     void slotAddCompletionEntry();
00193     void slotResetConf();
00194     bool applyConfig();
00195     void changeButtonStatus();
00196 protected:
00197     void setup();
00198     KoAutoFormat m_autoFormat; // The copy we're working on
00199     KoAutoFormat * m_docAutoFormat; // Pointer to the real one (in KWDocument)
00200     QStringList m_listCompletion; // The copy of the completion items - don't use m_autoFormat.getCompletion()!
00201     QCheckBox *cbAllowCompletion, *cbAppendSpace, *cbAddCompletionWord, *cbShowToolTip;
00202     QPushButton *pbRemoveCompletionEntry;
00203     QPushButton *pbSaveCompletionEntry;
00204     QPushButton *pbAddCompletionEntry;
00205     QListBox *m_lbListCompletion;
00206     KIntNumInput *m_minWordLength;
00207     KIntNumInput *m_maxNbWordCompletion;
00208     QComboBox *m_completionKeyAction;
00209     QLabel *m_completionKeyActionLabel;
00210 
00211 };
00212 #endif
00213 
00214 
KDE Logo
This file is part of the documentation for lib Library Version 1.4.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Mon Feb 13 09:39:59 2006 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003