Back to index

scribus-ng  1.3.4.dfsg+svn20071115
smtextstyles.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 SMTEXTSTYLES_H
00009 #define SMTEXTSTYLES_H
00010 
00011 #include "styleitem.h"
00012 #include "styles/styleset.h"
00013 
00014 class CharStyle;
00015 class ParagraphStyle;
00016 class ScribusDoc;
00017 class SMCStylePage;
00018 class SMPStyleWidget;
00019 
00020 class SMParagraphStyle : public StyleItem
00021 {
00022        Q_OBJECT
00023 public:
00024        SMParagraphStyle(StyleSet<CharStyle> *cstyles);
00025        ~SMParagraphStyle();
00026 
00027        QTabWidget* widget();
00028        QString typeNamePlural();
00029        QString typeNameSingular();
00030        void currentDoc(ScribusDoc *doc);
00031        QValueList<StyleName> styles(bool reloadFromDoc = true);
00032        void reload();
00033        void selected(const QStringList &styleNames);
00034        QString fromSelection() const;
00035        void toSelection(const QString &styleName) const;
00036        QString newStyle();
00037        QString newStyle(const QString &fromStyle);
00038        void apply();
00039        void editMode(bool isOn);
00040        QString shortcut(const QString &stylename) const;
00041        void setShortcut(const QString &shortcut);
00042        void deleteStyles(const QValueList<RemoveItem> &removeList);
00043        void nameChanged(const QString &newName);
00044        QString getUniqueName(const QString &name);
00045        void languageChange();
00046        void unitChange();
00047        StyleSet<ParagraphStyle>* tmpStyles(); // butt ugly
00048 
00049 signals:
00050        void selectionDirty();
00051 
00052 private:
00053        SMPStyleWidget *pwidget_;
00054        ScribusDoc *doc_;
00055        bool selectionIsDirty_;
00056        double unitRatio_;
00057        StyleSet<ParagraphStyle> tmpStyles_;
00058        StyleSet<CharStyle> *cstyles_;
00059        QValueList<ParagraphStyle*> selection_;
00060        QValueList<RemoveItem> deleted_;
00061 
00062        void setupConnections();
00063        void removeConnections();
00064        void updateStyleList();
00065        void reloadTmpStyles();
00066        QValueList<CharStyle> getCharStyles();
00067 
00068 private slots:
00069        // pstyle
00070        void slotLineSpacingMode(int mode);
00071        void slotLineSpacing();
00072        void slotParentDropCap();
00073        void slotDropCap(bool isOn);
00074        void slotDropCapLines(int lines);
00075        void slotDropCapOffset();
00076        void slotSpaceAbove();
00077        void slotSpaceBelow();
00078        void slotAlignment();
00079        void slotTabRuler();
00080        void slotLeftIndent();
00081        void slotRightIndent();
00082        void slotFirstLine();
00083        // cstyle
00084        void slotFontSize();
00085        void slotEffects(int e);
00086        void slotEffectProperties();
00087        void slotFillColor();
00088        void slotFillShade();
00089        void slotStrokeColor();
00090        void slotStrokeShade();
00091        void slotLanguage();
00092        void slotScaleH();
00093        void slotScaleV();
00094        void slotTracking();
00095        void slotBaselineOffset();
00096        void slotFont(QString s);
00097        void slotParentChanged(const QString &parent);
00098        void slotCharParentChanged(const QString &parent);
00099 };
00100 
00101 class SMCharacterStyle : public StyleItem
00102 {
00103        Q_OBJECT
00104 public:
00105        SMCharacterStyle();
00106        ~SMCharacterStyle();
00107 
00108        QTabWidget* widget();
00109        QString typeNamePlural();
00110        QString typeNameSingular();
00111        void currentDoc(ScribusDoc *doc);
00112        QValueList<StyleName> styles(bool reloadFromDoc = true);
00113        void reload();
00114        void selected(const QStringList &styleNames);
00115        QString fromSelection() const;
00116        void toSelection(const QString &styleName) const;
00117        QString newStyle();
00118        QString newStyle(const QString &fromStyle);
00119        void apply();
00120        void editMode(bool isOn);
00121        QString shortcut(const QString &stylename) const;
00122        void setShortcut(const QString &shortcut);
00123        void deleteStyles(const QValueList<RemoveItem> &removeList);
00124        void nameChanged(const QString &newName);
00125        QString getUniqueName(const QString &name);
00126        void languageChange();
00127        void unitChange();
00128        StyleSet<CharStyle>* tmpStyles();
00129 
00130 signals:
00131        void selectionDirty();
00132 
00133 private:
00134        QTabWidget   *widget_;
00135        SMCStylePage *page_;
00136        ScribusDoc   *doc_;
00137        StyleSet<CharStyle> tmpStyles_;
00138        QValueList<CharStyle*> selection_;
00139        QValueList<RemoveItem> deleted_;
00140        bool selectionIsDirty_;
00141 
00142        void reloadTmpStyles();
00143        void setupConnections();
00144        void removeConnections();
00145 
00146 private slots:
00147        void slotFontSize();
00148        void slotEffects(int e);
00149        void slotEffectProperties();
00150        void slotFillColor();
00151        void slotFillShade();
00152        void slotStrokeColor();
00153        void slotStrokeShade();
00154        void slotLanguage();
00155        void slotScaleH();
00156        void slotScaleV();
00157        void slotTracking();
00158        void slotBaselineOffset();
00159        void slotFont(QString s);
00160        void slotParentChanged(const QString &parent);
00161 
00162 };
00163 
00164 #endif