chalk

kis_color_cup.h
1/* This file is part of the KDE project
2 *
3 * Copyright (c) 2005 Boudewijn Rempt <boud@valdyas.org>
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 Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19#ifndef KIS_COLOR_CUP_H
20#define KIS_COLOR_CUP_H
21
22#include <tqpushbutton.h>
23#include <tqcolor.h>
24#include <tqframe.h>
25
26#include <koffice_export.h>
27
28class TQSize;
29class TQPainter;
30class TQWidget;
31class KHSSelector;
32class KValueSelector;
33
34class KisColorPopup : public TQFrame {
35
36 TQ_OBJECT
37
38
39public:
40
41 KisColorPopup(TQColor color, TQWidget * w, const char * name);
42 virtual ~KisColorPopup() {};
43
44signals:
45
46 void changed(const TQColor &);
47
48private:
49
50 KHSSelector * m_khsSelector;
51 KValueSelector * m_valueSelector;
52
53 TQColor m_color;
54};
55
56class KRITAUI_EXPORT KisColorCup : public TQPushButton {
57
58 TQ_OBJECT
59
60
61public:
62
63 KisColorCup(TQWidget * parent, const char * name = 0);
64
65 virtual ~KisColorCup() {};
66
67 TQColor color() { return m_color; };
68
69signals:
70
71 void changed(const TQColor &);
72
73public:
74
75 TQSize sizeHint() const;
76
77public slots:
78
79 void setColor(const TQColor & c);
80
81
82private slots:
83
84 void slotClicked();
85
86protected:
87
88 virtual void drawButtonLabel( TQPainter *p );
89
90private:
91
92 KisColorPopup * m_popup;
93 TQColor m_color;
94};
95
96#endif