1 /****************************************************************************
3 ** Copyright (C) Qxt Foundation. Some rights reserved.
5 ** This file is part of the QxtGui module of the Qt eXTension library
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
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.
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.
21 ** <http://libqxt.sourceforge.net> <foundation@libqxt.org>
23 ****************************************************************************/
24 #ifndef QXTCONFIGDIALOG_H
25 #define QXTCONFIGDIALOG_H
28 #include "qxtglobal.h"
33 class QDialogButtonBox;
34 class QxtConfigDialogPrivate;
36 class QXT_GUI_EXPORT QxtConfigDialog : public QDialog
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)
48 enum IconPosition { North, West, East };
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();
54 QDialogButtonBox* dialogButtonBox() const;
55 void setDialogButtonBox(QDialogButtonBox* buttonBox);
57 bool hasHoverEffect() const;
58 void setHoverEffect(bool enabled);
60 QxtConfigDialog::IconPosition iconPosition() const;
61 void setIconPosition(QxtConfigDialog::IconPosition position);
63 QSize iconSize() const;
64 void setIconSize(const QSize& size);
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);
71 int currentIndex() const;
72 QWidget* currentPage() const;
73 int indexOf(QWidget* page) const;
74 QWidget* page(int index) const;
76 bool isPageEnabled(int index) const;
77 void setPageEnabled(int index, bool enabled);
79 bool isPageHidden(int index) const;
80 void setPageHidden(int index, bool hidden);
82 QIcon pageIcon(int index) const;
83 void setPageIcon(int index, const QIcon& icon);
85 QString pageTitle(int index) const;
86 void setPageTitle(int index, const QString& title);
88 QString pageToolTip(int index) const;
89 void setPageToolTip(int index, const QString& tooltip);
91 QString pageWhatsThis(int index) const;
92 void setPageWhatsThis(int index, const QString& whatsthis);
95 void setCurrentIndex(int index);
96 void setCurrentPage(QWidget* page);
99 void currentIndexChanged(int index);
102 QListWidget* listWidget() const;
103 QStackedWidget* stackedWidget() const;
106 #endif // QXTCONFIGDIALOG_H