~ubuntu-branches/ubuntu/precise/koffice/precise

« back to all changes in this revision

Viewing changes to lib/kotext/KoAutoFormatDia.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2006-04-20 21:38:53 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20060420213853-j5lxluqvymxt2zny
Tags: 1:1.5.0-0ubuntu2
UbuntuĀ uploadĀ 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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 <qlineedit.h>
 
26
#include <KoAutoFormat.h>
 
27
class QCheckBox;
 
28
class KCharSelect;
 
29
class QComboBox;
 
30
 
 
31
 
 
32
/**
 
33
 *
 
34
 */
 
35
class KoAutoFormatLineEdit : public QLineEdit
 
36
{
 
37
    Q_OBJECT
 
38
public:
 
39
    KoAutoFormatLineEdit ( QWidget * parent, const char * name=0 );
 
40
 
 
41
protected:
 
42
    virtual void keyPressEvent ( QKeyEvent * );
 
43
 signals:
 
44
    void keyReturnPressed();
 
45
};
 
46
 
 
47
/******************************************************************/
 
48
/* Class: KoAutoFormatExceptionWidget                             */
 
49
/******************************************************************/
 
50
 
 
51
class KoAutoFormatExceptionWidget : public QWidget
 
52
{
 
53
    Q_OBJECT
 
54
 
 
55
public:
 
56
    KoAutoFormatExceptionWidget(QWidget *_parent, const QString &name,const QStringList &_list, bool _autoInclude, bool _abbreviation=false);
 
57
 
 
58
    void setListException( const QStringList &list);
 
59
    QStringList getListException(){return m_listException;}
 
60
    bool autoInclude();
 
61
    void setAutoInclude( bool b );
 
62
protected slots:
 
63
    void slotAddException();
 
64
    void slotRemoveException();
 
65
    void textChanged ( const QString & );
 
66
    void slotExceptionListSelected();
 
67
 private:
 
68
    QListBox *exceptionList;
 
69
    KoAutoFormatLineEdit *exceptionLine;
 
70
    QPushButton *pbAddException,*pbRemoveException;
 
71
    QCheckBox *cbAutoInclude;
 
72
    QStringList m_listException;
 
73
    bool m_bAbbreviation;
 
74
};
 
75
 
 
76
/******************************************************************/
 
77
/* Class: KoAutoFormatDia                                         */
 
78
/******************************************************************/
 
79
 
 
80
class KOTEXT_EXPORT KoAutoFormatDia : public KDialogBase
 
81
{
 
82
    Q_OBJECT
 
83
 
 
84
public:
 
85
    KoAutoFormatDia( QWidget *parent, const char *name, KoAutoFormat * autoFormat );
 
86
    ~KoAutoFormatDia();
 
87
    void addEntryList(const QString &key, KoAutoFormatEntry *_autoEntry);
 
88
    void editEntryList(const QString &key,const QString &newFindString, KoAutoFormatEntry *_autoEntry);
 
89
protected:
 
90
    bool applyConfig();
 
91
    void setupTab1();
 
92
    void setupTab2();
 
93
    void setupTab3();
 
94
    void setupTab4();
 
95
 
 
96
    void refreshEntryList();
 
97
 
 
98
    void initTab1();
 
99
    void initTab2();
 
100
    void initTab3();
 
101
    void initTab4();
 
102
 
 
103
    typedef QMap<QString, QString> KoExceptionLanguageName;
 
104
    KoExceptionLanguageName exceptionLanguageName;
 
105
 
 
106
    QWidget *tab1;
 
107
    QWidget *tab2;
 
108
    QWidget *tab3;
 
109
    QWidget *tab4;
 
110
 
 
111
    QComboBox *autoFormatLanguage;
 
112
 
 
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;
 
117
 
 
118
    QPushButton *pbSimpleQuote1, *pbSimpleQuote2, *pbSimpleDefault;
 
119
    QPushButton *pbChangeFormat, *pbClearFormat;
 
120
    KCharSelect *charselect;
 
121
    KoAutoFormatLineEdit *m_find, *m_replace;
 
122
    KListView *m_pListView;
 
123
 
 
124
    QChar oSimpleBegin, oSimpleEnd;
 
125
    QChar oDoubleBegin, oDoubleEnd;
 
126
 
 
127
    QChar bulletStyle;
 
128
    KoAutoFormat m_autoFormat; // The copy we're working on
 
129
    KoAutoFormat * m_docAutoFormat; // Pointer to the real one (in KWDocument)
 
130
 
 
131
    KoAutoFormatExceptionWidget *abbreviation;
 
132
    KoAutoFormatExceptionWidget *twoUpperLetter;
 
133
 
 
134
    KoAutoFormatEntry *newEntry;
 
135
 
 
136
    QString initialLanguage;
 
137
    bool noSignal;
 
138
    bool changeLanguage;
 
139
 
 
140
    bool autocorrectionEntryChanged;
 
141
protected slots:
 
142
    virtual void slotOk();
 
143
    virtual void slotCancel();
 
144
 
 
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();
 
156
 
 
157
    void chooseSimpleQuote1();
 
158
    void chooseSimpleQuote2();
 
159
    void defaultSimpleQuote();
 
160
 
 
161
    void slotChangeStateSimple(bool);
 
162
    void slotChangeStateDouble(bool);
 
163
 
 
164
    void slotAddEntry();
 
165
    void chooseBulletStyle();
 
166
    void defaultBulletStyle();
 
167
    void slotChangeTextFormatEntry();
 
168
    void slotResetConf();
 
169
    void changeAutoformatLanguage(const QString & );
 
170
    void slotClearTextFormatEntry();
 
171
    void slotChangeAdvancedAutoCorrection();
 
172
};
 
173
 
 
174
#endif