fox16_gui.hpp
Go to the documentation of this file.
/***************************************************************************
begin : Fri Jan 22 2010
copyright : (C) 2010 by Martin Preuss
email : martin@libchipcard.de
***************************************************************************
* Please see toplevel file COPYING for license details *
***************************************************************************/
#ifndef FOX16_GUI_HPP
#define FOX16_GUI_HPP
#include <gwen-gui-fox16/api.h>
#include <gwen-gui-cpp/cppgui.hpp>
#include <gwenhywfar/htmlfont_be.h>
#include <fx.h>
#include <list>
/* TODO:
* - catch closing of dialog and send GWEN_DialogEvent_TypeClose.
*
*/
class FOX16_GuiUpdater;
class FOX16GUI_API FOX16_Gui: public CppGui {
public:
class FOX16GUI_API WinScope {
friend class FOX16_Gui;
public:
typedef enum {
WIN_SCOPE_TYPE_WINDOW=0,
} WIN_SCOPE_TYPE;
WinScope(uint32_t parentId, FXWindow *w);
WinScope(FXWindow *w);
~WinScope();
uint32_t getParentId() const { return m_parentId;};
uint32_t getId() const { return m_id;};
FXWindow *getWindow() const { return m_window;};
protected:
WinScope(WIN_SCOPE_TYPE t, uint32_t parentId, FXWindow *w);
WIN_SCOPE_TYPE getType() const { return m_type;};
uint32_t m_parentId;
uint32_t m_id;
FXWindow *m_window;
WIN_SCOPE_TYPE m_type;
};
typedef std::list<WinScope*> WinScopePtrList;
enum {
ID_MAINWINDOW=1
};
FOX16_Gui(FXApp* a);
~FOX16_Gui();
FXApp *getApp() { return m_app;};
FOX16GUI_API static FXString getRawText(const char *text);
FOX16GUI_API static FXString getHtmlText(const char *text);
FXWindow *getGuiWindow(uint32_t id);
FOX16GUI_API static FOX16_Gui *getFgGui();
virtual int openDialog(GWEN_DIALOG *dlg, uint32_t guiid);
virtual int closeDialog(GWEN_DIALOG *dlg);
virtual int runDialog(GWEN_DIALOG *dlg, int untilEnd);
HTML_FONT *getFont(const char *fontName,
int fontSize,
uint32_t fontFlags);
protected:
uint32_t getNextId();
uint32_t getIdOfLastScope();
void addWinScope(WinScope *ws);
void delWinScope(WinScope *ws);
void dumpScopeList();
HTML_FONT *findFont(const char *fontName,
int fontSize,
uint32_t fontFlags);
int print(const char *docTitle,
const char *docType,
const char *descr,
const char *text,
uint32_t guiid);
int execDialog(GWEN_DIALOG *dlg, uint32_t guiid);
int getFileName(const char *caption,
GWEN_GUI_FILENAME_TYPE fnt,
uint32_t flags,
const char *patterns,
GWEN_BUFFER *pathBuffer,
uint32_t guiid);
WinScope *findWinScope(uint32_t id);
WinScope *findWinScopeExt(uint32_t id);
FXApp *m_app;
WinScopePtrList m_scopeList;
uint32_t m_lastId;
FOX16_GuiUpdater *m_updater;
HTML_FONT_LIST *m_fontList;
};
#endif
CppGui::CppGui
CppGui()
FOX16_Gui::WinScope
Definition fox16_gui.hpp:37
FOX16_Gui::WinScope::WinScope
WinScope(uint32_t parentId, FXWindow *w)
FOX16_Gui::WinScope::m_window
FXWindow * m_window
Definition fox16_gui.hpp:59
FOX16_Gui::WinScope::FOX16_Gui
friend class FOX16_Gui
Definition fox16_gui.hpp:38
FOX16_Gui::WinScope::WinScope
WinScope(FXWindow *w)
FOX16_Gui::WinScope::getId
uint32_t getId() const
Definition fox16_gui.hpp:50
FOX16_Gui::WinScope::getType
WIN_SCOPE_TYPE getType() const
Definition fox16_gui.hpp:55
FOX16_Gui::WinScope::WinScope
WinScope(WIN_SCOPE_TYPE t, uint32_t parentId, FXWindow *w)
FOX16_Gui::WinScope::m_type
WIN_SCOPE_TYPE m_type
Definition fox16_gui.hpp:60
FOX16_Gui::WinScope::~WinScope
~WinScope()
FOX16_Gui::WinScope::m_parentId
uint32_t m_parentId
Definition fox16_gui.hpp:57
FOX16_Gui::WinScope::getParentId
uint32_t getParentId() const
Definition fox16_gui.hpp:49
FOX16_Gui::WinScope::m_id
uint32_t m_id
Definition fox16_gui.hpp:58
FOX16_Gui::WinScope::WIN_SCOPE_TYPE
WIN_SCOPE_TYPE
Definition fox16_gui.hpp:41
FOX16_Gui::WinScope::WIN_SCOPE_TYPE_WINDOW
@ WIN_SCOPE_TYPE_WINDOW
Definition fox16_gui.hpp:42
FOX16_Gui::WinScope::getWindow
FXWindow * getWindow() const
Definition fox16_gui.hpp:51
FOX16_Gui::print
int print(const char *docTitle, const char *docType, const char *descr, const char *text, uint32_t guiid)
FOX16_Gui::m_app
FXApp * m_app
Definition fox16_gui.hpp:123
FOX16_Gui::getFileName
int getFileName(const char *caption, GWEN_GUI_FILENAME_TYPE fnt, uint32_t flags, const char *patterns, GWEN_BUFFER *pathBuffer, uint32_t guiid)
FOX16_Gui::WinScopePtrList
std::list< WinScope * > WinScopePtrList
Definition fox16_gui.hpp:63
FOX16_Gui::m_fontList
HTML_FONT_LIST * m_fontList
Definition fox16_gui.hpp:129
FOX16_Gui::openDialog
virtual int openDialog(GWEN_DIALOG *dlg, uint32_t guiid)
FOX16_Gui::getGuiWindow
FXWindow * getGuiWindow(uint32_t id)
FOX16_Gui::~FOX16_Gui
~FOX16_Gui()
FOX16_Gui::addWinScope
void addWinScope(WinScope *ws)
FOX16_Gui::findWinScopeExt
WinScope * findWinScopeExt(uint32_t id)
FOX16_Gui::dumpScopeList
void dumpScopeList()
FOX16_Gui::ID_MAINWINDOW
@ ID_MAINWINDOW
Definition fox16_gui.hpp:66
FOX16_Gui::findWinScope
WinScope * findWinScope(uint32_t id)
FOX16_Gui::delWinScope
void delWinScope(WinScope *ws)
FOX16_Gui::closeDialog
virtual int closeDialog(GWEN_DIALOG *dlg)
FOX16_Gui::m_scopeList
WinScopePtrList m_scopeList
Definition fox16_gui.hpp:124
FOX16_Gui::getRawText
static FOX16GUI_API FXString getRawText(const char *text)
FOX16_Gui::m_lastId
uint32_t m_lastId
Definition fox16_gui.hpp:125
FOX16_Gui::findFont
HTML_FONT * findFont(const char *fontName, int fontSize, uint32_t fontFlags)
FOX16_Gui::FOX16_Gui
FOX16_Gui(FXApp *a)
FOX16_Gui::getIdOfLastScope
uint32_t getIdOfLastScope()
FOX16_Gui::getFgGui
static FOX16GUI_API FOX16_Gui * getFgGui()
FOX16_Gui::getNextId
uint32_t getNextId()
FOX16_Gui::runDialog
virtual int runDialog(GWEN_DIALOG *dlg, int untilEnd)
FOX16_Gui::getFont
HTML_FONT * getFont(const char *fontName, int fontSize, uint32_t fontFlags)
FOX16_Gui::getApp
FXApp * getApp()
Definition fox16_gui.hpp:72
FOX16_Gui::execDialog
int execDialog(GWEN_DIALOG *dlg, uint32_t guiid)
FOX16_Gui::m_updater
FOX16_GuiUpdater * m_updater
Definition fox16_gui.hpp:127
FOX16_Gui::getHtmlText
static FOX16GUI_API FXString getHtmlText(const char *text)
cppgui.hpp
GWEN_DIALOG
struct GWEN_DIALOG GWEN_DIALOG
Definition dialog.h:54
GWEN_BUFFER
struct GWEN_BUFFER GWEN_BUFFER
A dynamically resizeable text buffer.
Definition buffer.h:38
GWEN_GUI_FILENAME_TYPE
GWEN_GUI_FILENAME_TYPE
Definition gui.h:949
api.h
htmlfont_be.h
HTML_FONT
struct HTML_FONT HTML_FONT
Definition htmlfont_be.h:23
HTML_FONT_LIST
Definition listdoc.h:3744