Plasma
dialog.h
Go to the documentation of this file.
00001 /* 00002 * Copyright 2008 by Alessandro Diaferia <alediaferia@gmail.com> 00003 * Copyright 2007 by Alexis Ménard <darktears31@gmail.com> 00004 * Copyright 2007 Sebastian Kuegler <sebas@kde.org> 00005 * Copyright 2006 Aaron Seigo <aseigo@kde.org> 00006 * 00007 * This library is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Lesser General Public 00009 * License as published by the Free Software Foundation; either 00010 * version 2.1 of the License, or (at your option) any later version. 00011 * 00012 * This library is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 * Lesser General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Lesser General Public 00018 * License along with this library; if not, write to the Free Software 00019 * Foundation, Inc., 51 Franklin St, Fifth Floor, 00020 * Boston, MA 02110-1301 USA 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 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 00082 void setGraphicsWidget(QGraphicsWidget *widget); 00083 00087 QGraphicsWidget *graphicsWidget(); 00088 00092 void setResizeHandleCorners(ResizeCorners corners); 00093 00098 ResizeCorners resizeCorners() const; 00099 00105 void animatedHide(Plasma::Direction direction); 00106 00112 void animatedShow(Plasma::Direction direction); 00113 00118 Plasma::AspectRatioMode aspectRatioMode() const; 00119 00124 void setAspectRatioMode(Plasma::AspectRatioMode mode); 00125 00126 Q_SIGNALS: 00130 void dialogResized(); 00131 00135 void dialogVisible(bool status); 00136 00137 public Q_SLOTS: 00146 void syncToGraphicsWidget(); 00147 00148 protected: 00152 void paintEvent(QPaintEvent *e); 00153 bool event(QEvent *event); 00154 void resizeEvent(QResizeEvent *e); 00155 bool eventFilter(QObject *watched, QEvent *event); 00156 void hideEvent(QHideEvent *event); 00157 void showEvent(QShowEvent *event); 00158 void focusInEvent(QFocusEvent *event); 00159 void mouseMoveEvent(QMouseEvent *event); 00160 void mousePressEvent(QMouseEvent *event); 00161 void mouseReleaseEvent(QMouseEvent *event); 00162 void keyPressEvent(QKeyEvent *event); 00163 void moveEvent(QMoveEvent *event); 00164 00170 bool inControlArea(const QPoint &point); 00171 00172 private: 00173 DialogPrivate *const d; 00174 00175 friend class DialogPrivate; 00179 Q_PRIVATE_SLOT(d, void themeChanged()) 00180 Q_PRIVATE_SLOT(d, void checkBorders()) 00181 Q_PRIVATE_SLOT(d, void delayedAdjustSize()) 00182 00183 friend class PopupAppletPrivate; 00184 }; 00185 00186 } // Plasma namespace 00187 00188 Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::Dialog::ResizeCorners) 00189 00190 #endif
KDE 4.6 API Reference