~ubuntu-branches/ubuntu/gutsy/kdebase-workspace/gutsy

« back to all changes in this revision

Viewing changes to libs/plasma/widgets/pushbutton.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2007-10-11 14:04:48 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20071011140448-v0eb7lxbb24zagca
Tags: 3.94.0-0ubuntu1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 *   Copyright 2007 by Matt Broadstone <mbroadst@gmail.com>
5
5
 *
6
6
 *   This program is free software; you can redistribute it and/or modify
7
 
 *   it under the terms of the GNU Library General Public License version 2 as
8
 
 *   published by the Free Software Foundation
 
7
 *   it under the terms of the GNU Library General Public License as
 
8
 *   published by the Free Software Foundation; either version 2, or
 
9
 *   (at your option) any later version.
 
10
 
9
11
 *
10
12
 *   This program is distributed in the hope that it will be useful,
11
13
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
37
39
/**
38
40
 * Class that emulates a QPushButton inside Plasma
39
41
 *
40
 
 * @author Siraj Razick 
 
42
 * @author Siraj Razick
41
43
 * @author Matias Valdenegro
42
44
 * @author Matt Broadstone
43
45
 *
50
52
    Q_PROPERTY( QSizeF iconSize READ iconSize WRITE setIconSize )
51
53
    Q_PROPERTY( KIcon icon READ icon WRITE setIcon )
52
54
    Q_PROPERTY( bool flat READ isFlat WRITE setFlat )
 
55
    Q_PROPERTY( bool checkable READ isCheckable WRITE setCheckable )
 
56
    Q_PROPERTY( bool checked READ isChecked WRITE setChecked)
53
57
public:
54
58
    /**
55
59
    * Creates a new Plasma::PushButton.
134
138
    */
135
139
    void setFlat(bool flat);
136
140
 
 
141
    /**
 
142
    * @return whether this button is checkable.
 
143
    */
 
144
    bool isCheckable() const;
 
145
 
 
146
    /**
 
147
    * Sets whether the button is checkable.
 
148
    * @param checkable whether button is checkable or not.
 
149
    */
 
150
    void setCheckable(bool checkable);
 
151
 
 
152
    /**
 
153
    * @return whether this button is checked.
 
154
    */
 
155
    bool isChecked() const;
 
156
 
 
157
    /**
 
158
    * Sets whether the button is checked.
 
159
    * @param checked whether button is checked or not.
 
160
    */
 
161
    void setChecked(bool checked);
 
162
 
137
163
    // NOTE: bogus
138
164
    QSizeF minimumSize() const;
139
165
    Qt::Orientations expandingDirections() const;
145
171
    */
146
172
    void clicked();
147
173
 
 
174
    /**
 
175
    * Triggered when the checkable button has been toggled.
 
176
    */
 
177
    void toggled(bool checked);
 
178
 
148
179
protected:
149
180
    void mousePressEvent(QGraphicsSceneMouseEvent *event);
150
181
    void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);