kdgantt

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 Qt, and distribute the resulting executable,
00030  ** without including the source code for Qt in the source distribution.
00031  **
00032  **********************************************************************/
00033 
00034 
00035 #ifndef KDGANTTSEMISIZINGCONTROL_H
00036 #define KDGANTTSEMISIZINGCONTROL_H
00037 
00038 #include "KDGanttSizingControl.h"
00039 #include <qlayout.h>
00040 class QPushButton;
00041 class QBoxLayout;
00042 
00043 class KDGanttSemiSizingControl : public KDGanttSizingControl
00044 {
00045     Q_PROPERTY( ArrowPosition arrowPosition READ arrowPosition WRITE setArrowPosition )
00046     Q_ENUMS( ArrowPosition )
00047     Q_OBJECT
00048 
00049 public:
00050     enum ArrowPosition { Before, After };
00051 
00052     KDGanttSemiSizingControl( QWidget* parent = 0, const char* name = 0 );
00053     KDGanttSemiSizingControl( Orientation orientation, QWidget* parent = 0,
00054                            const char* name = 0 );
00055     KDGanttSemiSizingControl( ArrowPosition arrowPosition,
00056                          Orientation orientation, QWidget* parent = 0,
00057                          const char* name = 0 );
00058 
00059     void setMinimizedWidget( QWidget* widget );
00060     void setMaximizedWidget( QWidget* widget );
00061     QWidget* minimizedWidget() const;
00062     QWidget* maximizedWidget() const;
00063 
00064     void setOrientation( Qt::Orientation orientation );
00065     Qt::Orientation orientation() const;
00066 
00067     void setArrowPosition( ArrowPosition arrowPosition );
00068     ArrowPosition arrowPosition() const;
00069 
00070 public slots:
00071     virtual void minimize( bool minimize );
00072     virtual void restore( bool restore );
00073 
00074 protected:
00075     void setup();
00076     void init();
00077     enum Direction {Left, Right, Up, Down };
00078     QPixmap pixmap( Direction );
00079 
00080 private:
00081     Orientation _orient;
00082     ArrowPosition _arrowPos;
00083     QWidget* _minimizedWidget;
00084     QWidget* _maximizedWidget;
00085     QBoxLayout* _layout;
00086     QPushButton* _but;
00087 };
00088 
00089 
00090 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys