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
00051 class PLASMA_EXPORT PopupApplet : public Plasma::Applet
00052 {
00053 Q_OBJECT
00054 public:
00055 PopupApplet(QObject *parent, const QVariantList &args);
00056 ~PopupApplet();
00057
00061 void setPopupIcon(const QIcon &icon);
00062
00066 void setPopupIcon(const QString &iconName);
00067
00071 QIcon popupIcon() const;
00072
00078 virtual QWidget *widget();
00079 void setWidget(QWidget * widget);
00080
00086 virtual QGraphicsWidget *graphicsWidget();
00087 void setGraphicsWidget(QGraphicsWidget * widget);
00088
00092 Plasma::PopupPlacement popupPlacement() const;
00093
00100 void setPassivePopup(bool passive);
00101
00105 bool isPassivePopup() const;
00106
00110 bool isPopupShowing() const;
00111
00112 public Q_SLOTS:
00116 void hidePopup();
00117
00123 void showPopup(uint displayTime = 0);
00124
00128 void togglePopup();
00129
00130 protected:
00138 virtual void popupEvent(bool show);
00139
00140 void mousePressEvent(QGraphicsSceneMouseEvent *event);
00141 void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
00142 bool eventFilter(QObject *watched, QEvent *event);
00143 void dragEnterEvent(QGraphicsSceneDragDropEvent *event);
00144 void dragLeaveEvent(QGraphicsSceneDragDropEvent *event);
00145 void dropEvent(QGraphicsSceneDragDropEvent *event);
00146
00147 private:
00148 Q_PRIVATE_SLOT(d, void internalTogglePopup())
00149 Q_PRIVATE_SLOT(d, void hideTimedPopup())
00150 Q_PRIVATE_SLOT(d, void clearPopupLostFocus())
00151 Q_PRIVATE_SLOT(d, void dialogSizeChanged())
00152 Q_PRIVATE_SLOT(d, void dialogStatusChanged(bool))
00153 Q_PRIVATE_SLOT(d, void updateDialogPosition())
00154
00155 friend class Applet;
00156 friend class PopupAppletPrivate;
00157 PopupAppletPrivate * const d;
00158 };
00159
00160 }
00161
00162 #endif
00163