itom 2.2.1
|
00001 /* ******************************************************************** 00002 itom software 00003 URL: http://www.uni-stuttgart.de/ito 00004 Copyright (C) 2016, Institut fuer Technische Optik (ITO), 00005 Universitaet 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 namespace ito 00042 { 00043 00044 class UserUiDialog : public QDialog 00045 { 00046 Q_OBJECT 00047 public: 00048 enum tButtonBarType 00049 { 00050 bbTypeNo = 0x0000, 00051 bbTypeHorizontal = 0x0001, 00052 bbTypeVertical = 0x0002 00053 }; 00054 00055 UserUiDialog(const QString &filename, tButtonBarType buttonBarType, const StringMap &dialogButtons, RetVal &retValue, QWidget * parent = NULL, Qt::WindowFlags f = NULL); 00056 UserUiDialog(QWidget *contentWidget, tButtonBarType buttonBarType, const StringMap &dialogButtons, RetVal &retValue, QWidget * parent = NULL, Qt::WindowFlags f = NULL); 00057 00058 ~UserUiDialog(); 00059 00060 protected: 00061 RetVal init(const QString &filename, tButtonBarType buttonBarType, const StringMap &dialogButtons); 00062 RetVal init(QWidget *contentWidget, tButtonBarType buttonBarType, const StringMap &dialogButtons); 00063 00064 private: 00065 QDialogButtonBox::ButtonRole getButtonRole(const QString &role); 00066 00067 QBoxLayout *m_boxLayout; 00068 QDialogButtonBox *m_dialogBtnBox; 00069 QWidget *m_uiWidget; 00070 00071 signals: 00072 00073 public slots: 00074 00075 private slots: 00076 void dialogButtonClicked ( QAbstractButton * button ); 00077 }; 00078 00079 } //end namespace ito 00080 00081 #endif