]>
Commit | Line | Data |
---|---|---|
892aeafc VS |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: htmlprep.h | |
3 | // Purpose: HTML processor | |
4 | // Author: Vaclav Slavik | |
5 | // RCS-ID: $Id$ | |
6 | // Copyright: (c) 2001 Vaclav Slavik | |
65571936 | 7 | // Licence: wxWindows licence |
892aeafc VS |
8 | ///////////////////////////////////////////////////////////////////////////// |
9 | ||
892aeafc VS |
10 | #ifndef _WX_HTMLPREP_H_ |
11 | #define _WX_HTMLPREP_H_ | |
12 | ||
892aeafc VS |
13 | #include "wx/defs.h" |
14 | ||
15 | #if wxUSE_HTML | |
16 | ||
17 | #include "wx/string.h" | |
18 | ||
19 | // Priority of preprocessor in the chain. The higher, the earlier it is used | |
20 | enum | |
21 | { | |
22 | wxHTML_PRIORITY_DONTCARE = 128, // if the order doesn't matter, use this | |
23 | // priority | |
24 | wxHTML_PRIORITY_SYSTEM = 256 // >=256 is only for wxHTML's internals | |
25 | }; | |
26 | ||
6953da00 | 27 | // Classes derived from this class serve as simple text processors for |
892aeafc VS |
28 | // wxHtmlWindow. wxHtmlWindow runs HTML markup through all registered |
29 | // processors before displaying it, thus allowing for on-the-fly | |
30 | // modifications of the markup. | |
31 | ||
6acba9a7 | 32 | class WXDLLIMPEXP_HTML wxHtmlProcessor : public wxObject |
892aeafc VS |
33 | { |
34 | DECLARE_ABSTRACT_CLASS(wxHtmlProcessor) | |
35 | ||
36 | public: | |
6953da00 | 37 | wxHtmlProcessor() : wxObject(), m_enabled(true) {} |
892aeafc VS |
38 | virtual ~wxHtmlProcessor() {} |
39 | ||
40 | // Process input text and return processed result | |
41 | virtual wxString Process(const wxString& text) const = 0; | |
42 | ||
43 | // Return priority value of this processor. The higher, the sooner | |
44 | // is the processor applied to the text. | |
45 | virtual int GetPriority() const { return wxHTML_PRIORITY_DONTCARE; } | |
6953da00 WS |
46 | |
47 | // Enable/disable the processor. wxHtmlWindow won't use a disabled | |
960ba969 | 48 | // processor even if it is in its processors queue. |
6953da00 | 49 | virtual void Enable(bool enable = true) { m_enabled = enable; } |
960ba969 | 50 | bool IsEnabled() const { return m_enabled; } |
6953da00 | 51 | |
960ba969 VS |
52 | protected: |
53 | bool m_enabled; | |
892aeafc VS |
54 | }; |
55 | ||
56 | #endif // wxUSE_HTML | |
57 | ||
58 | #endif // _WX_HTMLPROC_H_ |