Scribus
Open source desktop publishing at your fingertips
transparencypalette.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  transparencypalette.h - description
9  -------------------
10  begin : Tue Nov 17 2009
11  copyright : (C) 2009 by Franz Schmid
12  email : Franz.Schmid@altmuehlnet.de
13  ***************************************************************************/
14 
15 /***************************************************************************
16  * *
17  * This program is free software; you can redistribute it and/or modify *
18  * it under the terms of the GNU General Public License as published by *
19  * the Free Software Foundation; either version 2 of the License, or *
20  * (at your option) any later version. *
21  * *
22  ***************************************************************************/
23 
24 #ifndef TPALETTE_H
25 #define TPALETTE_H
26 
27 #include <QWidget>
28 #include <QPointer>
29 #include <QGroupBox>
30 #include <QPushButton>
31 #include <QToolButton>
32 #include "scribusapi.h"
33 #include "gradienteditor.h"
34 #include "scribusdoc.h"
35 #include "ui/scrpalettebase.h"
36 #include "ui_transparencypalette.h"
37 #include "ui/gradientvectordialog.h"
38 #include "ui/patternpropsdialog.h"
39 
40 class PageItem;
41 class ColorListBox;
42 class ScrSpinBox;
43 class ScComboBox;
44 class ScPattern;
45 class LinkButton;
46 
51 class SCRIBUS_API Tpalette : public QWidget, Ui::transparencyPalette
52 {
53  Q_OBJECT
54 
55  friend class PropertiesPalette;
56  friend class PropertiesPalette_Group;
57 
58 public:
59  Tpalette(QWidget* parent);
60  ~Tpalette() {};
61 
62  void setDocument(ScribusDoc* doc);
63  void setCurrentItem(PageItem* item);
64  void hideSelectionButtons();
65  void updateFromItem();
66 
67  void updateColorList();
68 
69  void setColors(ColorList newColorList);
70  void setGradients(QHash<QString, VGradient> *docGradients);
71  void setPatterns(QHash<QString, ScPattern> *docPatterns);
72 
73 public slots:
74  void handleUpdateRequest(int);
75 
76  void editLineSelectorButton();
77  void editFillSelectorButton();
78  void slotGrad(int nr);
79  void slotGradType(int type);
80  void setNamedGradient(const QString &name);
81  void switchGradientMode();
82  void switchPatternMode();
83  void editGradientVector();
84  void setActiveGradDia(bool active);
85  void hideEditedPatterns(QStringList names);
86  void selectPattern(QListWidgetItem *c);
87  void setActPattern(QString pattern, double scaleX, double scaleY, double offsetX, double offsetY, double rotation, double skewX, double skewY, bool mirrorX, bool mirrorY);
88  void changePatternProps();
89  void setSpecialGradient(double x1, double y1, double x2, double y2, double fx, double fy, double sg, double sk);
90  void setActTrans(double, double);
91  void setActBlend(int, int);
92  void slotTransS(double val);
93  void slotTransF(double val);
94  void unitChange(double, double, int unitIndex);
95 
96 signals:
97  void NewTrans(double);
98  void NewTransS(double);
99  void NewBlend(int);
100  void NewBlendS(int);
101  void gradientChanged();
102  void editGradient();
103  void NewGradient(int);
104  void NewSpecial(double, double, double, double, double, double, double, double, double, double);
105  void NewPattern(QString);
106  void NewPatternProps(double, double, double, double, double, double, double, bool, bool);
107 
108 protected:
109  GradientVectorDialog* TGradDia;
110  QPointer<ScribusDoc> currentDoc;
111  PageItem* currentItem;
112  ColorList colorList;
113  int currentUnit;
114  QHash<QString, ScPattern> *patternList;
115  QHash<QString, VGradient> *gradientList;
116  double m_Pattern_scaleX;
117  double m_Pattern_scaleY;
118  double m_Pattern_offsetX;
119  double m_Pattern_offsetY;
120  double m_Pattern_rotation;
121  double m_Pattern_skewX;
122  double m_Pattern_skewY;
123  bool m_Pattern_mirrorX;
124  bool m_Pattern_mirrorY;
125 
126  void connectSignals();
127  void disconnectSignals();
128 
129  void updateCList();
130  void updateGradientList();
131  void updatePatternList();
132 };
133 #endif
Definition: propertiespalette_group.h:20
Very nice list box with color names and samples. It's inherited from QListBox with all its methods an...
Definition: colorlistbox.h:67
Definition: scpattern.h:36
Definition: sccolor.h:155
The ScComboBox widget always uses a listbox instead of a popup, independent of any QStyle...
Definition: sccombobox.h:26
the Document Class
Definition: scribusdoc.h:90
ScrSpinBox is a Qt4 replacement for our old ScrSpinBox using Qt3.
Definition: scrspinbox.h:21
Definition: transparencypalette.h:51
Definition: propertiespalette.h:51
Definition: gradientvectordialog.h:40
Definition: pageitem.h:92