00001 /*===========================================================================*\ 00002 * * 00003 * OpenFlipper * 00004 * Copyright (C) 2001-2009 by Computer Graphics Group, RWTH Aachen * 00005 * www.openflipper.org * 00006 * * 00007 *---------------------------------------------------------------------------* 00008 * This file is part of OpenFlipper. * 00009 * * 00010 * OpenFlipper is free software: you can redistribute it and/or modify * 00011 * it under the terms of the GNU Lesser General Public License as * 00012 * published by the Free Software Foundation, either version 3 of * 00013 * the License, or (at your option) any later version with the * 00014 * following exceptions: * 00015 * * 00016 * If other files instantiate templates or use macros * 00017 * or inline functions from this file, or you compile this file and * 00018 * link it with other files to produce an executable, this file does * 00019 * not by itself cause the resulting executable to be covered by the * 00020 * GNU Lesser General Public License. This exception does not however * 00021 * invalidate any other reasons why the executable file might be * 00022 * covered by the GNU Lesser General Public License. * 00023 * * 00024 * OpenFlipper is distributed in the hope that it will be useful, * 00025 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00026 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00027 * GNU Lesser General Public License for more details. * 00028 * * 00029 * You should have received a copy of the GNU LesserGeneral Public * 00030 * License along with OpenFlipper. If not, * 00031 * see <http://www.gnu.org/licenses/>. * 00032 * * 00033 \*===========================================================================*/ 00034 00035 /*===========================================================================*\ 00036 * * 00037 * $Revision: 6727 $ * 00038 * $Author: moebius $ * 00039 * $Date: 2009-08-05 08:03:50 +0200 (Mi, 05. Aug 2009) $ * 00040 * * 00041 \*===========================================================================*/ 00042 00043 #ifndef QT_SLIDE_WINDOW_ 00044 #define QT_SLIDE_WINDOW_ 00045 00046 //============================================================================= 00047 // 00048 // CLASS QtSlideWindow 00049 // 00050 //============================================================================= 00051 00052 //== INCLUDES ================================================================= 00053 00054 #include <QSettings> 00055 00056 #include <QGraphicsProxyWidget> 00057 #include <OpenFlipper/common/GlobalDefines.hh> 00058 00059 //== FORWARDDECLARATIONS ====================================================== 00060 00061 class QtGraphicsButton; 00062 class QTimeLine; 00063 class QGraphicsItemAnimation; 00064 00065 //== CLASS DEFINITION ========================================================= 00066 00067 00074 class DLLEXPORT QtSlideWindow : public QGraphicsProxyWidget 00075 { 00076 Q_OBJECT 00077 00078 public: 00083 QtSlideWindow (QString _name = 0, QGraphicsItem *_parent = 0); 00084 00086 void updateGeometry (); 00087 00089 void attachWidget (QWidget *_m); 00090 00092 void detachWidget (); 00093 00094 00096 void saveState (QSettings &_settings); 00097 00099 void restoreState (QSettings &_settings); 00100 00101 private: 00102 00104 virtual void paintWindowFrame(QPainter *_painter, const QStyleOptionGraphicsItem *_option, QWidget *_widget = 0); 00105 00107 virtual bool windowFrameEvent(QEvent *_e); 00108 00110 virtual Qt::WindowFrameSection windowFrameSectionAt(const QPointF &_pos) const; 00111 00113 virtual void hoverEnterEvent (QGraphicsSceneHoverEvent *_event); 00114 virtual void hoverLeaveEvent (QGraphicsSceneHoverEvent *_event); 00115 00117 virtual void resizeEvent (QGraphicsSceneResizeEvent *_event); 00118 virtual void moveEvent (QGraphicsSceneMoveEvent *_event); 00119 00120 private slots: 00122 void detachPressed (); 00123 00125 void dialogClosed (); 00126 00128 void autohidePressed (); 00129 00131 void timelineFinished (); 00132 00133 00134 private: 00135 00136 // name 00137 QString name_; 00138 00139 // child widget 00140 QWidget *mainWidget_; 00141 00142 // buttons 00143 QtGraphicsButton *autohideButton_; 00144 QtGraphicsButton *detachButton_; 00145 00146 // animation 00147 QTimeLine *hideTimeLine_; 00148 QGraphicsItemAnimation *hideAnimation_; 00149 00150 // detached dialog 00151 QDialog *dialog_; 00152 00153 // temporary widget 00154 QWidget *tempWidget_; 00155 }; 00156 00157 //============================================================================= 00158 //============================================================================= 00159 #endif // QT_SLIDE_WINDOW_ defined 00160 //============================================================================= 00161