itom 1.3.0
|
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 USERUIDIALOG 00024 #define USERUIDIALOG 00025 00026 #include "../common/sharedStructuresQt.h" 00027 #include "../api/apiFunctionsGraph.h" 00028 #include "../global.h" 00029 00030 #include <qdialog.h> 00031 00032 #include <qstring.h> 00033 #include <qmap.h> 00034 #include <QBoxLayout> 00035 #include <qdialogbuttonbox.h> 00036 #include <qabstractbutton.h> 00037 00038 #include <qstringlist.h> 00039 #include <qmetaobject.h> 00040 00041 using namespace ito; 00042 00043 class UserUiDialog : public QDialog 00044 { 00045 Q_OBJECT 00046 public: 00047 enum tButtonBarType 00048 { 00049 bbTypeNo = 0x0000, 00050 bbTypeHorizontal = 0x0001, 00051 bbTypeVertical = 0x0002 00052 }; 00053 00054 UserUiDialog(const QString &filename, tButtonBarType buttonBarType, const StringMap &dialogButtons, RetVal &retValue, QWidget * parent = NULL, Qt::WindowFlags f = NULL); 00055 UserUiDialog(QWidget *contentWidget, tButtonBarType buttonBarType, const StringMap &dialogButtons, RetVal &retValue, QWidget * parent = NULL, Qt::WindowFlags f = NULL); 00056 00057 ~UserUiDialog(); 00058 00059 const QMetaObject *getMetaObjectByWidgetName(QString name) const; 00060 00061 protected: 00062 RetVal init(const QString &filename, tButtonBarType buttonBarType, const StringMap &dialogButtons); 00063 RetVal init(QWidget *contentWidget, tButtonBarType buttonBarType, const StringMap &dialogButtons); 00064 00065 private: 00066 00067 00068 QDialogButtonBox::ButtonRole getButtonRole(QString role); 00069 00070 QBoxLayout *m_boxLayout; 00071 QDialogButtonBox *m_dialogBtnBox; 00072 QWidget *m_uiWidget; 00073 00074 signals: 00075 00076 public slots: 00077 00078 private slots: 00079 void dialogButtonClicked ( QAbstractButton * button ); 00080 }; 00081 00082 #endif