Scribus
Open source desktop publishing at your fingertips
smtextstyles.h
1 /*
2 For general Scribus (>=1.3.2) copyright and licensing information please refer
3 to the COPYING file provided with the program. Following this notice may exist
4 a copyright and/or license notice that predates the release of Scribus 1.3.2
5 for which a new license (GPL+exception) is in place.
6 */
7 
8 #ifndef SMTEXTSTYLES_H
9 #define SMTEXTSTYLES_H
10 
11 #include "styleitem.h"
12 #include "styles/styleset.h"
13 #include "styles/paragraphstyle.h"
14 
15 class CharStyle;
16 class ScribusDoc;
17 class SMCStyleWidget;
18 class SMPStyleWidget;
19 
21 {
22  Q_OBJECT
23 public:
26 
27  QTabWidget* widget();
28  QString typeNamePlural();
29  QString typeNameSingular();
30  void setCurrentDoc(ScribusDoc *doc);
31  QList<StyleName> styles(bool reloadFromDoc = true);
32  void reload();
33  void selected(const QStringList &styleNames);
34  QString fromSelection() const;
35  void toSelection(const QString &styleName) const;
36  QString newStyle();
37  QString newStyle(const QString &fromStyle);
38  void apply();
39  void editMode(bool isOn);
40  bool isDefaultStyle(const QString &stylename) const;
41  void setDefaultStyle(bool ids);
42  QString shortcut(const QString &stylename) const;
43  void setShortcut(const QString &shortcut);
44  void deleteStyles(const QList<RemoveItem> &removeList);
45  void nameChanged(const QString &newName);
46  QString getUniqueName(const QString &name);
47  void languageChange();
48  void unitChange();
49  StyleSet<ParagraphStyle>* tmpStyles(); // butt ugly
50 
51 signals:
52  void selectionDirty();
53 
54 private:
55  SMPStyleWidget *m_pwidget;
56  ScribusDoc *m_doc;
57  bool m_selectionIsDirty;
58  double m_unitRatio;
59  StyleSet<ParagraphStyle> m_tmpStyles;
60  StyleSet<CharStyle> *m_cstyles;
61  QList<ParagraphStyle*> m_selection;
62  QList<RemoveItem> m_deleted;
63 
64  void setupConnections();
65  void removeConnections();
66  void updateStyleList();
67  void reloadTmpStyles();
68  QList<CharStyle> getCharStyles();
69 
70 private slots:
71  // pstyle
72  void slotLineSpacingMode(int mode);
73  void slotLineSpacing();
74  void slotParentParaEffects();
75  void slotDropCap(bool isOn);
76  void slotDropCapLines(int lines);
77  void slotParEffectOffset();
78  void slotParEffectIndent(bool);
79  void slotParEffectCharStyle(int);
80  void slotBullet(bool isOn);
81  void slotBulletStr(const QString &str);
82  void slotNumeration(bool isOn);
83  void slotNumName(const QString &str);
84  void slotNumNew();
85  void slotSelectionDirty();
86  void slotNumFormat(int numFormat);
87  void slotNumLevel(int level);
88  void slotNumPrefix(const QString &str);
89  void slotNumSuffix(const QString &str);
90  void slotNumStart(int start);
91  void slotNumRestart(int restart);
92  void slotNumOther(bool isOn);
93  void slotNumHigher(bool isOn);
94  void slotSpaceAbove();
95  void slotSpaceBelow();
96  void slotAlignment();
97  void slotOpticalMargin(int i);
98  void slotOpticalMarginSelector();
99  void slotParentOpticalMargin();
100  void slotMinSpace();
101  void slotMinGlyphExt();
102  void slotMaxGlyphExt();
103  void handleKeepLinesStart();
104  void handleKeepLinesEnd();
105  void handleKeepTogether();
106  void handleKeepWithNext();
107  void slotTabRuler();
108  void slotLeftIndent();
109  void slotRightIndent();
110  void slotFirstLine();
111  // cstyle
112  void slotFontSize();
113  void slotEffects(int e);
114  void slotEffectProperties();
115  void slotFillColor();
116  void slotFillShade();
117  void slotStrokeColor();
118  void slotStrokeShade();
119  void slotLanguage();
120  void slotScaleH();
121  void slotScaleV();
122  void slotTracking();
123  void slotWordTracking();
124  void slotBaselineOffset();
125  void slotFont(QString s);
126  void slotParentChanged(const QString &parent);
127  void slotCharParentChanged(const QString &parent);
128 };
129 
131 {
132  Q_OBJECT
133 public:
135  ~SMCharacterStyle();
136 
137  QTabWidget* widget();
138  QString typeNamePlural();
139  QString typeNameSingular();
140  void setCurrentDoc(ScribusDoc *doc);
141  QList<StyleName> styles(bool reloadFromDoc = true);
142  void reload();
143  void selected(const QStringList &styleNames);
144  QString fromSelection() const;
145  void toSelection(const QString &styleName) const;
146  QString newStyle();
147  QString newStyle(const QString &fromStyle);
148  void apply();
149  void editMode(bool isOn);
150  bool isDefaultStyle(const QString &stylename) const;
151  void setDefaultStyle(bool ids);
152  QString shortcut(const QString &stylename) const;
153  void setShortcut(const QString &shortcut);
154  void deleteStyles(const QList<RemoveItem> &removeList);
155  void nameChanged(const QString &newName);
156  QString getUniqueName(const QString &name);
157  void languageChange();
158  void unitChange();
159  StyleSet<CharStyle>* tmpStyles();
160 
161 signals:
162  void selectionDirty();
163 
164 private:
165  QTabWidget *m_widget;
166  SMCStyleWidget *m_page;
167  ScribusDoc *m_doc;
168  StyleSet<CharStyle> m_tmpStyles;
169  QList<CharStyle*> m_selection;
170  QList<RemoveItem> m_deleted;
171  bool m_selectionIsDirty;
172 
173  void reloadTmpStyles();
174  void setupConnections();
175  void removeConnections();
176 
177 private slots:
178  void slotFontSize();
179  void slotEffects(int e);
180  void slotEffectProperties();
181  void slotFillColor();
182  void slotFillShade();
183  void slotStrokeColor();
184  void slotStrokeShade();
185  void slotLanguage();
186  void slotScaleH();
187  void slotScaleV();
188  void slotTracking();
189  void slotWordTracking();
190  void slotBaselineOffset();
191  void slotFont(QString s);
192  void slotParentChanged(const QString &parent);
193 
194 };
195 
196 #endif
void setDefaultStyle(bool ids)
set if the style is a default style
Definition: smtextstyles.cpp:2094
Definition: charstyle.h:78
void nameChanged(const QString &newName)
Called when the currently selected style's name has changed.
Definition: smtextstyles.cpp:413
QString newStyle()
Create a new temp. style with default values and return the.
Definition: smtextstyles.cpp:1983
bool isDefaultStyle(const QString &stylename) const
returns if the style is a default style
Definition: smtextstyles.cpp:323
QString typeNamePlural()
name of the style (plural) (Paragraph Styles, Character Styles...)
Definition: smtextstyles.cpp:1838
QList< StyleName > styles(bool reloadFromDoc=true)
existing styles in this category
Definition: smtextstyles.cpp:1876
void reload()
Reload styles and remove all cached (and possibly changed ones).
Definition: smtextstyles.cpp:134
void unitChange()
document unit has been changed, upgrade widgets
Definition: smtextstyles.cpp:470
Definition: smtextstyles.h:20
Represents a style type that can be added to the Style Manager.
Definition: styleitem.h:37
void setShortcut(const QString &shortcut)
set the key combination for the selected style's shortcut
Definition: smtextstyles.cpp:2128
void reload()
Reload styles and remove all cached (and possibly changed ones).
Definition: smtextstyles.cpp:1907
QString typeNamePlural()
name of the style (plural) (Paragraph Styles, Character Styles...)
Definition: smtextstyles.cpp:57
void setCurrentDoc(ScribusDoc *doc)
Whenever style manager is shown attached StyleItems get the current doc.
Definition: smtextstyles.cpp:67
void setCurrentDoc(ScribusDoc *doc)
Whenever style manager is shown attached StyleItems get the current doc.
Definition: smtextstyles.cpp:1848
bool isDefaultStyle(const QString &stylename) const
returns if the style is a default style
Definition: smtextstyles.cpp:2076
the Document Class
Definition: scribusdoc.h:90
void selected(const QStringList &styleNames)
Whenever this function is called StyleItem must update the main.
Definition: smtextstyles.cpp:139
void editMode(bool isOn)
When SM switches to or away from edit mode this function is called.
Definition: smtextstyles.cpp:317
void apply()
apply changes made to the currently selected style(s)
Definition: smtextstyles.cpp:2046
QString typeNameSingular()
name of the style (singular) (Paragraph Style, Character Style...)
Definition: smtextstyles.cpp:62
void setDefaultStyle(bool ids)
set if the style is a default style
Definition: smtextstyles.cpp:341
QString typeNameSingular()
name of the style (singular) (Paragraph Style, Character Style...)
Definition: smtextstyles.cpp:1843
void deleteStyles(const QList< RemoveItem > &removeList)
User has requested to delete all the selected styles.
Definition: smtextstyles.cpp:2143
void selected(const QStringList &styleNames)
Whenever this function is called StyleItem must update the main.
Definition: smtextstyles.cpp:1912
void nameChanged(const QString &newName)
Called when the currently selected style's name has changed.
Definition: smtextstyles.cpp:2163
void setShortcut(const QString &shortcut)
set the key combination for the selected style's shortcut
Definition: smtextstyles.cpp:377
QString shortcut(const QString &stylename) const
returns the key combination for the style's shortcut
Definition: smtextstyles.cpp:2109
Definition: smtextstyles.h:130
void languageChange()
reload all the gui strings whenever this method is called
Definition: smtextstyles.cpp:2211
QList< StyleName > styles(bool reloadFromDoc=true)
existing styles in this category
Definition: smtextstyles.cpp:99
void unitChange()
document unit has been changed, upgrade widgets
Definition: smtextstyles.cpp:2220
void languageChange()
reload all the gui strings whenever this method is called
Definition: smtextstyles.cpp:461
QString fromSelection() const
Return the name of the style in this category applied to the.
Definition: smtextstyles.cpp:185
void toSelection(const QString &styleName) const
Apply style called styleName to the documents current selection.
Definition: smtextstyles.cpp:1964
QString getUniqueName(const QString &name)
Return a unique name for a style using the base in the name.
Definition: smtextstyles.cpp:2019
void toSelection(const QString &styleName) const
Apply style called styleName to the documents current selection.
Definition: smtextstyles.cpp:211
void deleteStyles(const QList< RemoveItem > &removeList)
User has requested to delete all the selected styles.
Definition: smtextstyles.cpp:392
void editMode(bool isOn)
When SM switches to or away from edit mode this function is called.
Definition: smtextstyles.cpp:2070
void apply()
apply changes made to the currently selected style(s)
Definition: smtextstyles.cpp:295
QTabWidget * widget()
return the QWidget for editing style's properties
Definition: smtextstyles.cpp:1833
QString getUniqueName(const QString &name)
Return a unique name for a style using the base in the name.
Definition: smtextstyles.cpp:268
QString shortcut(const QString &stylename) const
returns the key combination for the style's shortcut
Definition: smtextstyles.cpp:356
QString fromSelection() const
Return the name of the style in this category applied to the.
Definition: smtextstyles.cpp:1938
Definition: smpstylewidget.h:18
QTabWidget * widget()
return the QWidget for editing style's properties
Definition: smtextstyles.cpp:52
QString newStyle()
Create a new temp. style with default values and return the.
Definition: smtextstyles.cpp:230