- Improved palette document spec
[dashstudio.git] / src / components / colorpalette / gradientcreator.h
blob5fc718ce0221d54fc50e785dae9da1712e197728
1 /***************************************************************************
2 * Copyright (C) 2005 by Jorge Cuadrado *
3 * kuadrosx@gmail.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 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19 ***************************************************************************/
21 #ifndef GRADIENTMANAGER_H
22 #define GRADIENTMANAGER_H
25 #include <QScrollArea>
26 #include <QGroupBox>
27 #include <QSpinBox>
28 #include <QLabel>
29 #include <QBoxLayout>
31 namespace Component {
33 class SpinControl;
35 /**
37 * @if english
38 * @short translate me
39 * @elseif spanish
40 * @short Esta clase provee de una simple interfaz grafica para crear gradientes.
41 * Consta de un visalizador de gradientes, un configurador de "stops", dos selector de tipos de gradientes (tipo y "spread").
43 * @endif
45 * @author Jorge Cuadrado <kuadrosx@gmail.com>
47 class GradientCreator : public QScrollArea
49 Q_OBJECT
50 public:
51 /**
52 * @if english
53 * Translate
54 * @elseif spanish
55 * Constructor por defecto.
56 * @endif
58 GradientCreator(QWidget *parent = 0);
59 /**
60 * Destructor
62 ~GradientCreator();
64 /**
65 * @if english
66 * Translate
67 * @elseif spanish
68 * Cambia el color del "stop" actual.
69 * @endif
71 void setCurrentColor(const QColor &);
72 /**
73 * @if english
74 * Translate
75 * @elseif spanish
76 * Devuelve el tipo del gradiente actual.
77 * @endif
78 * @see QGradient
80 int gradientType();
81 /**
82 * @if english
83 * Translate
84 * @elseif spanish
85 * Devuelve un QBrush con el gradiente acutal.
86 * @endif
87 * @see QBrush
89 QBrush currentGradient();
91 /**
92 * Devuelve el tamaƱo ideal
94 virtual QSize sizeHint () const;
96 public slots:
97 /**
98 * @if english
99 * Translate
100 * @elseif spanish
101 * Cambia el tipo del gradiente actual.
102 * @endif
103 * @see QGradient
105 void changeType(int type);
107 * @if english
108 * Translate
109 * @elseif spanish
110 * Cambia el "spread" del gradiente actual.
111 * @endif
112 * @see QGradient
114 void changeSpread(int spread);
116 * @if english
117 * Translate
118 * @elseif spanish
119 * Cambia los "GradientStops" del gradiente actual.
120 * @endif
121 * @see QGradientStops
123 void changeGradientStops( const QGradientStops& );
125 * @if english
126 * Translate
127 * @elseif spanish
128 * Cambia el gradiente actual.
129 * @endif
131 void setGradient(const QBrush & gradient);
133 private slots:
134 void emitGradientChanged();
136 signals:
137 void gradientChanged(const QBrush &);
138 void controlArrowAdded();
140 private:
141 struct Private;
142 Private *const d;
150 #endif