1 /***************************************************************************
2     begin       : Mon Feb 15 2010
3     copyright   : (C) 2010 by Martin Preuss
4                   (C) 2016 by Christian David
5     email       : martin@libchipcard.de
6                   christian-david@web.de
7 
8  ***************************************************************************
9  *          Please see toplevel file COPYING for license details           *
10  ***************************************************************************/
11 
12 
13 #ifndef QT5_GUI_H
14 #define QT5_GUI_H
15 
16 
17 #if defined __GNUC__ && (! defined (__sun)) && (__GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3))
18 # ifdef BUILDING_QT5_GUI
19 #   define QT5GUI_API __attribute__ ((visibility("default")))
20 # else
21 #   define QT5GUI_API
22 # endif
23 #else
24 # define QT5GUI_API
25 #endif
26 
27 
28 class QT5_Gui;
29 class QWidget;
30 
31 
32 #include <gwen-gui-cpp/cppgui.hpp>
33 
34 #include <QString>
35 
36 /**
37  * This is an implementation of GWEN_GUI for QT5.
38  *
39  * It implements the GWEN_DIALOG framework.
40  *
41  * @todo: @ref GWEN_Gui_Print() needs to be implemented
42  */
43 class QT5GUI_API QT5_Gui: public CppGui {
44 
45 private:
46   QWidget *_parentWidget;
47   std::list<QWidget*> _pushedParents;
48 
49 public:
50   QT5_Gui();
51   virtual ~QT5_Gui();
52 
getParentWidget() const53   QWidget *getParentWidget() const { return _parentWidget;};
54 
55   void pushParentWidget(QWidget *w);
56   void popParentWidget();
57 
58   static QString extractHtml(const char *text);
59 
60 protected:
61   /** @name User Interaction
62    *
63    */
64   /*@{*/
65 
66   virtual int execDialog(GWEN_DIALOG *dlg, uint32_t guiid);
67 
68   virtual int openDialog(GWEN_DIALOG *dlg, uint32_t guiid);
69   virtual int closeDialog(GWEN_DIALOG *dlg);
70   virtual int runDialog(GWEN_DIALOG *dlg, int untilEnd);
71 
72   virtual int getFileName(const char *caption,
73                           GWEN_GUI_FILENAME_TYPE fnt,
74                           uint32_t flags,
75                           const char *patterns,
76                           GWEN_BUFFER *pathBuffer,
77                           uint32_t guiid);
78 
79 };
80 
81 #endif
82