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

Plasma

  • sources
  • kde-4.12
  • kdelibs
  • plasma
popupapplet.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008 by Montel Laurent <montel@kde.org>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 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  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor,
17  * Boston, MA 02110-1301 USA
18  */
19 
20 #ifndef PLASMA_POPUPAPPLET_H
21 #define PLASMA_POPUPAPPLET_H
22 
23 #include <plasma/applet.h>
24 #include <plasma/plasma_export.h>
25 #include <plasma/plasma.h>
26 
27 class QGraphicsProxyWidget;
28 class QGraphicsLinearLayout;
29 
30 namespace Plasma
31 {
32 
33 class Dialog;
34 class IconWidget;
35 class PopupAppletPrivate;
36 
52 class PLASMA_EXPORT PopupApplet : public Plasma::Applet
53 {
54  Q_OBJECT
55  Q_PROPERTY(Qt::AlignmentFlag popupAlignment READ popupAlignment WRITE setPopupAlignment)
56 
57 public:
58  PopupApplet(QObject *parent, const QVariantList &args);
59  ~PopupApplet();
60 
67  void setPopupIcon(const QIcon &icon);
68 
78  void setPopupIcon(const QString &iconName);
79 
83  QIcon popupIcon() const;
84 
90  virtual QWidget *widget();
91  void setWidget(QWidget * widget);
92 
100  virtual QGraphicsWidget *graphicsWidget();
101  void setGraphicsWidget(QGraphicsWidget * widget);
102 
106  Plasma::PopupPlacement popupPlacement() const;
107 
113  void setPopupAlignment(Qt::AlignmentFlag alignment);
114 
119  Qt::AlignmentFlag popupAlignment() const;
120 
127  void setPassivePopup(bool passive);
128 
132  bool isPassivePopup() const;
133 
137  bool isPopupShowing() const;
138 
143  bool isIconified() const;
144 
145 
146 public Q_SLOTS:
150  void hidePopup();
151 
157  void showPopup(uint displayTime = 0);
158 
162  void togglePopup();
163 
164 protected:
172  virtual void popupEvent(bool show);
173 
177  QSizeF sizeHint(Qt::SizeHint which, const QSizeF & constraint = QSizeF()) const;
178 
182  void mousePressEvent(QGraphicsSceneMouseEvent *event);
183 
187  void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
188 
192  bool eventFilter(QObject *watched, QEvent *event);
193 
197  void dragEnterEvent(QGraphicsSceneDragDropEvent *event);
198 
202  void dragLeaveEvent(QGraphicsSceneDragDropEvent *event);
203 
207  void dropEvent(QGraphicsSceneDragDropEvent *event);
208 
212  void timerEvent(QTimerEvent *event);
213 
214 private:
223  PopupApplet(const QString &packagePath, uint appletId, const QVariantList &args);
224 
225  Q_PRIVATE_SLOT(d, void internalTogglePopup())
226  Q_PRIVATE_SLOT(d, void hideTimedPopup())
227  Q_PRIVATE_SLOT(d, void clearPopupLostFocus())
228  Q_PRIVATE_SLOT(d, void dialogSizeChanged())
229  Q_PRIVATE_SLOT(d, void dialogStatusChanged(bool))
230  Q_PRIVATE_SLOT(d, void updateDialogPosition())
231  Q_PRIVATE_SLOT(d, void appletActivated())
232  Q_PRIVATE_SLOT(d, void iconSizeChanged(int))
233  Q_PRIVATE_SLOT(d, void statusChangeWhileShown(Plasma::ItemStatus status))
234 
235  friend class Applet;
236  friend class AppletPrivate;
237  friend class Extender;
238  friend class PopupAppletPrivate;
239  PopupAppletPrivate * const d;
240 };
241 
242 } // Plasma namespace
243 
244 #endif /* POPUPAPPLET_H */
245 
Plasma::Extender
Extends applets to allow detachable parts.
Definition: extender.h:65
QWidget
QObject
Plasma::Applet
The base Applet class.
Definition: applet.h:77
Plasma::PopupPlacement
PopupPlacement
The popup position enumeration relatively to his attached widget.
Definition: plasma.h:137
Plasma::PopupApplet
Allows applets to automatically 'collapse' into an icon when put in an panel, and is a convenient bas...
Definition: popupapplet.h:52
applet.h
QGraphicsProxyWidget
plasma.h
IconWidget
Provides a generic icon.
Definition: iconwidget.h:37
Plasma::ItemStatus
ItemStatus
Status of an applet.
Definition: plasma.h:256
plasma_export.h
QGraphicsWidget
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:48:33 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Plasma

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

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

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