Scribus
Open source desktop publishing at your fingertips
paintmanager.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 * Copyright (C) 2010 by Franz Schmid *
9 * franz.schmid@altmuehlnet.de *
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 * This program is distributed in the hope that it will be useful, *
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
19 * GNU General Public License for more details. *
20 * *
21 * You should have received a copy of the GNU General Public License *
22 * along with this program; if not, write to the *
23 * Free Software Foundation, Inc., *
24 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
25 ***************************************************************************/
26 #ifndef PAINTMANAGER_H
27 #define PAINTMANAGER_H
28 #include "ui_paintmanagerbase.h"
29 #include "colorsetmanager.h"
30 #include "sccolor.h"
31 #include "scribusapi.h"
32 #include "scribusdoc.h"
33 
34 #include "vgradient.h"
35 #include "scpattern.h"
36 
37 class SCRIBUS_API PaintManagerDialog : public QDialog, Ui::PaintManagerBase
38 {
39  Q_OBJECT
40 
41  public:
42  PaintManagerDialog(QWidget* parent, QHash<QString, VGradient> *docGradients, ColorList doco, QString docColSet, QHash<QString, ScPattern> *docPatterns, ScribusDoc *doc, ScribusMainWindow* scMW);
43  ~PaintManagerDialog() {};
46  QString getColorSetName();
50  ScColor selectedColor();
54  QString selectedColorName();
55 
56  void keyPressEvent(QKeyEvent *k);
57 
58 
59  ScribusDoc *m_doc;
60  ScribusMainWindow *mainWin;
61  QHash<QString, VGradient> dialogGradients;
62  QMap<QString,QString> replaceMap;
63  QMap<QString,QString> origNames;
64  QStringList origGradients;
65  ColorList m_colorList;
66  QMap<QString,QString> replaceColorMap;
68  QStringList customColSet;
69  bool hasImportedColors;
70  QHash<QString, ScPattern> dialogPatterns;
71  QMap<QString,QString> replaceMapPatterns;
72  QMap<QString,QString> origNamesPatterns;
73  QStringList origPatterns;
74  private slots:
75  void leaveDialog();
76  void slotRightClick(QPoint p);
77  void selEditColor(QTreeWidgetItem *it);
78  void itemSelectionChanged();
79  void itemSelected(QTreeWidgetItem* it);
80  void createNew();
81  void editColorItem();
82  void duplicateColorItem();
83  void removeColorItem();
84  void removeUnusedColorItem();
85  void importColorItems();
86  void loadDefaults(QTreeWidgetItem* item);
87  void saveDefaults();
88  protected:
89  QTreeWidgetItem* updatePatternList(QString addedName = "");
90  QTreeWidgetItem* updateGradientList(QString addedName = "");
91  QTreeWidgetItem* updateColorList(QString addedName = "");
92  ColorList getGradientColors();
93  bool isMandatoryColor(QString colorName);
94  void loadPatternDir();
95  void loadVectors(QString data);
96  void updateGradientColors(QString newName, QString oldName);
97  void loadGimpFormat(QString fileName);
98  void addGimpColor(QString &colorName, double r, double g, double b);
99  void loadScribusFormat(QString fileName);
100  QStringList getUsedPatternsHelper(QString pattern, QStringList &results);
101  void doSaveDefaults(QString name, bool changed = false);
102  ColorSetManager csm;
103  bool paletteLocked;
104  bool modified;
105  int sortRule;
106  QTreeWidgetItem *colorItems;
107  QTreeWidgetItem *gradientItems;
108  QTreeWidgetItem *patternItems;
109  QTreeWidgetItem *systemSwatches;
110  QTreeWidgetItem *userSwatches;
111  ColorList inDocUsedColors;
112 };
113 
114 #endif
Definition: sccolor.h:51
This Class is the base class for your application. It sets up the main window and providing a menubar...
Definition: scribus.h:123
Definition: paintmanager.h:37
Definition: sccolor.h:155
the Document Class
Definition: scribusdoc.h:90
QStringList customColSet
Custom user's color set.
Definition: paintmanager.h:68
Definition: colorsetmanager.h:27