~ubuntu-branches/ubuntu/precise/koffice/precise

« back to all changes in this revision

Viewing changes to krita/plugins/extensions/dockers/colorselectorng/kis_shade_selector_line.h

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2010-10-27 17:52:57 UTC
  • mfrom: (0.12.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20101027175257-s04zqqk5bs8ckm9o
Tags: 1:2.2.83-0ubuntu1
* Merge with Debian git remaining changes:
 - Add build-deps on librcps-dev, opengtl-dev, libqtgtl-dev, freetds-dev,
   create-resources, libspnav-dev
 - Remove needless build-dep on libwv2-dev
 - koffice-libs recommends create-resources
 - krita recommends pstoedit
 - Keep our patches
* New upstream release 2.3 beta 3
  - Remove debian/patches fixed by upstream
  - Update install files

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  Copyright (c) 2010 Adam Celarek <kdedev at xibo dot at>
 
3
 *
 
4
 *  This program is free software; you can redistribute it and/or modify
 
5
 *  it under the terms of the GNU Lesser General Public License as published by
 
6
 *  the Free Software Foundation; version 2 of the License.
 
7
 *
 
8
 *  This program is distributed in the hope that it will be useful,
 
9
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
11
 *  GNU General Public License for more details.
 
12
 *
 
13
 *  You should have received a copy of the GNU Lesser General Public License
 
14
 *  along with this program; if not, write to the Free Software
 
15
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
16
 */
 
17
 
 
18
#ifndef KIS_SHADE_SELECTOR_LINE_H
 
19
#define KIS_SHADE_SELECTOR_LINE_H
 
20
 
 
21
#include <QWidget>
 
22
 
 
23
class KisCanvas2;
 
24
class KisShadeSelectorLineComboBox;
 
25
 
 
26
class KisShadeSelectorLineBase : public QWidget {
 
27
public:
 
28
    KisShadeSelectorLineBase(QWidget *parent = 0) : QWidget(parent)
 
29
    {}
 
30
 
 
31
    void setLineNumber(int n) {m_lineNumber=n;}
 
32
    virtual QString toString() const = 0;
 
33
    virtual void fromString(const QString& string) = 0;
 
34
 
 
35
protected:
 
36
    int m_lineNumber;
 
37
};
 
38
 
 
39
class KisShadeSelectorLine : public KisShadeSelectorLineBase
 
40
{
 
41
    Q_OBJECT
 
42
public:
 
43
    explicit KisShadeSelectorLine(QWidget *parent = 0);
 
44
    explicit KisShadeSelectorLine(qreal hueDelta, qreal satDelta, qreal valDelta, QWidget *parent = 0, qreal hueShift = 0, qreal satShift = 0, qreal shiftVal = 0);
 
45
    void setParam(qreal hue, qreal sat, qreal val, qreal hueShift, qreal satShift, qreal shiftVal);
 
46
    void setColor(const QColor& color);
 
47
    void updateSettings();
 
48
    void setCanvas(KisCanvas2* canvas);
 
49
    void showHelpText() {m_displayHelpText=true;}
 
50
    QString toString() const;
 
51
    void fromString(const QString& string);
 
52
 
 
53
protected:
 
54
    void paintEvent(QPaintEvent *);
 
55
    void mousePressEvent(QMouseEvent *);
 
56
 
 
57
private:
 
58
    qreal m_hueDelta;
 
59
    qreal m_saturationDelta;
 
60
    qreal m_valueDelta;
 
61
 
 
62
    qreal m_hueShift;
 
63
    qreal m_saturationShift;
 
64
    qreal m_valueShift;
 
65
 
 
66
    QColor m_color;
 
67
    QColor m_backgroundColor;
 
68
 
 
69
    QImage m_pixelCache;
 
70
 
 
71
    bool m_gradient;
 
72
    int m_patchCount;
 
73
    int m_lineHeight;
 
74
    bool m_displayHelpText;
 
75
 
 
76
    friend class KisShadeSelectorLineComboBox;
 
77
};
 
78
 
 
79
#endif // KIS_SHADE_SELECTOR_LINE_H