1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: HTML processor
4 // Author: Vaclav Slavik
6 // Copyright: (c) 2001 Vaclav Slavik
7 // Licence: wxWindows Licence
8 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_HTMLPREP_H_
12 #define _WX_HTMLPREP_H_
14 #if defined(__GNUG__) && !defined(__APPLE__)
15 #pragma interface "htmlproc.h"
16 // (implementation is in htmlwin.cpp, there's no htmlprep.cpp!)
23 #include "wx/string.h"
25 // Priority of preprocessor in the chain. The higher, the earlier it is used
28 wxHTML_PRIORITY_DONTCARE
= 128, // if the order doesn't matter, use this
30 wxHTML_PRIORITY_SYSTEM
= 256 // >=256 is only for wxHTML's internals
33 // Classes derived from this class serve as simple text processors for
34 // wxHtmlWindow. wxHtmlWindow runs HTML markup through all registered
35 // processors before displaying it, thus allowing for on-the-fly
36 // modifications of the markup.
38 class WXDLLIMPEXP_HTML wxHtmlProcessor
: public wxObject
40 DECLARE_ABSTRACT_CLASS(wxHtmlProcessor
)
43 wxHtmlProcessor() : wxObject(), m_enabled(TRUE
) {}
44 virtual ~wxHtmlProcessor() {}
46 // Process input text and return processed result
47 virtual wxString
Process(const wxString
& text
) const = 0;
49 // Return priority value of this processor. The higher, the sooner
50 // is the processor applied to the text.
51 virtual int GetPriority() const { return wxHTML_PRIORITY_DONTCARE
; }
53 // Enable/disable the processor. wxHtmlWindow won't use a disabled
54 // processor even if it is in its processors queue.
55 virtual void Enable(bool enable
= TRUE
) { m_enabled
= enable
; }
56 bool IsEnabled() const { return m_enabled
; }
64 #endif // _WX_HTMLPROC_H_