Improved gradient creator
[dashstudio.git] / src / components / colorpalette / palettes.h
blob6d116b8bbc25241b88532146b6f13203ba4dcf83
1 /***************************************************************************
2 * Copyright (C) 2005 by Jorge Cuadrado *
3 * kuadrosxx@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 COMPONENTSPALETTES_H
22 #define COMPONENTSPALETTES_H
24 #include <QFrame>
25 #include <QComboBox>
26 #include <QStackedWidget>
27 #include <QVBoxLayout>
28 #include <QBrush>
30 #include "cellscolor.h"
31 #include "paletteparser.h"
34 namespace Components {
36 /**
37 * @author Jorge Cuadrado <kuadrosxx@gmail.com>
39 class Palettes : public QFrame
41 Q_OBJECT
42 public:
43 Palettes(QWidget *parent = 0);
44 virtual ~Palettes();
45 void readPaletteFile(const QString &file);
46 void setBrush(const QBrush & b);
48 private:
49 struct Private;
50 Private *const d;
52 private:
53 void setupForm();
54 void setupButtons();
55 void fillDefaultColors();
56 void addDefaultColor(int i , int j, const QColor &);
57 void fillNamedColor();
58 void readPalettes(const QString &paletteDir);
59 void addPalette(CellsColor *palette);
62 protected:
65 signals:
66 void selectColor(const QBrush &);
68 public slots:
69 virtual void addCurrentColor();
70 virtual void removeCurrentColor();
71 virtual void addPalette(const QString & name, const QList<QBrush> & brushes, bool editable );
72 void changeColor(QTableWidgetItem*/*, QTableWidgetItem **/);
78 #endif