From 47d455dd55be855e4cc691c32f687f723d9247ee Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegraphics@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kcoloredit/texteditselection.h | 89 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 kcoloredit/texteditselection.h (limited to 'kcoloredit/texteditselection.h') diff --git a/kcoloredit/texteditselection.h b/kcoloredit/texteditselection.h new file mode 100644 index 00000000..c2166098 --- /dev/null +++ b/kcoloredit/texteditselection.h @@ -0,0 +1,89 @@ +/*************************************************************************** + texteditselection.h - description + ------------------- + begin : Wed Jul 12 2000 + copyright : (C) 2000 by Artur Rataj + email : art@zeus.polsl.gliwice.pl + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef TEXTEDITSELECTION_H +#define TEXTEDITSELECTION_H + +#include +#include +#include + +#include "color.h" + +/** Color selection widget using line edit. Either HSV or RGB components + * can be set. + * @author Artur Rataj + */ +class TextEditSelection : public QWidget { + Q_OBJECT + +public: + /** Constructs the widget */ + TextEditSelection(QWidget *parent=0, const char *name=0); + ~TextEditSelection(); + +signals: + /** A signal that a color value has changed by edition */ + void valueChanged(Color*); + +public slots: + /** sets a color */ + void slotSetValue(Color* color); + +protected: + /** Adds a component line edit */ + void addComponent(const int index, QLineEdit* lineEdit, const int maxValue, const QString& labelString, + const int row, const int column, QGridLayout* layout); + /** sets RGB string in rgbStringLineEdit */ + void setRgbString(const int red, const int green, const int blue); + +protected slots: + /** Called if one of HSV components has changed. In that case, RGB components are + * also changed to match the HSV ones + */ + void slotHsvComponentChanged(); + /** Called if one of RGB components has changed. In that case, HSV components are + * also changed to match the RGB ones + */ + void slotRgbComponentChanged(); + /** Called if the RGB string has changed. In that case, RGB and HSV components are + * also changed to match the RGB string + */ + void slotRgbStringChanged(); + +protected: + /** Indexes of components */ + enum { H_INDEX = 0, + S_INDEX = 1, + V_INDEX = 2, + R_INDEX = 3, + G_INDEX = 4, + B_INDEX = 5, + /** A total number of components */ + COMPONENTS_NUM = 6 }; + + /** Line edit widgets table */ + QLineEdit* lineEditTable[COMPONENTS_NUM]; + /** RGB hex string line edit widgets table */ + QLineEdit* rgbStringLineEdit; + /** The selected color */ + Color color; + /** A flag that components are matched */ + bool inChangingComponents; +}; + +#endif -- cgit v1.2.3