Show invite menu in wlm chat window immediately
[kdenetwork.git] / kopete / libkopete / ui / collapsiblewidget.h
blobc2caca6e5b2f879e325e3c3b0370a5f31529eeea
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 Street, Fifth Floor,
17 Boston, MA 02110-1301, USA.
21 * file copied from playground/libs/ui/collabsiblewidget
23 #ifndef COLLAPSIBLEWIDGET_H
24 #define COLLAPSIBLEWIDGET_H
26 #include <QScrollArea>
27 #include <QLabel>
28 #include <QDebug>
29 #include <QAbstractButton>
30 #include <kopete_export.h>
32 class QScrollArea;
34 class ClickableLabel : public QLabel
36 Q_OBJECT
37 public:
38 ClickableLabel( QWidget* parent = 0 );
39 ~ClickableLabel();
41 void mouseReleaseEvent( QMouseEvent *e );
43 signals:
44 void clicked();
47 class ArrowButton : public QAbstractButton
49 public:
50 ArrowButton(QWidget *parent = 0);
51 ~ArrowButton();
53 QSize sizeHint() const { return QSize(16, 16); }
55 protected:
56 void paintEvent( QPaintEvent* );
58 private:
61 /**
62 @short A widget that has a caption and a collapsible widget
63 @author Daniel Molkentin <molkentin@kde.org>
65 class KOPETE_EXPORT CollapsibleWidget : public QWidget
67 Q_OBJECT
68 public:
69 CollapsibleWidget(QWidget *parent = 0);
70 explicit CollapsibleWidget(const QString& caption, QWidget *parent = 0);
71 ~CollapsibleWidget();
73 QString caption() const;
74 bool isExpanded() const;
76 QWidget* innerWidget() const;
77 void setInnerWidget( QWidget *w);
79 public slots:
80 void setExpanded(bool collapsed);
81 void setCaption(const QString& caption);
84 protected:
85 void init();
87 private slots:
88 void animateCollapse(qreal);
90 private:
91 Q_DISABLE_COPY( CollapsibleWidget )
92 class Private;
93 Private * const d;
99 /**
100 @short A scrollable container that contains groups of settings,
101 usually in the form of CollapsibleWidgets.
102 @author Daniel Molkentin <molkentin@kde.org>
104 class KOPETE_EXPORT SettingsContainer : public QScrollArea
106 Q_ENUMS( CollapseState )
107 Q_OBJECT
108 public:
109 enum CollapseState { Collapsed, Uncollapsed };
110 SettingsContainer( QWidget *parent = 0 );
111 ~SettingsContainer();
113 CollapsibleWidget* insertWidget( QWidget* w, const QString& name );
115 private:
116 Q_DISABLE_COPY( SettingsContainer )
117 class Private;
118 Private * const d;
123 #endif // COLLAPSIBLEWIDGET_H