Plasma
dialog.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
00021
00022
00023 #ifndef PLASMA_DIALOG_H
00024 #define PLASMA_DIALOG_H
00025
00026 #include <QtGui/QWidget>
00027 #include <QtGui/QGraphicsSceneEvent>
00028 #include <QtGui/QGraphicsView>
00029
00030 #include <plasma/plasma_export.h>
00031 #include <plasma/plasma.h>
00032
00033 namespace Plasma
00034 {
00035
00036 class DialogPrivate;
00037
00051 class PLASMA_EXPORT Dialog : public QWidget
00052 {
00053 Q_OBJECT
00054
00055 public:
00059 enum ResizeCorner {
00060 NoCorner = 0,
00061 NorthEast = 1,
00062 SouthEast = 2,
00063 NorthWest = 4,
00064 SouthWest = 8,
00065 All = NorthEast | SouthEast | NorthWest | SouthWest
00066 };
00067 Q_DECLARE_FLAGS(ResizeCorners, ResizeCorner)
00068
00069
00073 explicit Dialog(QWidget * parent = 0, Qt::WindowFlags f = Qt::Window);
00074 virtual ~Dialog();
00075
00076 void setGraphicsWidget(QGraphicsWidget *widget);
00077 QGraphicsWidget *graphicsWidget();
00078
00082 void setResizeHandleCorners(ResizeCorners corners);
00083
00088 ResizeCorners resizeCorners() const;
00089
00094 void animatedHide(Plasma::Direction direction);
00095
00100 void animatedShow(Plasma::Direction direction);
00101
00102 Q_SIGNALS:
00106 void dialogResized();
00107
00111 void dialogVisible(bool status);
00112
00113 protected:
00117 void paintEvent(QPaintEvent *e);
00118 bool event(QEvent *event);
00119 void resizeEvent(QResizeEvent *e);
00120 bool eventFilter(QObject *watched, QEvent *event);
00121 void hideEvent(QHideEvent *event);
00122 void showEvent(QShowEvent *event);
00123 void mouseMoveEvent(QMouseEvent *event);
00124 void mousePressEvent(QMouseEvent *event);
00125 void mouseReleaseEvent(QMouseEvent *event);
00126 void keyPressEvent(QKeyEvent *event);
00127 void moveEvent(QMoveEvent *event);
00128
00134 bool inControlArea(const QPoint &point);
00135
00136 private:
00137 DialogPrivate *const d;
00138
00139 friend class DialogPrivate;
00143 Q_PRIVATE_SLOT(d, void themeChanged())
00144 Q_PRIVATE_SLOT(d, void progressHide(qreal))
00145 Q_PRIVATE_SLOT(d, void progressShow(qreal))
00146 };
00147
00148 }
00149
00150 Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::Dialog::ResizeCorners)
00151
00152 #endif