]> git.saurik.com Git - wxWidgets.git/blob - contrib/include/wx/applet/ifelsevar.h
Added the missing keyword 'const' to the fix for virtual Clone() function
[wxWidgets.git] / contrib / include / wx / applet / ifelsevar.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 wxIfElseVariable Class, Dynamically constructed
26 * objects representing variables in SSI #if, #else and #endif directives
27 *
28 ****************************************************************************/
29
30 #ifndef __WX_IFELSEVAR_H
31 #define __WX_IFELSEVAR_H
32
33 /*--------------------------- Class Definitions ---------------------------*/
34
35 /****************************************************************************
36 REMARKS:
37 This class is used to create variables for the HTML preprocessor #if, #else,
38 and #endif directives.
39
40 SEE ALSO:
41 wxIfElsePrep
42 ****************************************************************************/
43 class wxIfElseVariable : public wxObject {
44 private:
45 DECLARE_ABSTRACT_CLASS(wxIfElseVariable);
46
47 public:
48 wxIfElseVariable() : wxObject() {}
49 ~wxIfElseVariable() {}
50
51 /****************************************************************************
52 RETURNS:
53 The boolean value of the variable
54
55 REMARKS:
56 To create new variables for the #if, #else and #endif HTML preprocessing
57 blocks you need to derive classes from wxIfElseVariable and override the
58 pure virtual GetValue function. However this should not be done directly
59 but by using the BEGIN_IFELSE_VARIABLE and END_IFELSE_VARIABLE macros
60
61 SEE ALSO:
62 wxIfElsePrep, BEGIN_IFELSE_VARIABLE, END_IFELSE_VARIABLE
63 ****************************************************************************/
64 virtual bool GetValue() const = 0;
65
66
67 public:
68 // static function to retrieve any variable avaliable
69 static bool FindValue(const wxString &cls);
70 };
71
72 /*--------------------------------- MACROS --------------------------------*/
73
74 #define BEGIN_IFELSE_VARIABLE(name) \
75 class wxIfElseVariable##name : public wxIfElseVariable { \
76 private: \
77 DECLARE_DYNAMIC_CLASS(wxIfElseVariable##name##); \
78 public: \
79 wxIfElseVariable##name##() : wxIfElseVariable() {} \
80 virtual bool GetValue() const; \
81 }; \
82 IMPLEMENT_DYNAMIC_CLASS(wxIfElseVariable##name##, wxIfElseVariable); \
83 bool wxIfElseVariable##name :: GetValue() const {
84
85 #define END_IFELSE_VARIABLE(returnval) \
86 return returnval; \
87 }
88
89 #define IFELSE_VARIABLE(name, state) \
90 BEGIN_IFELSE_VARIABLE(##name##); \
91 END_IFELSE_VARIABLE(bool (state))
92
93 #endif // __WX_IFELSEVAR_H
94