lib

ko_rgb_widget.h

00001 /* This file is part of the KDE project
00002  * Copyright (c) 1999 Matthias Elter (me@kde.org)
00003  * Copyright (c) 2001-2002 Igor Jansen (rm@kde.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 KO_RGB_WIDGET_H
00020 #define KO_RGB_WIDGET_H
00021 
00022 #include "qwidget.h"
00023 
00024 #include <koffice_export.h>
00025 #include <kdualcolorbutton.h>
00026 
00027 class KoFrameButton;
00028 class QGridLayout;
00029 class QColor;
00030 class KoColorSlider;
00031 class QLabel;
00032 class QSpinBox;
00033 class KDualColorButton;
00034 class KoColorSlider;
00035 class QColor;
00036 
00037 class KoRGBWidget
00038      : public QWidget
00039 {
00040     Q_OBJECT
00041     typedef QWidget super;
00042 
00043 public:
00044     KoRGBWidget(QWidget *parent = 0L, const char *name = 0);
00045     virtual ~KoRGBWidget() {}
00046 
00047 public slots:
00051     virtual void setFgColor(const QColor & c);
00052     virtual void setBgColor(const QColor & c);
00054     virtual void setMode(KDualColorButton::DualColor);
00055 
00056 signals:
00057 
00061     virtual void sigFgColorChanged(const QColor & c);
00062     virtual void sigBgColorChanged(const QColor & c);
00064     virtual void sigModeChanged(KDualColorButton::DualColor);
00065 
00066 
00067 protected slots:
00068 
00069     virtual void slotRChanged(int r);
00070     virtual void slotGChanged(int g);
00071     virtual void slotBChanged(int b);
00072 
00073     void slotFGColorSelected(const QColor& c);
00074     void slotBGColorSelected(const QColor& c);
00075     void currentChanged(KDualColorButton::DualColor);
00076 
00077 private:
00078 
00079     void update(const QColor fgColor, const QColor);
00080 
00081 private:
00082 
00083     KoColorSlider *mRSlider;
00084     KoColorSlider *mGSlider;
00085     KoColorSlider *mBSlider;
00086     QLabel *mRLabel;
00087     QLabel *mGLabel;
00088     QLabel *mBLabel;
00089     QSpinBox *mRIn;
00090     QSpinBox *mGIn;
00091     QSpinBox *mBIn;
00092     KDualColorButton *m_ColorButton;
00093 
00094     QColor m_fgColor;
00095     QColor m_bgColor;
00096 };
00097 
00098 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys