Merge branch 'central-widget'
[krunner.git] / collapsiblewidget.h
blob6807b07018349a69a3e2caa2378176c626d56d42
1 /*
2 This file is part of the KDE libraries
3 Copyright (C) 2005 Daniel Molkentin <molkentin@kde.org>
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License version 2 as published by the Free Software Foundation.
9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Steet, Fifth Floor,
17 Boston, MA 02110-1301, USA.
20 #ifndef COLLAPSIBLEWIDGET_H
21 #define COLLAPSIBLEWIDGET_H
23 #include <QScrollArea>
24 #include <QLabel>
25 #include <QDebug>
27 class QScrollArea;
29 /**
30 @short A widget that has a caption and a collapsible widget
31 @author Daniel Molkentin <molkentin@kde.org>
33 class Q_GUI_EXPORT CollapsibleWidget : public QWidget
35 Q_OBJECT
36 public:
37 CollapsibleWidget( QWidget *parent = 0 );
38 ~CollapsibleWidget();
40 bool isExpanded() const;
42 QWidget* innerWidget() const;
43 void setInnerWidget( QWidget *w);
45 public slots:
46 void setExpanded(bool collapsed);
48 signals:
49 void expandCompleted();
50 void collapseCompleted();
52 protected:
53 void init();
55 private slots:
56 void animateCollapse(qreal);
57 void signalCompletion();
59 private:
60 Q_DISABLE_COPY( CollapsibleWidget )
61 class Private;
62 Private *d;
66 /**
67 @short A scrollable container that contains groups of settings,
68 usually in the form of CollapsibleWidgets.
69 @author Daniel Molkentin <molkentin@kde.org>
71 class Q_GUI_EXPORT SettingsContainer : public QScrollArea
73 Q_ENUMS( CollapseState )
74 Q_OBJECT
75 public:
76 enum CollapseState { Collapsed, Uncollapsed };
77 SettingsContainer( QWidget *parent = 0 );
78 ~SettingsContainer();
80 CollapsibleWidget* insertWidget( QWidget* w, const QString& name );
82 private:
83 Q_DISABLE_COPY( SettingsContainer )
84 class Private;
85 Private *d;
90 #endif // COLLAPSIBLEWIDGET_H