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