1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/html/htmlprep.h
3 // Purpose: HTML processor
4 // Author: Vaclav Slavik
6 // Copyright: (c) 2001 Vaclav Slavik
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 #ifndef _WX_HTMLPREP_H_
11 #define _WX_HTMLPREP_H_
17 #include "wx/string.h"
19 // Priority of preprocessor in the chain. The higher, the earlier it is used
22 wxHTML_PRIORITY_DONTCARE
= 128, // if the order doesn't matter, use this
24 wxHTML_PRIORITY_SYSTEM
= 256 // >=256 is only for wxHTML's internals
27 // Classes derived from this class serve as simple text processors for
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.
32 class WXDLLIMPEXP_HTML wxHtmlProcessor
: public wxObject
34 DECLARE_ABSTRACT_CLASS(wxHtmlProcessor
)
37 wxHtmlProcessor() : wxObject(), m_enabled(true) {}
38 virtual ~wxHtmlProcessor() {}
40 // Process input text and return processed result
41 virtual wxString
Process(const wxString
& text
) const = 0;
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
; }
47 // Enable/disable the processor. wxHtmlWindow won't use a disabled
48 // processor even if it is in its processors queue.
49 virtual void Enable(bool enable
= true) { m_enabled
= enable
; }
50 bool IsEnabled() const { return m_enabled
; }
58 #endif // _WX_HTMLPROC_H_