Scribus
Open source desktop publishing at your fingertips
smtablestyle.h
1 /*
2 Copyright (C) 2011 Elvis Stansvik <elvstone@gmail.com>
3 
4 For general Scribus (>=1.3.2) copyright and licensing information please refer
5 to the COPYING file provided with the program. Following this notice may exist
6 a copyright and/or license notice that predates the release of Scribus 1.3.2
7 for which a new license (GPL+exception) is in place.
8 */
9 
10 #ifndef SMTABLESTYLES_H
11 #define SMTABLESTYLES_H
12 
13 #include <QList>
14 
15 #include "styleitem.h"
16 #include "styles/styleset.h"
17 #include "styles/tablestyle.h"
18 
19 class SMTableStyleWidget;
20 class QTabWidget;
21 class ScribusDoc;
22 
23 class SMTableStyle : public StyleItem
24 {
25  Q_OBJECT
26 public:
28  SMTableStyle();
30  ~SMTableStyle();
31 
33  QTabWidget* widget();
35  QString typeNamePlural();
37  QString typeNameSingular();
39  void setCurrentDoc(ScribusDoc *doc);
41  QList<StyleName> styles(bool reloadFromDoc = true);
43  void reload();
45  void selected(const QStringList &styleNames);
47  QString fromSelection() const;
49  void toSelection(const QString &styleName) const;
51  QString newStyle();
53  QString newStyle(const QString &fromStyle);
55  void apply();
57  void editMode(bool isOn);
59  bool isDefaultStyle(const QString &styleName) const;
61  void setDefaultStyle(bool isDefaultStyle);
63  QString shortcut(const QString &styleName) const;
65  void setShortcut(const QString &shortcut);
67  void deleteStyles(const QList<RemoveItem> &removeList);
69  void nameChanged(const QString &newName);
71  QString getUniqueName(const QString &name);
73  void languageChange();
75  void unitChange();
76 
77 signals:
78  void selectionDirty();
79 
80 private:
81  QTabWidget *m_widget;
82  SMTableStyleWidget *m_page;
83  ScribusDoc *m_doc;
84  StyleSet<TableStyle> m_cachedStyles;
85  QList<TableStyle*> m_selection;
86  QList<RemoveItem> m_deleted;
87  bool m_selectionIsDirty;
88 
89  void updateStylesCache();
90  void setupConnections();
91  void removeConnections();
92 
93 private slots:
94  void slotFillColor();
95  void slotFillShade();
96  void slotParentChanged(const QString &parent);
97 };
98 
99 #endif // SMTABLESTYLES_H
SMTableStyle()
Constructor.
Definition: smtablestyle.cpp:18
void apply()
Reimplemented from StyleItem.
Definition: smtablestyle.cpp:187
void setDefaultStyle(bool isDefaultStyle)
Reimplemented from StyleItem.
Definition: smtablestyle.cpp:236
QString newStyle()
Reimplemented from StyleItem.
Definition: smtablestyle.cpp:152
SMTableStyleWidget(QWidget *parent=0)
Constructor.
Definition: smtablestylewidget.cpp:13
QList< StyleName > styles(bool reloadFromDoc=true)
Reimplemented from StyleItem.
Definition: smtablestyle.cpp:79
void languageChange()
Reimplemented from StyleItem.
Definition: smtablestyle.cpp:385
Definition: smtablestyle.h:23
Represents a style type that can be added to the Style Manager.
Definition: styleitem.h:37
void setCurrentDoc(ScribusDoc *doc)
Reimplemented from StyleItem.
Definition: smtablestyle.cpp:53
void reload()
Reimplemented from StyleItem.
Definition: smtablestyle.cpp:111
QString getUniqueName(const QString &name)
Reimplemented from StyleItem.
Definition: smtablestyle.cpp:358
the Document Class
Definition: scribusdoc.h:90
void toSelection(const QString &styleName) const
Reimplemented from StyleItem.
Definition: smtablestyle.cpp:147
void editMode(bool isOn)
Reimplemented from StyleItem.
Definition: smtablestyle.cpp:212
QTabWidget * widget()
Reimplemented from StyleItem.
Definition: smtablestyle.cpp:38
void nameChanged(const QString &newName)
Reimplemented from StyleItem.
Definition: smtablestyle.cpp:305
QString typeNameSingular()
Reimplemented from StyleItem.
Definition: smtablestyle.cpp:48
QString fromSelection() const
Reimplemented from StyleItem.
Definition: smtablestyle.cpp:141
QString typeNamePlural()
Reimplemented from StyleItem.
Definition: smtablestyle.cpp:43
QString shortcut(const QString &styleName) const
Reimplemented from StyleItem.
Definition: smtablestyle.cpp:251
void deleteStyles(const QList< RemoveItem > &removeList)
Reimplemented from StyleItem.
Definition: smtablestyle.cpp:285
void unitChange()
Reimplemented from StyleItem.
Definition: smtablestyle.cpp:394
bool isDefaultStyle(const QString &styleName) const
Reimplemented from StyleItem.
Definition: smtablestyle.cpp:218
~SMTableStyle()
Destructor.
Definition: smtablestyle.cpp:30
void setShortcut(const QString &shortcut)
Reimplemented from StyleItem.
Definition: smtablestyle.cpp:270
void selected(const QStringList &styleNames)
Reimplemented from StyleItem.
Definition: smtablestyle.cpp:116