1
/* This file is part of the KDE project
2
Copyright (C) 2002 Nash Hoogwater <nrhoogwater@wanadoo.nl>
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; using
7
version 2 of the License.
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.
20
#ifndef kwtablestylemanager_h
21
#define kwtablestylemanager_h
23
#include "kwframestyle.h"
24
#include "kwtablestyle.h"
26
#include <kdialogbase.h>
27
#include <qgroupbox.h>
42
/******************************************************************/
43
/* Class: KWTableStylePreview */
44
/******************************************************************/
46
class KWTableStylePreview : public QGroupBox
51
KWTableStylePreview(const QString &title, const QString &text, QWidget *parent, const char* name = 0);
52
virtual ~KWTableStylePreview();
54
void setTableStyle(KWTableStyle *_tableStyle);
57
void drawContents( QPainter *p );
59
KWTableStyle *tableStyle;
61
KoTextDocument *m_textdoc;
62
KoZoomHandler *m_zoomHandler;
65
class KWTableStyleListItem
68
KWTableStyleListItem() {}
69
~KWTableStyleListItem();
70
KWTableStyleListItem(KWTableStyle *orig, KWTableStyle *changed) {
71
m_origTableStyle = orig;
72
m_changedTableStyle = changed;
75
KWTableStyle *origTableStyle()const { return m_origTableStyle; }
76
KWTableStyle *changedTableStyle()const { return m_changedTableStyle; }
77
void setOrigTableStyle( KWTableStyle *_orig ) { m_origTableStyle = _orig; }
78
void setChangedTableStyle( KWTableStyle *_changed ) { m_changedTableStyle = _changed; }
79
void deleteOrigTableStyle() { delete m_changedTableStyle; }
80
void deleteChangedTableStyle() { delete m_changedTableStyle; }
83
void deleteStyle( KWTableStyle *current );
87
KWTableStyle *m_origTableStyle;
88
KWTableStyle *m_changedTableStyle;
91
/******************************************************************/
92
/* Class: KWTableStyleManager */
93
/******************************************************************/
94
class KWTableStyleManager : public KDialogBase
99
KWTableStyleManager( QWidget *_parent, KWDocument *_doc, const QPtrList<KWTableStyle> & style );
100
~KWTableStyleManager();
101
KWTableStyle* addTableStyleTemplate(KWTableStyle *style);
102
void removeTableStyleTemplate( KWTableStyle *style );
103
void updateAllStyleLists();
104
void updateTableStyleListOrder( const QStringList &list );
108
void setupWidget(const QPtrList<KWTableStyle> & style);
109
void addGeneralTab();
112
void updatePreview();
114
int tableStyleIndex( int pos );
115
void addStyle(const QPtrList<KWTableStyle> &listStyle );
116
QListBox *m_stylesList;
117
QLineEdit *m_nameString;
118
QPushButton *m_deleteButton;
119
QPushButton *m_newButton;
120
QPushButton *m_moveUpButton;
121
QPushButton *m_moveDownButton;
122
QComboBox *m_frameStyle;
124
QPushButton *m_changeFrameStyleButton;
125
QPushButton *m_changeStyleButton;
126
QStringList m_styleOrder;
127
QGroupBox *previewBox;
128
KWTableStylePreview *preview;
132
KWTableStyle *m_currentTableStyle;
133
QPtrList<KWTableStyleListItem> m_tableStyles;
138
KWFrameStyle *m_defaultFrameStyle;
139
KWStyle *m_defaultStyle;
142
virtual void slotOk();
143
virtual void slotApply();
144
void updateAllStyleCombos();
145
void changeFrameStyle();
147
void selectFrameStyle(int);
148
void selectStyle(int);
153
void moveDownStyle();
154
void renameStyle(const QString &);
156
void importFromFile();