KDGanttSemiSizingControl.h
00001 /* -*- Mode: C++ -*- 00002 $Id$ 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 distributed and/or modified under the terms of the 00011 ** GNU General Public License version 2 as published by the Free Software 00012 ** Foundation and appearing in the file LICENSE.GPL included in the 00013 ** packaging of this file. 00014 ** 00015 ** Licensees holding valid commercial KDGantt licenses may use this file in 00016 ** accordance with the KDGantt Commercial License Agreement provided with 00017 ** the Software. 00018 ** 00019 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00020 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00021 ** 00022 ** See http://www.klaralvdalens-datakonsult.se/Public/products/ for 00023 ** information about KDGantt Commercial License Agreements. 00024 ** 00025 ** Contact info@klaralvdalens-datakonsult.se if any conditions of this 00026 ** licensing are not clear to you. 00027 ** 00028 ** As a special exception, permission is given to link this program 00029 ** with any edition of TQt, and distribute the resulting executable, 00030 ** without including the source code for TQt in the source distribution. 00031 ** 00032 **********************************************************************/ 00033 00034 00035 #ifndef KDGANTTSEMISIZINGCONTROL_H 00036 #define KDGANTTSEMISIZINGCONTROL_H 00037 00038 #include "KDGanttSizingControl.h" 00039 #include <tqlayout.h> 00040 class TQPushButton; 00041 class TQBoxLayout; 00042 00043 class KDGanttSemiSizingControl : public KDGanttSizingControl 00044 { 00045 TQ_PROPERTY( ArrowPosition arrowPosition READ arrowPosition WRITE setArrowPosition ) 00046 TQ_ENUMS( ArrowPosition ) 00047 Q_OBJECT 00048 00049 00050 public: 00051 enum ArrowPosition { Before, After }; 00052 00053 KDGanttSemiSizingControl( TQWidget* parent = 0, const char* name = 0 ); 00054 KDGanttSemiSizingControl( Qt::Orientation orientation, TQWidget* parent = 0, 00055 const char* name = 0 ); 00056 KDGanttSemiSizingControl( ArrowPosition arrowPosition, 00057 Qt::Orientation orientation, TQWidget* parent = 0, 00058 const char* name = 0 ); 00059 00060 void setMinimizedWidget( TQWidget* widget ); 00061 void setMaximizedWidget( TQWidget* widget ); 00062 TQWidget* minimizedWidget() const; 00063 TQWidget* maximizedWidget() const; 00064 00065 void setOrientation( Qt::Orientation orientation ); 00066 Qt::Orientation orientation() const; 00067 00068 void setArrowPosition( ArrowPosition arrowPosition ); 00069 ArrowPosition arrowPosition() const; 00070 00071 public slots: 00072 virtual void minimize( bool minimize ); 00073 virtual void restore( bool restore ); 00074 00075 protected: 00076 void setup(); 00077 void init(); 00078 enum Direction {Left, Right, Up, Down }; 00079 TQPixmap pixmap( Direction ); 00080 00081 private: 00082 Qt::Orientation _orient; 00083 ArrowPosition _arrowPos; 00084 TQWidget* _minimizedWidget; 00085 TQWidget* _maximizedWidget; 00086 TQBoxLayout* _layout; 00087 TQPushButton* _but; 00088 }; 00089 00090 00091 #endif