krita

kis_color_cup.h

00001 /* This file is part of the KDE project
00002  *
00003  * Copyright (c) 2005 Boudewijn Rempt <boud@valdyas.org>
00004  *
00005  *  This program is free software; you can redistribute it and/or modify
00006  *  it under the terms of the GNU General Public License as published by
00007  *  the Free Software Foundation; either version 2 of the License, or
00008  *  (at your option) any later version.
00009  *
00010  *  This program is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *  GNU General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU General Public License
00016  *  along with this program; if not, write to the Free Software
00017  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00018  */
00019 #ifndef KIS_COLOR_CUP_H
00020 #define KIS_COLOR_CUP_H
00021 
00022 #include <qpushbutton.h>
00023 #include <qcolor.h>
00024 #include <qframe.h>
00025 
00026 #include <koffice_export.h>
00027 
00028 class QSize;
00029 class QPainter;
00030 class QWidget;
00031 class KHSSelector;
00032 class KValueSelector;
00033 
00034 class KisColorPopup : public QFrame {
00035 
00036     Q_OBJECT
00037 
00038 public:
00039 
00040     KisColorPopup(QColor color, QWidget * w, const char * name);
00041     virtual ~KisColorPopup() {};
00042 
00043 signals:
00044 
00045     void changed(const QColor &);
00046 
00047 private:
00048 
00049     KHSSelector * m_khsSelector;
00050     KValueSelector * m_valueSelector;
00051 
00052     QColor m_color;
00053 };
00054 
00055 class KRITAUI_EXPORT KisColorCup : public QPushButton {
00056 
00057     Q_OBJECT
00058 
00059 public:
00060 
00061     KisColorCup(QWidget * parent, const char * name = 0);
00062     
00063     virtual ~KisColorCup() {};
00064     
00065     QColor color() { return m_color; };
00066     
00067 signals:
00068 
00069     void changed(const QColor &);
00070 
00071 public:
00072 
00073     QSize sizeHint() const;
00074 
00075 public slots:
00076 
00077     void setColor(const QColor & c);
00078 
00079 
00080 private slots:
00081     
00082     void slotClicked();
00083 
00084 protected:
00085 
00086     virtual void drawButtonLabel( QPainter *p );
00087 
00088 private:
00089 
00090     KisColorPopup * m_popup;
00091     QColor m_color;
00092 };
00093 
00094 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys