- Save/load palettes properly
[dashstudio.git] / src / components / colorpalette / private / colorpicker.h
blobb000feb3cbccc400eaa5649e55510a457cec2f46
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 ***************************************************************************/
22 #include <QFrame>
24 #ifndef COMPONENTSCOLORPICKER_H
25 #define COMPONENTSCOLORPICKER_H
27 namespace Component {
29 class ColorPicker : public QFrame
31 Q_OBJECT
32 public:
33 ColorPicker(QWidget* parent);
34 ~ColorPicker();
35 int hue();
36 int sat();
39 public slots:
40 void setCol(int h, int s);
41 void setH(int h);
42 void setS(int s);
44 signals:
45 void newCol(int h, int s);
47 protected:
48 QSize sizeHint() const;
49 void paintEvent(QPaintEvent*);
50 void mouseMoveEvent(QMouseEvent *);
51 void mousePressEvent(QMouseEvent *);
53 private:
54 struct Private;
55 Private *const d;
57 QPoint colPt();
58 int huePt(const QPoint &pt);
59 int satPt(const QPoint &pt);
60 void setCol(const QPoint &pt);
64 #endif