Plasma
popupapplet.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef PLASMA_POPUPAPPLET_H
00021 #define PLASMA_POPUPAPPLET_H
00022
00023 #include <plasma/applet.h>
00024 #include <plasma/plasma_export.h>
00025
00026 class QGraphicsProxyWidget;
00027 class QGraphicsLinearLayout;
00028
00029 namespace Plasma
00030 {
00031
00032 class Dialog;
00033 class IconWidget;
00034 class PopupAppletPrivate;
00035
00049 class PLASMA_EXPORT PopupApplet : public Plasma::Applet
00050 {
00051 Q_OBJECT
00052 public:
00053 PopupApplet(QObject *parent, const QVariantList &args);
00054 ~PopupApplet();
00055
00059 void setPopupIcon(const QIcon &icon);
00060
00064 void setPopupIcon(const QString &iconName);
00065
00069 QIcon popupIcon() const;
00070
00076 virtual QWidget *widget();
00077
00083 virtual QGraphicsWidget *graphicsWidget();
00084
00088 Plasma::PopupPlacement popupPlacement() const;
00089
00096 void setPassivePopup(bool passive);
00097
00101 bool isPassivePopup() const;
00102
00106 bool isPopupShowing() const;
00107
00108 public Q_SLOTS:
00112 void hidePopup();
00113
00119 void showPopup(uint displayTime = 0);
00120
00124 void togglePopup();
00125
00126 protected:
00134 virtual void popupEvent(bool show);
00135
00136 void mousePressEvent(QGraphicsSceneMouseEvent *event);
00137 void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
00138 bool eventFilter(QObject *watched, QEvent *event);
00139
00140 private:
00141 Q_PRIVATE_SLOT(d, void internalTogglePopup())
00142 Q_PRIVATE_SLOT(d, void hideTimedPopup())
00143 Q_PRIVATE_SLOT(d, void clearPopupLostFocus())
00144 Q_PRIVATE_SLOT(d, void dialogSizeChanged())
00145 Q_PRIVATE_SLOT(d, void dialogStatusChanged(bool))
00146
00147 friend class Applet;
00148 friend class PopupAppletPrivate;
00149 PopupAppletPrivate * const d;
00150 };
00151
00152 }
00153
00154 #endif
00155