koStylist.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef kostylist_h
00021 #define kostylist_h
00022
00023 #include <kdialogbase.h>
00024 #include <qstringlist.h>
00025
00026 #include <koParagDia.h>
00027 #include <koUnit.h>
00028 #include <qptrlist.h>
00029 #include <kostyle.h>
00030
00031 class KoFontChooser;
00032 class KoStyle;
00033 class KoStyleEditor;
00034 class KoStyleManagerTab;
00035 class QCheckBox;
00036 class QComboBox;
00037 class QGridLayout;
00038 class QLineEdit;
00039 class QListBox;
00040 class QPushButton;
00041 class QTabWidget;
00042 class QWidget;
00043 class KoTextDocument;
00044 class KoStyleManagerPrivate;
00045
00046
00047
00048
00049 class KoStyleManager : public KDialogBase
00050 {
00051 Q_OBJECT
00052
00053 public:
00054 KoStyleManager( QWidget *_parent,KoUnit::Unit unit,const QPtrList<KoStyle> & style, const QString & activeStyleName );
00055 virtual ~KoStyleManager();
00056
00057 virtual KoStyle* addStyleTemplate(KoStyle *style)=0;
00058
00059 virtual void applyStyleChange( StyleChangeDefMap changed )=0;
00060
00061 virtual void removeStyleTemplate( KoStyle *style )=0;
00062 virtual void updateAllStyleLists()=0;
00063 virtual void updateStyleListOrder( const QStringList & list)=0;
00064
00065 protected:
00066 void updateFollowingStyle( KoStyle *s );
00067 void updateInheritStyle( KoStyle *s );
00068 void setupWidget(const QPtrList<KoStyle> & style);
00069 void addGeneralTab();
00070 void apply();
00071 void updateGUI();
00072 void updatePreview();
00073 void save();
00074 int styleIndex( int pos );
00075
00076 private:
00077 QTabWidget *m_tabs;
00078 QListBox *m_stylesList;
00079 QLineEdit *m_nameString;
00080 QComboBox *m_styleCombo;
00081 QPushButton *m_deleteButton;
00082 QPushButton *m_newButton;
00083 QPushButton *m_moveUpButton;
00084 QPushButton *m_moveDownButton;
00085 QComboBox *m_inheritCombo;
00086 KoStyleManagerPrivate *d;
00087
00088 KoStyle *m_currentStyle;
00089 QPtrList<KoStyle> m_origStyles;
00090 QPtrList<KoStyle> m_changedStyles;
00091 QPtrList<KoStyleManagerTab> m_tabsList;
00092 QStringList m_styleOrder;
00093 int numStyles;
00094 bool noSignals;
00095
00096 protected slots:
00097 virtual void slotOk();
00098 virtual void slotApply();
00099 void switchStyle();
00100 void switchTabs();
00101 void addStyle();
00102 void deleteStyle();
00103 void moveUpStyle();
00104 void moveDownStyle();
00105 void renameStyle(const QString &);
00106 protected:
00107 KoStyle * style( const QString & _name );
00108 void addTab( KoStyleManagerTab * tab );
00109 };
00110
00111 class KoStyleManagerTab : public QWidget {
00112 Q_OBJECT
00113 public:
00114 KoStyleManagerTab(QWidget *parent) : QWidget(parent) {};
00115
00117 void setStyle(KoStyle *style) { m_style = style; }
00119 virtual void update() = 0;
00121 virtual QString tabName() = 0;
00123 virtual void save() = 0;
00124 protected:
00125 KoStyle *m_style;
00126 };
00127
00128
00129
00130 class KoStyleParagTab : public KoStyleManagerTab
00131 {
00132 Q_OBJECT
00133 public:
00134 KoStyleParagTab( QWidget * parent );
00135
00136
00137 void setWidget( KoParagLayoutWidget * widget );
00138
00139 virtual void update();
00140 virtual void save();
00141 virtual QString tabName() { return m_widget->tabName(); }
00142 protected:
00143 virtual void resizeEvent( QResizeEvent *e );
00144 private:
00145 KoParagLayoutWidget * m_widget;
00146 };
00147
00148
00149 class KoStyleFontTab : public KoStyleManagerTab
00150 {
00151 Q_OBJECT
00152 public:
00153 KoStyleFontTab( QWidget * parent );
00154 ~KoStyleFontTab();
00155 virtual void update();
00156 virtual QString tabName();
00157 virtual void save();
00158 protected:
00159 virtual void resizeEvent( QResizeEvent *e );
00160 private:
00161 KoFontChooser* m_chooser;
00162 KoZoomHandler* m_zoomHandler;
00163 };
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174 #endif
This file is part of the documentation for lib Library Version 1.3.5.