gwenhywfar
4.8.0beta
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
gui
fox16
fox16_gui.hpp
Go to the documentation of this file.
1
/***************************************************************************
2
begin : Fri Jan 22 2010
3
copyright : (C) 2010 by Martin Preuss
4
email : martin@libchipcard.de
5
6
***************************************************************************
7
* Please see toplevel file COPYING for license details *
8
***************************************************************************/
9
10
11
#ifndef FOX16_GUI_HPP
12
#define FOX16_GUI_HPP
13
14
#include <gwen-gui-fox16/api.h>
15
#include <gwen-gui-cpp/cppgui.hpp>
16
17
#include <gwenhywfar/htmlfont_be.h>
18
19
20
#include <fx.h>
21
22
#include <list>
23
24
25
/* TODO:
26
* - catch closing of dialog and send GWEN_DialogEvent_TypeClose.
27
*
28
*/
29
30
31
class
FOX16_GuiUpdater
;
32
33
34
class
FOX16GUI_API
FOX16_Gui
:
public
CppGui
{
35
public
:
36
37
class
FOX16GUI_API
WinScope
{
38
friend
class
FOX16_Gui
;
39
40
public
:
41
typedef
enum
{
42
WIN_SCOPE_TYPE_WINDOW=0,
43
} WIN_SCOPE_TYPE;
44
45
WinScope
(uint32_t parentId, FXWindow *w);
46
WinScope
(FXWindow *w);
47
~
WinScope
();
48
49
uint32_t
getParentId
()
const
{
return
m_parentId;};
50
uint32_t
getId
()
const
{
return
m_id;};
51
FXWindow *
getWindow
()
const
{
return
m_window;};
52
53
protected
:
54
WinScope
(WIN_SCOPE_TYPE t, uint32_t parentId, FXWindow *w);
55
WIN_SCOPE_TYPE
getType()
const
{
return
m_type;};
56
57
uint32_t m_parentId;
58
uint32_t
m_id
;
59
FXWindow *
m_window
;
60
WIN_SCOPE_TYPE
m_type
;
61
62
};
63
typedef
std::list<WinScope*>
WinScopePtrList
;
64
65
enum
{
66
ID_MAINWINDOW
=1
67
};
68
69
FOX16_Gui
(FXApp* a);
70
~FOX16_Gui
();
71
72
FXApp *
getApp
() {
return
m_app
;};
73
74
FOX16GUI_API
static
FXString
getRawText
(
const
char
*text);
75
FOX16GUI_API
static
FXString
getHtmlText
(
const
char
*text);
76
77
FXWindow *
getGuiWindow
(uint32_t
id
);
78
79
FOX16GUI_API
static
FOX16_Gui
*
getFgGui
();
80
81
virtual
int
openDialog
(
GWEN_DIALOG
*dlg, uint32_t guiid);
82
virtual
int
closeDialog
(
GWEN_DIALOG
*dlg);
83
virtual
int
runDialog
(
GWEN_DIALOG
*dlg,
int
untilEnd);
84
85
HTML_FONT
*
getFont
(
const
char
*fontName,
86
int
fontSize,
87
uint32_t fontFlags);
88
89
protected
:
90
uint32_t
getNextId
();
91
uint32_t
getIdOfLastScope
();
92
93
void
addWinScope
(WinScope *ws);
94
void
delWinScope
(WinScope *ws);
95
96
void
dumpScopeList
();
97
98
HTML_FONT
*
findFont
(
const
char
*fontName,
99
int
fontSize,
100
uint32_t fontFlags);
101
102
103
int
print
(
const
char
*docTitle,
104
const
char
*docType,
105
const
char
*descr,
106
const
char
*text,
107
uint32_t guiid);
108
109
int
execDialog
(
GWEN_DIALOG
*dlg, uint32_t guiid);
110
111
int
getFileName
(
const
char
*caption,
112
GWEN_GUI_FILENAME_TYPE
fnt,
113
uint32_t flags,
114
const
char
*patterns,
115
GWEN_BUFFER
*pathBuffer,
116
uint32_t guiid);
117
118
119
WinScope *
findWinScope
(uint32_t
id
);
120
121
WinScope *
findWinScopeExt
(uint32_t
id
);
122
123
FXApp *
m_app
;
124
WinScopePtrList
m_scopeList
;
125
uint32_t
m_lastId
;
126
127
FOX16_GuiUpdater
*
m_updater
;
128
129
HTML_FONT_LIST *
m_fontList
;
130
};
131
132
133
134
135
136
#endif
137
138
139
140
Generated on Sun Oct 27 2013 09:43:37 for gwenhywfar by
1.8.4