lib

ko_cmyk_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  * Copyright (c) 2005 Tim Beaulen (tbscope@gmail.com)
00005  *
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License as published by
00008  *  the Free Software Foundation; either version 2 of the License, or
00009  *  (at your option) any later version.
00010  *
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License
00017  *  along with this program; if not, write to the Free Software
00018  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00019  */
00020 #ifndef KO_CMYK_WIDGET_H
00021 #define KO_CMYK_WIDGET_H
00022 
00023 #include "qwidget.h"
00024 
00025 #include <koffice_export.h>
00026 
00027 class KoFrameButton;
00028 class QGridLayout;
00029 class QColor;
00030 class KoColorSlider;
00031 class QLabel;
00032 class QSpinBox;
00033 class KDualColorButton;
00034 
00035 struct CMYKColor
00036 {
00037     float C;
00038     float M;
00039     float Y;
00040     float K;
00041 };
00042 
00043 class KoCMYKWidget
00044      : public QWidget
00045 {
00046     Q_OBJECT
00047     typedef QWidget super;
00048 
00049 public:
00050     KoCMYKWidget(QWidget *parent = 0L, const char *name = 0);
00051     virtual ~KoCMYKWidget() {}
00052 
00053 public slots:
00057     virtual void setFgColor(const QColor & c);
00058     virtual void setBgColor(const QColor & c);
00059 
00060 signals:
00061 
00065     virtual void sigFgColorChanged(const QColor & c);
00066     virtual void sigBgColorChanged(const QColor & c);
00067 
00068 
00069 protected slots:
00070 
00071     virtual void slotCChanged(int c);
00072     virtual void slotMChanged(int m);
00073     virtual void slotYChanged(int y);
00074     virtual void slotKChanged(int k);
00075 
00076     void slotFGColorSelected(const QColor& c);
00077     void slotBGColorSelected(const QColor& c);
00078 
00079 private:
00080 
00081     void update(const QColor fgColor, const QColor);
00082 
00083     CMYKColor RgbToCmyk(const QColor& col);
00084     QColor CmykToRgb(const CMYKColor& c);
00085 
00086 private:
00087 
00088     KoColorSlider *mCSlider;
00089     KoColorSlider *mMSlider;
00090     KoColorSlider *mYSlider;
00091     KoColorSlider *mKSlider;
00092     QLabel *mCLabel;
00093     QLabel *mMLabel;
00094     QLabel *mYLabel;
00095     QLabel *mKLabel;
00096     QSpinBox *mCIn;
00097     QSpinBox *mMIn;
00098     QSpinBox *mYIn;
00099     QSpinBox *mKIn;
00100     KDualColorButton *m_ColorButton;
00101 
00102     float m_fgC;
00103     float m_fgM;
00104     float m_fgY;
00105     float m_fgK;
00106 
00107     float m_bgC;
00108     float m_bgM;
00109     float m_bgY;
00110     float m_bgK;
00111 
00112     QColor m_fgColor;
00113     QColor m_bgColor;
00114 };
00115 
00116 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys