~ubuntu-branches/ubuntu/breezy/koffice/breezy

« back to all changes in this revision

Viewing changes to kword/kwtablestylemanager.h

  • Committer: Bazaar Package Importer
  • Author(s): Ben Burton
  • Date: 2004-05-09 11:33:00 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040509113300-vfrdadqsvjfuhn3b
Tags: 1:1.3.1-1
* New upstream bugfix release.
* Built against newer imagemagick (closes: #246623).
* Made koffice-libs/kformula recommend/depend on latex-xft-fonts, which
  provides mathematical fonts that the formula editor can use.  Also
  patched the kformula part to make these fonts the default.
* Changed kword menu hint from "WordProcessors" to "Word processors"
  (closes: #246209).
* Spellchecker configuration is now fixed (closes: #221256, #227568).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* This file is part of the KDE project
 
2
   Copyright (C) 2002 Nash Hoogwater <nrhoogwater@wanadoo.nl>
 
3
 
 
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.
 
8
 
 
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.
 
13
 
 
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.
 
18
*/
 
19
 
 
20
#ifndef kwtablestylemanager_h
 
21
#define kwtablestylemanager_h
 
22
 
 
23
#include "kwframestyle.h"
 
24
#include "kwtablestyle.h"
 
25
 
 
26
#include <kdialogbase.h>
 
27
#include <qgroupbox.h>
 
28
#include <qptrlist.h>
 
29
 
 
30
 
 
31
class QGridLayout;
 
32
class QLineEdit;
 
33
class QListBox;
 
34
class QPushButton;
 
35
class QWidget;
 
36
class QFrame;
 
37
class QComboBox;
 
38
 
 
39
class KWDocument;
 
40
class KWStyle;
 
41
 
 
42
/******************************************************************/
 
43
/* Class: KWTableStylePreview                                     */
 
44
/******************************************************************/
 
45
 
 
46
class KWTableStylePreview : public QGroupBox
 
47
{
 
48
    Q_OBJECT
 
49
 
 
50
public:
 
51
    KWTableStylePreview(const QString &title, const QString &text, QWidget *parent, const char* name = 0);
 
52
    virtual ~KWTableStylePreview();
 
53
 
 
54
    void setTableStyle(KWTableStyle *_tableStyle);
 
55
 
 
56
protected:
 
57
    void drawContents( QPainter *p );
 
58
 
 
59
    KWTableStyle *tableStyle;
 
60
 
 
61
    KoTextDocument *m_textdoc;
 
62
    KoZoomHandler *m_zoomHandler;
 
63
};
 
64
 
 
65
class KWTableStyleListItem
 
66
{
 
67
  public:
 
68
    KWTableStyleListItem() {}
 
69
    ~KWTableStyleListItem();
 
70
    KWTableStyleListItem(KWTableStyle *orig, KWTableStyle *changed) {
 
71
        m_origTableStyle = orig;
 
72
        m_changedTableStyle = changed;
 
73
    }
 
74
 
 
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; }
 
81
 
 
82
    void switchStyle();
 
83
    void deleteStyle( KWTableStyle *current );
 
84
    void apply();
 
85
 
 
86
  protected:
 
87
    KWTableStyle *m_origTableStyle;
 
88
    KWTableStyle *m_changedTableStyle;
 
89
};
 
90
 
 
91
/******************************************************************/
 
92
/* Class: KWTableStyleManager                                     */
 
93
/******************************************************************/
 
94
class KWTableStyleManager : public KDialogBase
 
95
{
 
96
    Q_OBJECT
 
97
 
 
98
public:
 
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 );
 
105
 
 
106
protected:
 
107
 
 
108
    void setupWidget(const QPtrList<KWTableStyle> & style);
 
109
    void addGeneralTab();
 
110
    void apply();
 
111
    void updateGUI();
 
112
    void updatePreview();
 
113
    void save();
 
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;
 
123
    QComboBox *m_style;
 
124
    QPushButton *m_changeFrameStyleButton;
 
125
    QPushButton *m_changeStyleButton;
 
126
    QStringList m_styleOrder;
 
127
    QGroupBox *previewBox;
 
128
    KWTableStylePreview *preview;
 
129
 
 
130
    QWidget *main;
 
131
 
 
132
    KWTableStyle *m_currentTableStyle;
 
133
    QPtrList<KWTableStyleListItem> m_tableStyles;
 
134
    int numTableStyles;
 
135
    bool noSignals;
 
136
 
 
137
    KWDocument *m_doc;
 
138
    KWFrameStyle *m_defaultFrameStyle;
 
139
    KWStyle *m_defaultStyle;
 
140
 
 
141
protected slots:
 
142
    virtual void slotOk();
 
143
    virtual void slotApply();
 
144
    void updateAllStyleCombos();
 
145
    void changeFrameStyle();
 
146
    void changeStyle();
 
147
    void selectFrameStyle(int);
 
148
    void selectStyle(int);
 
149
    void switchStyle();
 
150
    void addStyle();
 
151
    void deleteStyle();
 
152
    void moveUpStyle();
 
153
    void moveDownStyle();
 
154
    void renameStyle(const QString &);
 
155
    void setupMain();
 
156
    void importFromFile();
 
157
};
 
158
 
 
159
#endif