- Softwrap mode:
- Toggle
Blob of src/sif/private/centralwidget.h
(raw blob data)
| 1 | /*************************************************************************** |
| 2 | * Copyright (C) 2008 by David Cuadrado * |
| 3 | * krawek@gmail.com * |
| 4 | * * |
| 5 | * This program is free software; you can redistribute it and/or modify * |
| 6 | * it under the terms of the GNU General Public License as published by * |
| 7 | * the Free Software Foundation; either version 2 of the License, or * |
| 8 | * (at your option) any later version. * |
| 9 | * * |
| 10 | * This program is distributed in the hope that it will be useful, * |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
| 13 | * GNU General Public License for more details. * |
| 14 | * * |
| 15 | * You should have received a copy of the GNU General Public License * |
| 16 | * along with this program; if not, write to the * |
| 17 | * Free Software Foundation, Inc., * |
| 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
| 19 | ***************************************************************************/ |
| 20 | #ifndef SIFPRIVATECENTRALWIDGET_H |
| 21 | #define SIFPRIVATECENTRALWIDGET_H |
| 22 | |
| 23 | #include <QWidget> |
| 24 | #include <QIcon> |
| 25 | #include <QHash> |
| 26 | |
| 27 | class QAbstractButton; |
| 28 | |
| 29 | namespace SIF { |
| 30 | class AeroButton; |
| 31 | } |
| 32 | |
| 33 | namespace SIFPrivate { |
| 34 | |
| 35 | class HeaderWidget; |
| 36 | class FooterWidget; |
| 37 | class StackedWidget; |
| 38 | |
| 39 | /** |
| 40 | @author David Cuadrado <krawek@gmail.com> |
| 41 | */ |
| 42 | class CentralWidget : public QWidget |
| 43 | { |
| 44 | Q_OBJECT; |
| 45 | public: |
| 46 | CentralWidget(QWidget *parent = 0); |
| 47 | ~CentralWidget(); |
| 48 | |
| 49 | void addPage(const QString &title, QWidget *w); |
| 50 | void addPage(const QIcon &icon, const QString &title, QWidget *w); |
| 51 | |
| 52 | SIF::AeroButton *addButton(const QString &title, const QIcon &icon = QIcon()); |
| 53 | |
| 54 | HeaderWidget *header() const; |
| 55 | StackedWidget *stack() const; |
| 56 | |
| 57 | private slots: |
| 58 | void onButtonClicked(); |
| 59 | |
| 60 | private: |
| 61 | HeaderWidget *m_header; |
| 62 | StackedWidget *m_stack; |
| 63 | FooterWidget *m_footer; |
| 64 | |
| 65 | QHash<QAbstractButton *, QWidget *> m_pages; |
| 66 | }; |
| 67 | |
| 68 | } |
| 69 | |
| 70 | #endif |
