summaryrefslogtreecommitdiff
path: root/noncore/apps/tinykate/libkate/microkde/kcolorbtn.h
authorjowenn <jowenn>2002-11-10 21:08:01 (UTC)
committer jowenn <jowenn>2002-11-10 21:08:01 (UTC)
commite97a6da57804aa14907dec327fbae71bff9b383e (patch) (unidiff)
tree15f6ee292dba24bdda72f5c72f6d2224c3516763 /noncore/apps/tinykate/libkate/microkde/kcolorbtn.h
parent7c012ee8cd16d8befacc6f6750711443fac0fd5e (diff)
downloadopie-e97a6da57804aa14907dec327fbae71bff9b383e.zip
opie-e97a6da57804aa14907dec327fbae71bff9b383e.tar.gz
opie-e97a6da57804aa14907dec327fbae71bff9b383e.tar.bz2
import of tiny kate. (saving not possible yet)
Diffstat (limited to 'noncore/apps/tinykate/libkate/microkde/kcolorbtn.h') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/tinykate/libkate/microkde/kcolorbtn.h92
1 files changed, 92 insertions, 0 deletions
diff --git a/noncore/apps/tinykate/libkate/microkde/kcolorbtn.h b/noncore/apps/tinykate/libkate/microkde/kcolorbtn.h
new file mode 100644
index 0000000..b79d5e8
--- a/dev/null
+++ b/noncore/apps/tinykate/libkate/microkde/kcolorbtn.h
@@ -0,0 +1,92 @@
1/* This file is part of the KDE libraries
2 Copyright (C) 1997 Martin Jones (mjones@kde.org)
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 Boston, MA 02111-1307, USA.
18*/
19
20#ifndef __COLBTN_H__
21#define __COLBTN_H__
22
23#include <qpushbutton.h>
24
25/**
26* This widget can be used to display or allow user selection of a colour.
27*
28* @see KColorDialog
29*
30* @short A pushbutton to display or allow user selection of a colour.
31* @version $Id$
32*/
33class KColorButton : public QPushButton
34{
35 Q_OBJECT
36 Q_PROPERTY( QColor color READ color WRITE setColor )
37
38public:
39 /**
40 * Constructor. Create a KColorButton.
41 */
42 KColorButton( QWidget *parent, const char *name = 0L );
43 /**
44 * Constructor. Create a KColorButton.
45 * @param cThe initial colour of the button.
46 */
47 KColorButton( const QColor &c, QWidget *parent, const char *name = 0L );
48 /**
49 * Destructor.
50 */
51 virtual ~KColorButton() {}
52
53 /**
54 * The current colour.
55 * @return The current colour.
56 */
57 QColor color() const
58 {return col; }
59 /**
60 * Set the current colour.
61 *
62 * @param cThe colour to set.
63 */
64 void setColor( const QColor &c );
65
66signals:
67 /**
68 * This signal will be emitted when the colour of the widget
69 * is changed, either with @ref #setColor() or via user selection.
70 */
71 void changed( const QColor &newColor );
72
73protected slots:
74 void chooseColor();
75
76protected:
77 /**
78 * @reimplemented
79 */
80 virtual void drawButtonLabel( QPainter *p );
81
82private:
83 QColor col;
84 QPoint mPos;
85 bool dragFlag;
86
87 class KColorButtonPrivate;
88 KColorButtonPrivate *d;
89};
90
91#endif
92