]> git.saurik.com Git - wxWidgets.git/blob - include/wx/html/m_templ.h
compilation fix
[wxWidgets.git] / include / wx / html / m_templ.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: m_templ.h
3 // Purpose: Modules template file
4 // Author: Vaclav Slavik
5 // RCS-ID: $Id$
6 // Copyright: (c) Vaclav Slavik
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
9
10 /*
11
12 DESCRIPTION:
13 This is set of macros for easier writing of tag handlers. How to use it?
14 See mod_fonts.cpp for example...
15
16 Attention! This is quite strange C++ bastard. Before using it,
17 I STRONGLY recommend reading and understanding these macros!!
18
19 */
20
21
22 #ifndef _WX_M_TEMPL_H_
23 #define _WX_M_TEMPL_H_
24
25 #include "wx/defs.h"
26
27 #if wxUSE_HTML
28
29 #include "wx/html/winpars.h"
30
31 #define TAG_HANDLER_BEGIN(name,tags) \
32 class HTML_Handler_##name : public wxHtmlWinTagHandler \
33 { \
34 public: \
35 HTML_Handler_##name() : wxHtmlWinTagHandler() {} \
36 wxString GetSupportedTags() {return wxT(tags);}
37
38
39
40 #define TAG_HANDLER_VARS \
41 private:
42
43 #define TAG_HANDLER_CONSTR(name) \
44 public: \
45 HTML_Handler_##name () : wxHtmlWinTagHandler()
46
47
48 #define TAG_HANDLER_PROC(varib) \
49 public: \
50 bool HandleTag(const wxHtmlTag& varib)
51
52
53
54 #define TAG_HANDLER_END(name) \
55 DECLARE_NO_COPY_CLASS(HTML_Handler_##name) \
56 };
57
58
59
60
61 #define TAGS_MODULE_BEGIN(name) \
62 class HTML_Module##name : public wxHtmlTagsModule \
63 { \
64 DECLARE_DYNAMIC_CLASS(HTML_Module##name ) \
65 public: \
66 void FillHandlersTable(wxHtmlWinParser *parser) \
67 {
68
69
70
71
72 #define TAGS_MODULE_ADD(handler) \
73 parser->AddTagHandler(new HTML_Handler_##handler);
74
75
76
77
78 #define TAGS_MODULE_END(name) \
79 } \
80 }; \
81 IMPLEMENT_DYNAMIC_CLASS(HTML_Module##name , wxHtmlTagsModule)
82
83
84
85 #endif
86 #endif