]>
git.saurik.com Git - wxWidgets.git/blob - contrib/include/wx/applet/echovar.h
1 /****************************************************************************
3 * wxWindows HTML Applet Package
5 * Copyright (C) 1991-2001 SciTech Software, Inc.
8 * ========================================================================
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
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.
20 * ========================================================================
25 * Description: Header file for wxEchoVariable Class, Dynamically constructed
26 * objects representing variables in SSI #echo directive
28 ****************************************************************************/
30 #ifndef __WX_ECHOVAR_H
31 #define __WX_ECHOVAR_H
33 /*--------------------------- Class Definitions ---------------------------*/
35 /****************************************************************************
37 wxEchoVariable class Definition
38 ****************************************************************************/
39 class wxEchoVariable
: public wxObject
{
41 DECLARE_ABSTRACT_CLASS(wxEchoVariable
);
44 wxEchoVariable() : wxObject() {}
47 /****************************************************************************
49 The boolean value of the variable
52 parms - Optional parameter string passed from parm= field in HTML
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
61 wxEchoPrep, BEGIN_ECHO_VARIABLE, END_ECHO_VARIABLE
62 ****************************************************************************/
63 virtual wxString
GetValue(const char *parms
= NULL
) const = 0;
67 // static function to retrieve any variable avaliable
68 static wxString
GetValue(const wxString
&cls
, const char *parms
= NULL
);
71 /*--------------------------------- MACROS --------------------------------*/
73 #define ECHO_PARM (_BEV_parm)
74 #define BEGIN_ECHO_VARIABLE(name) \
75 class wxEchoVariable##name : public wxEchoVariable { \
77 DECLARE_DYNAMIC_CLASS(wxEchoVariable##name##); \
79 wxEchoVariable##name##() : wxEchoVariable() {} \
80 virtual wxString GetValue(const char *parms = NULL) const; \
82 IMPLEMENT_DYNAMIC_CLASS(wxEchoVariable##name##, wxEchoVariable); \
83 wxString wxEchoVariable##name :: GetValue(const char *parms) const { \
84 wxString _BEV_parm = wxString(parms);
86 #define END_ECHO_VARIABLE(name, returnval) \
90 #define STRING_ECHO_VARIABLE(name, string) \
91 BEGIN_ECHO_VARIABLE(##name##); \
92 END_ECHO_VARIABLE(##name##, wxString(##string##))
94 #endif // __WX_ECHOVAR_H