Back to index

scribus-ng  1.3.4.dfsg+svn20071115
styleitem.h
Go to the documentation of this file.
00001 /*
00002 For general Scribus (>=1.3.2) copyright and licensing information please refer
00003 to the COPYING file provided with the program. Following this notice may exist
00004 a copyright and/or license notice that predates the release of Scribus 1.3.2
00005 for which a new license (GPL+exception) is in place.
00006 */
00007 
00008 #ifndef STYLEITEM_H
00009 #define STYLEITEM_H
00010 
00011 #include <qobject.h>
00012 #include <qvaluelist.h>
00013 
00014 class QString;
00015 class QStringList;
00016 class ScribusDoc;
00017 class QTabWidget;
00018 
00021 typedef QPair<QString, QString> RemoveItem;
00022 
00025 typedef QPair<QString, QString> StyleName;
00026 
00036 class StyleItem : public QObject {
00037        Q_OBJECT
00038 public:
00039        StyleItem();
00040        virtual ~StyleItem();
00041 
00051        virtual QTabWidget* widget() = 0;
00052 
00054        virtual QString typeNamePlural() = 0;
00055 
00057        virtual QString typeNameSingular() = 0;
00058 
00063        virtual void currentDoc(ScribusDoc *doc) = 0;
00064 
00075        virtual QValueList<StyleName> styles(bool reloadFromDoc = true) = 0;
00076 
00084        virtual void reload() = 0;
00085 
00098        virtual void selected(const QStringList &styleNames) = 0;
00099 
00109        virtual QString fromSelection() const = 0;
00110 
00115        virtual void toSelection(const QString &styleName) const = 0;
00116 
00122        virtual QString newStyle() = 0;
00123 
00129        virtual QString newStyle(const QString &fromStyle) = 0;
00130 
00141        virtual void apply() = 0;
00142 
00147        virtual void editMode(bool isOn) {};
00148 
00150        virtual QString shortcut(const QString &stylename) const = 0;
00151 
00153        virtual void setShortcut(const QString &shortcut) = 0;
00154 
00162        virtual void deleteStyles(const QValueList<RemoveItem> &removeList) = 0;
00163 
00165        virtual void nameChanged(const QString &newName) = 0;
00166 
00168        virtual QString getUniqueName(const QString &base) = 0;
00169 
00171        virtual void languageChange() = 0;
00172 
00174        virtual void unitChange() = 0;
00175 
00176        // do not implement this in derived classes
00177        QString typeName() { return typeNamePlural(); };
00178 
00179 /*
00180        Emit this signal when selection has been edited. SM knows to highlight the
00181        edited styles based on this signal.
00182 signals:
00183        selectionDirty();
00184 */
00185 
00186 private:
00187        /* hide these two, StyleItem is not ment to be copied */
00188        StyleItem(const StyleItem&);
00189        void operator=(const StyleItem&);
00190 
00191 };
00192 
00193 #endif