1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/html/htmlprep.h
3 // Purpose: HTML processor
4 // Author: Vaclav Slavik
5 // Copyright: (c) 2001 Vaclav Slavik
6 // Licence: wxWindows licence
7 /////////////////////////////////////////////////////////////////////////////
9 #ifndef _WX_HTMLPREP_H_
10 #define _WX_HTMLPREP_H_
16 #include "wx/string.h"
18 // Priority of preprocessor in the chain. The higher, the earlier it is used
21 wxHTML_PRIORITY_DONTCARE
= 128, // if the order doesn't matter, use this
23 wxHTML_PRIORITY_SYSTEM
= 256 // >=256 is only for wxHTML's internals
26 // Classes derived from this class serve as simple text processors for
27 // wxHtmlWindow. wxHtmlWindow runs HTML markup through all registered
28 // processors before displaying it, thus allowing for on-the-fly
29 // modifications of the markup.
31 class WXDLLIMPEXP_HTML wxHtmlProcessor
: public wxObject
33 DECLARE_ABSTRACT_CLASS(wxHtmlProcessor
)
36 wxHtmlProcessor() : wxObject(), m_enabled(true) {}
37 virtual ~wxHtmlProcessor() {}
39 // Process input text and return processed result
40 virtual wxString
Process(const wxString
& text
) const = 0;
42 // Return priority value of this processor. The higher, the sooner
43 // is the processor applied to the text.
44 virtual int GetPriority() const { return wxHTML_PRIORITY_DONTCARE
; }
46 // Enable/disable the processor. wxHtmlWindow won't use a disabled
47 // processor even if it is in its processors queue.
48 virtual void Enable(bool enable
= true) { m_enabled
= enable
; }
49 bool IsEnabled() const { return m_enabled
; }
57 #endif // _WX_HTMLPROC_H_