Game Develop Core: HelpFileAccess.h Source File

| Game Develop Core Core library for developing platforms and tools compatible with Game Develop.

- Main Page
- Modules
- Classes

- File List
- File Members

All Classes Files Functions Variables Typedefs Enumerations Macros Groups Pages
HelpFileAccess.h
Go to the documentation of this file.
1
5 #if defined(GD_IDE_ONLY) && !defined(GD_NO_WX_GUI)
6 #ifndef HELPFILEACCESS_H
7 #define HELPFILEACCESS_H
8 #include "GDCore/Tools/Locale/LocaleManager.h"
9 #include <wx/string.h>
10
11 namespace gd
12 {
13
21 class GD_CORE_API HelpProvider
22 {
23 public:
24 HelpProvider() {};
25 virtual ~HelpProvider() {};
26
27 virtual void OpenURL(wxString url) =0;
28 };
29
41 class GD_CORE_API HelpFileAccess
42 {
43 public:
44
52 inline void SetHelpProvider(HelpProvider * newHelpProvider)
53 {
54 helpProvider = newHelpProvider;
55 }
56
60 inline void OpenURL(wxString url)
61 {
62 helpProvider->OpenURL(url);
63 }
64
65 static HelpFileAccess *GetInstance()
66 {
67 if (NULL == _singleton)
68 _singleton = new HelpFileAccess;
69
70 return _singleton;
71 }
72
73 static void DestroySingleton ()
74 {
75 if (NULL != _singleton)
76 {
77 delete _singleton;
78 _singleton = NULL;
79 }
80 }
81
82 private:
83 HelpFileAccess() : helpProvider(NULL) {};
84 virtual ~HelpFileAccess() { };
85
86 static HelpFileAccess *_singleton;
87 HelpProvider * helpProvider;
88 };
89
90 }
91 #endif // HELPFILEACCESS_H
92 #endif