itom 1.0.14
D:/git-itom/sources/itom/Qitom/ui/dialogProperties.h
00001 /* ********************************************************************
00002     itom software
00003     URL: http://www.uni-stuttgart.de/ito
00004     Copyright (C) 2013, Institut für Technische Optik (ITO),
00005     Universität Stuttgart, Germany
00006 
00007     This file is part of itom.
00008   
00009     itom is free software; you can redistribute it and/or modify it
00010     under the terms of the GNU Library General Public Licence as published by
00011     the Free Software Foundation; either version 2 of the Licence, or (at
00012     your option) any later version.
00013 
00014     itom is distributed in the hope that it will be useful, but
00015     WITHOUT ANY WARRANTY; without even the implied warranty of
00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library
00017     General Public Licence for more details.
00018 
00019     You should have received a copy of the GNU Library General Public License
00020     along with itom. If not, see <http://www.gnu.org/licenses/>.
00021 *********************************************************************** */
00022 
00023 #ifndef DIALOGPROPERTIES_H
00024 #define DIALOGPROPERTIES_H
00025 
00026 #include "abstractPropertyPageWidget.h"
00027 
00028 #include <QtGui>
00029 #include <qdialog.h>
00030 #include <qmap.h>
00031 #include <qtreewidget.h>
00032 #include <qstringlist.h>
00033 
00034 namespace ito
00035 {
00036 
00037 class DialogProperties : public QDialog
00038 {
00039     Q_OBJECT
00040 
00041 public:
00042 
00043     struct PropertyPage
00044     {
00045         PropertyPage() : m_widget(NULL), m_icon(), m_visited(false) {}
00046         PropertyPage(QString name, QString title, QString fullname, AbstractPropertyPageWidget* widget, QIcon icon) : m_title(title), m_name(name), m_fullname(fullname), m_widget(widget), m_icon(icon), m_visited(false) {}
00047         QString m_title;
00048         QString m_name;
00049         QString m_fullname;
00050         AbstractPropertyPageWidget* m_widget;
00051         QIcon m_icon;
00052         bool m_visited;
00053     };
00054 
00055     DialogProperties(QWidget * parent = 0, Qt::WindowFlags f = 0);
00056     ~DialogProperties();
00057 
00058 protected:
00059 
00060     void initPages();
00061 
00062     void addPage(PropertyPage page, QTreeWidgetItem *parent, QStringList remainingPathes);
00063 
00064 private:
00065 
00066     QStackedWidget *m_pStackedWidget;
00067     QSplitter *m_pSplitter;
00068     QTreeWidget *m_pCategories;
00069     QDialogButtonBox *m_pButtonBox;
00070 
00071     QHBoxLayout *m_pHorizontalLayout;
00072     QVBoxLayout *m_pVerticalLayout;
00073 
00074     QLabel *m_pPageTitle;
00075     QFrame *m_pLine;
00076 
00077     QWidget *m_pEmptyPage;
00078 
00079     QMap<QString, PropertyPage> m_pages;
00080 
00081 signals:
00082     void propertiesChanged();
00083 
00084 public slots:
00085 
00086 private slots:
00087     void categoryChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous);
00088     void accepted();
00089     void rejected();
00090     void apply();
00091 };
00092 
00093 } //end namespace ito
00094 
00095 #endif
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends