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
00032 namespace Plasma
00033 {
00034
00035 class DialogPrivate;
00036
00050 class PLASMA_EXPORT Dialog : public QWidget
00051 {
00052 Q_OBJECT
00053
00054 public:
00058 enum ResizeCorner {
00059 NoCorner = 0,
00060 NorthEast = 1,
00061 SouthEast = 2,
00062 NorthWest = 4,
00063 SouthWest = 8,
00064 All = NorthEast | SouthEast | NorthWest | SouthWest
00065 };
00066 Q_DECLARE_FLAGS(ResizeCorners, ResizeCorner)
00067
00068
00072 explicit Dialog(QWidget * parent = 0, Qt::WindowFlags f = Qt::Window);
00073 virtual ~Dialog();
00074
00075 void setGraphicsWidget(QGraphicsWidget *widget);
00076 QGraphicsWidget *graphicsWidget();
00077
00081 void setResizeHandleCorners(ResizeCorners corners);
00082
00087 ResizeCorners resizeCorners() const;
00088
00089 Q_SIGNALS:
00093 void dialogResized();
00094
00098 void dialogVisible(bool status);
00099
00100 protected:
00104 void paintEvent(QPaintEvent *e);
00105 bool event(QEvent *event);
00106 void resizeEvent(QResizeEvent *e);
00107 bool eventFilter(QObject *watched, QEvent *event);
00108 void hideEvent(QHideEvent *event);
00109 void showEvent(QShowEvent *event);
00110 void mouseMoveEvent(QMouseEvent *event);
00111 void mousePressEvent(QMouseEvent *event);
00112 void mouseReleaseEvent(QMouseEvent *event);
00113 void keyPressEvent(QKeyEvent *event);
00114
00120 bool inControlArea(const QPoint &point);
00121
00122 private:
00123 DialogPrivate *const d;
00124
00125 friend class DialogPrivate;
00129 Q_PRIVATE_SLOT(d, void themeUpdated())
00130 };
00131
00132 }
00133
00134 Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::Dialog::ResizeCorners)
00135
00136 #endif