]> git.saurik.com Git - wxWidgets.git/blob - contrib/include/wx/applet/echovar.h
Applied patch #445873
[wxWidgets.git] / contrib / include / wx / applet / echovar.h
1 /****************************************************************************
2 *
3 * wxWindows HTML Applet Package
4 *
5 * Copyright (C) 1991-2001 SciTech Software, Inc.
6 * All rights reserved.
7 *
8 * ========================================================================
9 *
10 * The contents of this file are subject to the wxWindows License
11 * Version 3.0 (the "License"); you may not use this file except in
12 * compliance with the License. You may obtain a copy of the License at
13 * http://www.wxwindows.org/licence3.txt
14 *
15 * Software distributed under the License is distributed on an
16 * "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
17 * implied. See the License for the specific language governing
18 * rights and limitations under the License.
19 *
20 * ========================================================================
21 *
22 * Language: ANSI C++
23 * Environment: Any
24 *
25 * Description: Header file for wxEchoVariable Class, Dynamically constructed
26 * objects representing variables in SSI #echo directive
27 *
28 ****************************************************************************/
29
30 #ifndef __WX_ECHOVAR_H
31 #define __WX_ECHOVAR_H
32
33 /*--------------------------- Class Definitions ---------------------------*/
34
35 /****************************************************************************
36 REMARKS:
37 wxEchoVariable class Definition
38 ****************************************************************************/
39 class wxEchoVariable : public wxObject {
40 private:
41 DECLARE_ABSTRACT_CLASS(wxEchoVariable);
42
43 public:
44 wxEchoVariable() : wxObject() {}
45 ~wxEchoVariable() {}
46
47 /****************************************************************************
48 RETURNS:
49 The boolean value of the variable
50
51 PARAMETERS:
52 parms - Optional parameter string passed from parm= field in HTML
53
54 REMARKS:
55 To create new variables for the #echo HTML preprocessing directives
56 you need to derive classes from wxEchoVariable and override the
57 pure virtual GetValue function. However this should not be done directly
58 but by using the BEGIN_ECHO_VARIABLE and END_ECHO_VARIABLE macros
59
60 SEE ALSO:
61 wxEchoPrep, BEGIN_ECHO_VARIABLE, END_ECHO_VARIABLE
62 ****************************************************************************/
63 virtual wxString GetValue(const char *parms = NULL) const = 0;
64
65
66 public:
67 // static function to retrieve any variable avaliable
68 static wxString GetValue(const wxString &cls, const char *parms = NULL);
69 };
70
71 /*--------------------------------- MACROS --------------------------------*/
72
73 #define ECHO_PARM (_BEV_parm)
74 #define BEGIN_ECHO_VARIABLE(name) \
75 class wxEchoVariable##name : public wxEchoVariable { \
76 private: \
77 DECLARE_DYNAMIC_CLASS(wxEchoVariable##name##); \
78 public: \
79 wxEchoVariable##name##() : wxEchoVariable() {} \
80 virtual wxString GetValue(const char *parms = NULL) const; \
81 }; \
82 IMPLEMENT_DYNAMIC_CLASS(wxEchoVariable##name##, wxEchoVariable); \
83 wxString wxEchoVariable##name :: GetValue(const char *parms) const { \
84 wxString _BEV_parm = wxString(parms);
85
86 #define END_ECHO_VARIABLE(name, returnval) \
87 return returnval; \
88 }
89
90 #define STRING_ECHO_VARIABLE(name, string) \
91 BEGIN_ECHO_VARIABLE(##name##); \
92 END_ECHO_VARIABLE(##name##, wxString(##string##))
93
94 #endif // __WX_ECHOVAR_H
95