itom 2.0.0
D:/git-itom/sources/itom/Qitom/widgets/userUiDialog.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 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     const QMetaObject *getMetaObjectByWidgetName(QString name) const;
00061 
00062 protected:
00063     RetVal init(const QString &filename, tButtonBarType buttonBarType, const StringMap &dialogButtons);
00064     RetVal init(QWidget *contentWidget, tButtonBarType buttonBarType, const StringMap &dialogButtons);
00065 
00066 private:
00067     
00068 
00069     QDialogButtonBox::ButtonRole getButtonRole(QString role);
00070 
00071     QBoxLayout *m_boxLayout;
00072     QDialogButtonBox *m_dialogBtnBox;
00073     QWidget *m_uiWidget;
00074 
00075 signals:
00076 
00077 public slots:
00078 
00079 private slots:
00080     void dialogButtonClicked ( QAbstractButton * button );
00081 };
00082 
00083 } //end namespace ito
00084 
00085 #endif
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends