kdgantt1
KDGanttSemiSizingControl.h
Go to the documentation of this file.00001 /* -*- Mode: C++ -*- 00002 $Id: KDGanttSemiSizingControl.h,v 1.4 2005/10/11 11:44:04 lutz Exp $ 00003 */ 00004 00005 /**************************************************************************** 00006 ** Copyright (C) 2002-2004 Klarälvdalens Datakonsult AB. All rights reserved. 00007 ** 00008 ** This file is part of the KDGantt library. 00009 ** 00010 ** This file may be used under the terms of the GNU General Public 00011 ** License versions 2.0 or 3.0 as published by the Free Software 00012 ** Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3 00013 ** included in the packaging of this file. Alternatively you may (at 00014 ** your option) use any later version of the GNU General Public 00015 ** License if such license has been publicly approved by 00016 ** Klarälvdalens Datakonsult AB (or its successors, if any). 00017 ** 00018 ** This file is provided "AS IS" with NO WARRANTY OF ANY KIND, 00019 ** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR 00020 ** A PARTICULAR PURPOSE. Klarälvdalens Datakonsult AB reserves all rights 00021 ** not expressly granted herein. 00022 ** 00023 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00024 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00025 ** 00026 ** As a special exception, permission is given to link this program 00027 ** with any edition of Qt, and distribute the resulting executable, 00028 ** without including the source code for Qt in the source distribution. 00029 ** 00030 **********************************************************************/ 00031 00032 00033 #ifndef KDGANTTSEMISIZINGCONTROL_H 00034 #define KDGANTTSEMISIZINGCONTROL_H 00035 00036 #include <QLayout> 00037 00038 #include "kdgantt_qt3_compat.h" 00039 00040 #include "KDGanttSizingControl.h" 00041 class QPushButton; 00042 class QBoxLayout; 00043 00044 class KDGanttSemiSizingControl : public KDGanttSizingControl 00045 { 00046 Q_PROPERTY( ArrowPosition arrowPosition READ arrowPosition WRITE setArrowPosition ) 00047 Q_ENUMS( ArrowPosition ) 00048 Q_OBJECT 00049 00050 public: 00051 enum ArrowPosition { Before, After }; 00052 00053 KDGanttSemiSizingControl( QWidget* parent = 0 ); 00054 KDGanttSemiSizingControl( Qt::Orientation orientation, QWidget* parent = 0 ); 00055 KDGanttSemiSizingControl( ArrowPosition arrowPosition, 00056 Qt::Orientation orientation, QWidget* parent = 0 ); 00057 00058 void setMinimizedWidget( QWidget* widget ); 00059 void setMaximizedWidget( QWidget* widget ); 00060 QWidget* minimizedWidget() const; 00061 QWidget* maximizedWidget() const; 00062 00063 void setOrientation( Qt::Orientation orientation ); 00064 Qt::Orientation orientation() const; 00065 00066 void setArrowPosition( ArrowPosition arrowPosition ); 00067 ArrowPosition arrowPosition() const; 00068 00069 public slots: 00070 virtual void minimize( bool minimize ); 00071 virtual void restore( bool restore ); 00072 00073 protected: 00074 void setup(); 00075 void init(); 00076 enum Direction {Left, Right, Up, Down }; 00077 QPixmap pixmap( Direction ); 00078 00079 private: 00080 Qt::Orientation _orient; 00081 ArrowPosition _arrowPos; 00082 QWidget* _minimizedWidget; 00083 QWidget* _maximizedWidget; 00084 QBoxLayout* _layout; 00085 QPushButton* _but; 00086 }; 00087 00088 00089 #endif 00090
KDE 4.2 API Reference