1
/* This file is part of the KDE project
2
Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
4
This library is free software; you can redistribute it and/or
5
modify it under the terms of the GNU Library General Public
6
License as published by the Free Software Foundation; either
7
version 2 of the License, or (at your option) any later version.
9
This library is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12
Library General Public License for more details.
14
You should have received a copy of the GNU Library General Public License
15
along with this library; see the file COPYING.LIB. If not, write to
16
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17
Boston, MA 02111-1307, USA.
23
#include <kdialogbase.h>
24
#include <qstringlist.h>
26
#include <koParagDia.h>
34
class KoStyleManagerTab;
44
class KoStyleManagerPrivate;
46
/******************************************************************/
47
/* Class: KoStyleManager */
48
/******************************************************************/
49
class KOTEXT_EXPORT KoStyleManager : public KDialogBase
54
enum { ShowIncludeInToc = 1 }; // bitfield for flags
55
KoStyleManager( QWidget *_parent, KoUnit::Unit unit,
56
const QPtrList<KoParagStyle> & style, const QString & activeStyleName,
58
virtual ~KoStyleManager();
60
virtual KoParagStyle* addStyleTemplate(KoParagStyle *style)=0;
61
//virtual void applyStyleChange( KoParagStyle * changedStyle, int paragLayoutChanged, int formatChanged )=0;
62
virtual void applyStyleChange( KoStyleChangeDefMap changed )=0;
64
virtual void removeStyleTemplate( KoParagStyle *style )=0;
65
virtual void updateAllStyleLists()=0;
66
virtual void updateStyleListOrder( const QStringList & list)=0;
69
void updateFollowingStyle( KoParagStyle *s );
70
void updateInheritStyle( KoParagStyle *s );
71
void setupWidget(const QPtrList<KoParagStyle> & style);
72
void addGeneralTab( int flags );
77
int styleIndex( int pos );
81
QListBox *m_stylesList;
82
QLineEdit *m_nameString;
83
QComboBox *m_styleCombo;
84
QPushButton *m_deleteButton;
85
QPushButton *m_newButton;
86
QPushButton *m_moveUpButton;
87
QPushButton *m_moveDownButton;
88
QComboBox *m_inheritCombo;
89
KoStyleManagerPrivate *d;
91
KoParagStyle *m_currentStyle;
92
QPtrList<KoParagStyle> m_origStyles; // internal list of orig styles we have modified
93
QPtrList<KoParagStyle> m_changedStyles; // internal list of changed styles.
94
QPtrList<KoStyleManagerTab> m_tabsList;
95
QStringList m_styleOrder;
100
virtual void slotOk();
101
virtual void slotApply();
107
void moveDownStyle();
108
void renameStyle(const QString &);
110
KoParagStyle * style( const QString & _name );
111
void addTab( KoStyleManagerTab * tab );
112
QString generateUniqueName();
115
class KOTEXT_EXPORT KoStyleManagerTab : public QWidget {
118
KoStyleManagerTab(QWidget *parent) : QWidget(parent) {};
120
/** the new style which is to be displayed */
121
void setStyle(KoParagStyle *style) { m_style = style; }
122
/** update the GUI from the current Style*/
123
virtual void update() = 0;
124
/** return the (i18n-ed) name of the tab */
125
virtual QString tabName() = 0;
126
/** save the GUI to the style */
127
virtual void save() = 0;
129
KoParagStyle *m_style;
132
// A tab to edit parts of the parag-layout of the style
133
// Acts as a wrapper around KoParagLayoutWidget [which doesn't know about styles].
134
class KOTEXT_EXPORT KoStyleParagTab : public KoStyleManagerTab
138
KoStyleParagTab( QWidget * parent );
140
// not a constructor parameter since 'this' is the parent of the widget
141
void setWidget( KoParagLayoutWidget * widget );
143
virtual void update();
145
virtual QString tabName() { return m_widget->tabName(); }
147
virtual void resizeEvent( QResizeEvent *e );
149
KoParagLayoutWidget * m_widget;
152
// The "font" tab. Maybe we should put the text color at the bottom ?
153
class KOTEXT_EXPORT KoStyleFontTab : public KoStyleManagerTab
157
KoStyleFontTab( QWidget * parent );
159
virtual void update();
160
virtual QString tabName();
163
virtual void resizeEvent( QResizeEvent *e );
165
KoFontChooser* m_chooser;
166
KoZoomHandler* m_zoomHandler;
171
Color simple color dia
172
Spacing and Indents paragraph spacing dia (KWParagDia)
173
alignments KoParagDia alignment tab
174
borders KoParagDia borders tab
175
numbering KoParagDia tab numbering
176
tabulators KoParagDia tab tabs */