lib

koFrameButton.h
1/* This file is part of the KDE project
2 Copyright (c) 1999 Matthias Elter (me@kde.org)
3 Copyright (c) 2001 Igor Jansen (rm@kde.org)
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19*/
20
21#ifndef __ko_framebutton_h__
22#define __ko_framebutton_h__
23
24#include <tqlabel.h>
25
26class TQPixmap;
27class TQString;
28
29class KoFrameButton : public TQLabel
30{
31 TQ_OBJECT
32
33public:
34 KoFrameButton(TQWidget *parent = 0, const char *name = 0);
35 KoFrameButton(const TQString &text, TQWidget *parent = 0, const char *name = 0);
36 KoFrameButton(const TQPixmap &pixmap, TQWidget *parent = 0, const char *name = 0);
37
38 bool isOn() {return mActive; }
39 void setOn(bool v);
40
41 bool isToggleButton() {return mToggle; }
42 void setToggleButton(bool v);
43
44 TQString text() {return mText; }
45 virtual void setText(const TQString &t);
46
47signals:
48 void clicked();
49 void clicked(const TQString &);
50
51protected:
52 void mousePressEvent(TQMouseEvent *);
53 void mouseReleaseEvent(TQMouseEvent *);
54
55private:
56 bool mActive;
57 bool mToggle;
58 TQString mText;
59};
60
61#endif