Scribus
Open source desktop publishing at your fingertips
openpalettemanager.h
1 /***************************************************************************
2  * Copyright (C) 2009 by Pierre Marchand *
3  * pierre@oep-h.com *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
19  ***************************************************************************/
20 
21 #ifndef OPENPALETTEMANAGER_H
22 #define OPENPALETTEMANAGER_H
23 
24 #include <QObject>
25 #include <QString>
26 #include <QList>
27 
28 
29 class OpenPalette;
30 class PrefsFile;
31 class QWidget;
32 
40 class OpenPaletteManager : public QObject
41 {
42  Q_OBJECT
43 
45  OpenPaletteManager(QObject * parent);
46  static OpenPaletteManager * instance;
47  static OpenPaletteManager* that();
48 
49 public:
53  static void savePaletteCollection(const QString& filepath);
54 
58  static void loadPaletteCollection(const QString& filepath);
59 
63  static void newPalette(QWidget * parent = 0);
64 
68  static unsigned int count();
69 
73  static QString title(unsigned int idx);
74 
78  static QVariant paletteProperty(unsigned int idx, const QString& prop);
79 
80 
84  static bool paletteProperty(unsigned int idx, const QString& prop, const QVariant& val);
85 
89  static QStringList items(unsigned int idx);
90 
94  static void setItems(unsigned int idx, const QStringList& ilist);
95 
99  static void subChanges(QObject * subscriber, const char * method);
100 
101 private:
102  QList<OpenPalette*> palettes;
103 
104 private slots:
105  void unRegisterPalette();
106  void catchPalette();
107 
108 signals:
109  void changed();
110 
111 };
112 
113 #endif // OPENPALETTEMANAGER_H
static void newPalette(QWidget *parent=0)
Definition: openpalettemanager.cpp:54
static void savePaletteCollection(const QString &filepath)
Definition: openpalettemanager.cpp:44
static void loadPaletteCollection(const QString &filepath)
Definition: openpalettemanager.cpp:49
static QStringList items(unsigned int idx)
Definition: openpalettemanager.cpp:93
Definition: openpalette.h:37
static unsigned int count()
Definition: openpalettemanager.cpp:64
static void setItems(unsigned int idx, const QStringList &ilist)
Definition: openpalettemanager.cpp:100
static void subChanges(QObject *subscriber, const char *method)
Definition: openpalettemanager.cpp:109
static QVariant paletteProperty(unsigned int idx, const QString &prop)
Definition: openpalettemanager.cpp:77
Definition: prefsfile.h:38
static QString title(unsigned int idx)
Definition: openpalettemanager.cpp:69
Definition: openpalettemanager.h:40