]> git.saurik.com Git - wxWidgets.git/blame - include/wx/html/htmlproc.h
wxLaunchDefaultBrowser
[wxWidgets.git] / include / wx / html / htmlproc.h
CommitLineData
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
10
11#ifndef _WX_HTMLPREP_H_
12#define _WX_HTMLPREP_H_
13
12028905 14#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
badb7892 15#pragma interface "htmlproc.h"
892aeafc
VS
16// (implementation is in htmlwin.cpp, there's no htmlprep.cpp!)
17#endif
18
19#include "wx/defs.h"
20
21#if wxUSE_HTML
22
23#include "wx/string.h"
24
25// Priority of preprocessor in the chain. The higher, the earlier it is used
26enum
27{
28 wxHTML_PRIORITY_DONTCARE = 128, // if the order doesn't matter, use this
29 // priority
30 wxHTML_PRIORITY_SYSTEM = 256 // >=256 is only for wxHTML's internals
31};
32
6953da00 33// Classes derived from this class serve as simple text processors for
892aeafc
VS
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.
37
6acba9a7 38class WXDLLIMPEXP_HTML wxHtmlProcessor : public wxObject
892aeafc
VS
39{
40 DECLARE_ABSTRACT_CLASS(wxHtmlProcessor)
41
42public:
6953da00 43 wxHtmlProcessor() : wxObject(), m_enabled(true) {}
892aeafc
VS
44 virtual ~wxHtmlProcessor() {}
45
46 // Process input text and return processed result
47 virtual wxString Process(const wxString& text) const = 0;
48
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; }
6953da00
WS
52
53 // Enable/disable the processor. wxHtmlWindow won't use a disabled
960ba969 54 // processor even if it is in its processors queue.
6953da00 55 virtual void Enable(bool enable = true) { m_enabled = enable; }
960ba969 56 bool IsEnabled() const { return m_enabled; }
6953da00 57
960ba969
VS
58protected:
59 bool m_enabled;
892aeafc
VS
60};
61
62#endif // wxUSE_HTML
63
64#endif // _WX_HTMLPROC_H_