We now have a current svn snapshot of libqxt in our contrib dir, and
[quassel.git] / src / contrib / libqxt-2007-10-24 / src / gui / qxtconfigdialog.h
1 /****************************************************************************
2 **
3 ** Copyright (C) Qxt Foundation. Some rights reserved.
4 **
5 ** This file is part of the QxtGui module of the Qt eXTension library
6 **
7 ** This library is free software; you can redistribute it and/or modify it
8 ** under the terms of th Common Public License, version 1.0, as published by
9 ** IBM.
10 **
11 ** This file is provided "AS IS", without WARRANTIES OR CONDITIONS OF ANY
12 ** KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY
13 ** WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR
14 ** FITNESS FOR A PARTICULAR PURPOSE.
15 **
16 ** You should have received a copy of the CPL along with this file.
17 ** See the LICENSE file and the cpl1.0.txt file included with the source
18 ** distribution for more information. If you did not receive a copy of the
19 ** license, contact the Qxt Foundation.
20 **
21 ** <http://libqxt.sourceforge.net>  <foundation@libqxt.org>
22 **
23 ****************************************************************************/
24 #ifndef QXTCONFIGDIALOG_H
25 #define QXTCONFIGDIALOG_H
26
27 #include <QDialog>
28 #include "qxtglobal.h"
29 #include "qxtpimpl.h"
30
31 class QListWidget;
32 class QStackedWidget;
33 class QDialogButtonBox;
34 class QxtConfigDialogPrivate;
35
36 class QXT_GUI_EXPORT QxtConfigDialog : public QDialog
37 {
38     Q_OBJECT
39     QXT_DECLARE_PRIVATE(QxtConfigDialog);
40     Q_PROPERTY(int count READ count)
41     Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex)
42     Q_PROPERTY(bool hoverEffect READ hasHoverEffect WRITE setHoverEffect)
43     Q_PROPERTY(QxtConfigDialog::IconPosition iconPosition READ iconPosition WRITE setIconPosition)
44     Q_PROPERTY(QSize iconSize READ iconSize WRITE setIconSize)
45     Q_ENUMS(IconPosition)
46
47 public:
48     enum IconPosition { North, West, East };
49
50     explicit QxtConfigDialog(QWidget* parent = 0, Qt::WindowFlags flags = 0);
51     explicit QxtConfigDialog(QxtConfigDialog::IconPosition position, QWidget* parent = 0, Qt::WindowFlags flags = 0);
52     virtual ~QxtConfigDialog();
53
54     QDialogButtonBox* dialogButtonBox() const;
55     void setDialogButtonBox(QDialogButtonBox* buttonBox);
56
57     bool hasHoverEffect() const;
58     void setHoverEffect(bool enabled);
59
60     QxtConfigDialog::IconPosition iconPosition() const;
61     void setIconPosition(QxtConfigDialog::IconPosition position);
62
63     QSize iconSize() const;
64     void setIconSize(const QSize& size);
65
66     int addPage(QWidget* page, const QIcon& icon, const QString& title = QString());
67     int insertPage(int index, QWidget* page, const QIcon& icon, const QString& title = QString());
68     void removePage(int index);
69
70     int count() const;
71     int currentIndex() const;
72     QWidget* currentPage() const;
73     int indexOf(QWidget* page) const;
74     QWidget* page(int index) const;
75
76     bool isPageEnabled(int index) const;
77     void setPageEnabled(int index, bool enabled);
78
79     bool isPageHidden(int index) const;
80     void setPageHidden(int index, bool hidden);
81
82     QIcon pageIcon(int index) const;
83     void setPageIcon(int index, const QIcon& icon);
84
85     QString pageTitle(int index) const;
86     void setPageTitle(int index, const QString& title);
87
88     QString pageToolTip(int index) const;
89     void setPageToolTip(int index, const QString& tooltip);
90
91     QString pageWhatsThis(int index) const;
92     void setPageWhatsThis(int index, const QString& whatsthis);
93
94 public slots:
95     void setCurrentIndex(int index);
96     void setCurrentPage(QWidget* page);
97
98 signals:
99     void currentIndexChanged(int index);
100
101 protected:
102     QListWidget* listWidget() const;
103     QStackedWidget* stackedWidget() const;
104 };
105
106 #endif // QXTCONFIGDIALOG_H