• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • workspace API Reference
  • KDE Home
  • Contact Us
 

liblancelot

  • sources
  • kde-4.14
  • workspace
  • kdeplasma-addons
  • libs
  • lancelot
  • widgets
ExtenderButton.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2007, 2008, 2009, 2010 Ivan Cukic <ivan.cukic(at)kde.org>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser/Library General Public License version 2,
6  * or (at your option) any later version, as published by the Free
7  * Software Foundation
8  *
9  * This program 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
12  * GNU Lesser/Library General Public License for more details
13  *
14  * You should have received a copy of the GNU Lesser/Library General Public
15  * License along with this program; if not, write to the
16  * Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  */
19 
20 #ifndef LANCELOT_EXTENDER_BUTTON_H
21 #define LANCELOT_EXTENDER_BUTTON_H
22 
23 #include <lancelot/lancelot.h>
24 #include <lancelot/lancelot_export.h>
25 #include <lancelot/widgets/BasicWidget.h>
26 #include <lancelot/widgets/Widget.h>
27 
28 #define EXTENDER_SIZE 20
29 
30 namespace Lancelot
31 {
32 
39 class LANCELOT_EXPORT ExtenderButton : public Lancelot::BasicWidget
40 {
41  Q_OBJECT
42 
43  /* type: ExtenderPosition */
44  Q_PROPERTY ( int extenderPosition READ extenderPosition WRITE setExtenderPosition )
45  /* type: ActivationMethod */
46  Q_PROPERTY ( int activationMethod READ activationMethod WRITE setActivationMethod )
47  Q_PROPERTY ( bool checkable READ isCheckable WRITE setCheckable )
48  Q_PROPERTY ( bool checked READ isChecked WRITE setChecked )
49 
50  // @puck L_WIDGET
51  // @puck L_INCLUDE(lancelot/widgets/ExtenderButton.h lancelot/lancelot.h)
52 
53 public:
58  ExtenderButton(QGraphicsItem * parent = 0);
59 
66  explicit ExtenderButton(QString title, QString description = QString(),
67  QGraphicsItem * parent = 0);
68 
76  explicit ExtenderButton(QIcon icon, QString title = QString(),
77  QString description = QString(), QGraphicsItem * parent = 0);
78 
86  explicit ExtenderButton(const Plasma::Svg & icon, QString title = QString(),
87  QString description = QString(), QGraphicsItem * parent = 0);
88 
92  virtual ~ExtenderButton();
93 
98  void setExtenderPosition(int position);
99 
103  int extenderPosition() const;
104 
109  void setActivationMethod(int method);
110 
114  int activationMethod() const;
115 
120  void setCheckable(bool checkable);
121 
125  bool isCheckable() const;
126 
130  bool isChecked() const;
131 
132  L_Override void setGroup(Group * group = NULL);
133 
134  L_Override QRectF boundingRect() const;
135 
136  L_Override void paint(QPainter * painter,
137  const QStyleOptionGraphicsItem * option, QWidget * widget = 0);
138  L_Override void setShortcutKey(const QString & key);
139 
140 public Q_SLOTS:
146  void setChecked(bool checked);
147 
152  void toggle();
153 
154 Q_SIGNALS:
159  void activated();
160 
165  void toggled(bool checked);
166 
167 protected:
168  L_Override void hoverEnterEvent(QGraphicsSceneHoverEvent * event);
169  L_Override void hoverLeaveEvent(QGraphicsSceneHoverEvent * event);
170  L_Override void resizeEvent(QGraphicsSceneResizeEvent * event);
171  L_Override void hideEvent(QHideEvent * event);
172 
173 protected Q_SLOTS:
174  void activate();
175 
176 private:
177  class Private;
178  Private * const d;
179 
180  friend class ExtenderObject;
181 };
182 
183 } // namespace Lancelot
184 
185 #endif /* LANCELOT_EXTENDER_BUTTON_H */
186 
QHideEvent
Lancelot::BasicWidget
Provides a common appearance with an icon, title and a description.
Definition: BasicWidget.h:44
QWidget
BasicWidget.h
QGraphicsItem
L_Override
#define L_Override
Definition: lancelot_export.h:41
lancelot_export.h
QPainter
Lancelot::Group
Represents a group of object.
Definition: Global.h:63
LANCELOT_EXPORT
#define LANCELOT_EXPORT
Definition: lancelot_export.h:32
QString
QGraphicsSceneResizeEvent
QGraphicsSceneHoverEvent
Widget.h
QRectF
lancelot.h
QStyleOptionGraphicsItem
Lancelot::ExtenderButton
Button widget with special activation options beside clicking - hover and extender activation...
Definition: ExtenderButton.h:39
QIcon
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:43:01 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

liblancelot

Skip menu "liblancelot"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

workspace API Reference

Skip menu "workspace API Reference"
  • kdeplasma-addons
  •       GroupingDesktop
  •     liblancelot

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal