Warning, file /office/calligra/libs/widgets/KoTriangleColorSelector.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*
0002  *  Copyright (c) 2008 Cyrille Berger <cberger@cberger.net>
0003  *
0004  *  This library is free software; you can redistribute it and/or modify
0005  *  it under the terms of the GNU Lesser General Public License as published by
0006  *  the Free Software Foundation; either version 2.1 of the License,
0007  *  or (at your option) any later version.
0008  *
0009  *  This library is distributed in the hope that it will be useful,
0010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
0011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0012  *  GNU Lesser General Public License for more details.
0013  *
0014  *  You should have received a copy of the GNU Lesser General Public License
0015  *  along with this program; if not, write to the Free Software
0016  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
0017  */
0018 
0019 #ifndef _KO_TRIANGLE_COLOR_SELECTOR_H_
0020 #define _KO_TRIANGLE_COLOR_SELECTOR_H_
0021 
0022 #include <QWidget>
0023 
0024 #include "kowidgets_export.h"
0025 
0026 class KoColor;
0027 class KoColorDisplayRendererInterface;
0028 
0029 
0030 class KOWIDGETS_EXPORT KoTriangleColorSelector : public QWidget {
0031     Q_OBJECT
0032     public:
0033         explicit KoTriangleColorSelector(QWidget *parent);
0034         explicit KoTriangleColorSelector(const KoColorDisplayRendererInterface *displayRenderer, QWidget *parent);
0035         ~KoTriangleColorSelector() override;
0036     protected: // events
0037         void paintEvent( QPaintEvent * event ) override;
0038         void resizeEvent( QResizeEvent * event ) override;
0039         void mouseReleaseEvent( QMouseEvent * event ) override;
0040         void mousePressEvent( QMouseEvent * event ) override;
0041         void mouseMoveEvent( QMouseEvent * event ) override;
0042     public:
0043         int hue() const;
0044         int value() const;
0045         int saturation() const;
0046         KoColor color() const;
0047 
0048     public Q_SLOTS:
0049         void setHue(int h);
0050         void setValue(int v);
0051         void setSaturation(int s);
0052         void setHSV(int h, int s, int v);
0053 
0054         void setColor(const KoColor& );
0055 
0056     Q_SIGNALS:
0057         void colorChanged(const KoColor& );
0058 
0059     private Q_SLOTS:
0060         void configurationChanged();
0061     private:
0062         void tellColorChanged();
0063         void generateTriangle();
0064         void generateWheel();
0065         void updateTriangleCircleParameters();
0066         void selectColorAt(int x, int y, bool checkInWheel = true);
0067     private:
0068         struct Private;
0069         Private* const d;
0070 };
0071 
0072 #endif