Back to index

scribus-ng  1.3.4.dfsg+svn20071115
colorwheelwidget.h
Go to the documentation of this file.
00001 /*
00002 For general Scribus (>=1.3.2) copyright and licensing information please refer
00003 to the COPYING file provided with the program. Following this notice may exist
00004 a copyright and/or license notice that predates the release of Scribus 1.3.2
00005 for which a new license (GPL+exception) is in place.
00006 */
00007 
00008 #ifndef COLORWHEELWIDGET_H
00009 #define COLORWHEELWIDGET_H
00010 
00011 #include <qlabel.h>
00012 #include <qvaluevector.h>
00013 #include <scribusstructs.h>
00014 
00015 #include "sccolor.h"
00016 
00017 class ScribusDoc;
00018 
00020 typedef QMap<int,ScColor> ColorMap;
00021 
00029 class ColorWheel : public QLabel
00030 {
00031        Q_OBJECT
00032 
00033        public:
00034               ColorWheel(QWidget * parent, const char * name = 0);
00035               ~ColorWheel(){};
00036 
00038               enum MethodType {
00039                      Monochromatic,
00040                      Analogous,
00041                      Complementary,
00042                      Split,
00043                      Triadic,
00044                      Tetradic
00045               };
00046 
00047               ScribusDoc* currentDoc;
00048 
00050               QString trBaseColor;
00051 
00053               colorModel currentColorSpace;
00054 
00056               MethodType currentType;
00057 
00063               int angle;
00064 
00066               int baseAngle;
00067 
00069               ScColor actualColor;
00070 
00073               ColorList colorList;
00074 
00078               QString getTypeDescription(MethodType aType);
00079 
00085               ScColor colorByAngle(int angle);
00086 
00088               void makeColors();
00089 
00094               bool recomputeColor(ScColor col);
00095 
00096        signals:
00100               void clicked(int button, const QPoint & point);
00101 
00102        protected:
00106               ColorMap colorMap;
00107 
00111               int angleShift;
00112 
00115               int widthH;
00116               int heightH;
00117 
00121               void mouseReleaseEvent(QMouseEvent *e);
00125               void mousePressEvent(QMouseEvent *e);
00129               void mouseMoveEvent(QMouseEvent *e);
00132               void paintEvent(QPaintEvent *);
00133 
00138               void makeMonochromatic();
00139 
00143               void makeAnalogous();
00144 
00148               void makeComplementary();
00149 
00153               void makeSplit();
00154 
00157               void makeTriadic();
00158 
00161               void makeTetradic();
00162 
00164               void paintCenterSample();
00166               void paintWheel();
00167 
00173               ScColor sampleByAngle(int angle);
00174 
00176               void baseColor();
00177 
00182               ScColor colorSpaceColor(ScColor col);
00183 
00191               void drawBorderPoint(int angle, bool base=false, bool clear=false);
00192 
00195               void clearBorder();
00196 
00201               int valueFromPoint(const QPoint & p) const;
00202 };
00203 
00204 #endif
00205