xref: /aoo41x/main/autodoc/inc/ary_i/d_token.hxx (revision 1c78a5d6)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef CSI_DSAPI_D_TOKEN_HXX
25 #define CSI_DSAPI_D_TOKEN_HXX
26 
27 // BASE CLASSES
28 #include <ary_i/ci_text2.hxx>
29 #include <ary_i/ci_atag2.hxx>
30 
31 
32 namespace ary
33 {
34 namespace inf
35 {
36     class DocumentationDisplay;
37 }
38 }
39 
40 
41 
42 namespace csi
43 {
44 namespace dsapi
45 {
46 
47 using ary::inf::DocumentationDisplay;
48 
49 
50 class DT_Dsapi : public ary::inf::DocuToken
51 {
52   public:
53 	virtual void		DisplayAt(
54 							DocumentationDisplay &
55 												o_rDisplay ) const  = 0;
56 	virtual bool		IsWhiteOnly() const;
57 };
58 
59 
60 
61 class DT_TextToken : public DT_Dsapi
62 {
63   public:
DT_TextToken(const char * i_sText)64 	explicit		    DT_TextToken(
65 							const char *		i_sText )
66 												:	sText(i_sText) {}
DT_TextToken(const String & i_sText)67 	explicit		    DT_TextToken(
68 							const String &  	i_sText )
69 												:	sText(i_sText) {}
70     virtual             ~DT_TextToken();
71 
72 	virtual void		DisplayAt(
73 							DocumentationDisplay &
74 												o_rDisplay ) const;
GetText() const75 	const char *		GetText() const			{ return sText; }
GetTextStr() const76 	const String &      GetTextStr() const		{ return sText; }
77 
Access_Text()78 	String &            Access_Text()   		{ return sText; }
79 
80 	virtual bool		IsWhiteOnly() const;
81 
82   private:
83 	String				sText;
84 };
85 
86 class DT_White : public DT_Dsapi
87 {
88   public:
DT_White()89                         DT_White() {}
90     virtual             ~DT_White();
91 
92 	virtual void		DisplayAt(
93 							DocumentationDisplay &
94 												o_rDisplay ) const;
95 	virtual bool		IsWhiteOnly() const;
96 };
97 
98 
99 class DT_MLTag : public DT_Dsapi
100 {
101   public:
102 	enum E_Kind
103 	{
104 		k_unknown = 0,
105 		k_begin,
106 		k_end,
107 		k_single
108 	};
109 };
110 
111 class DT_MupType : public DT_MLTag
112 {
113   public:
DT_MupType(bool)114 	explicit		    DT_MupType(             /// Constructor for End-Tag
115 							bool				)	/// Must be there, but is not evaluated.
116                                                 :	bIsBegin(false) {}
DT_MupType(const String & i_sScope)117 	explicit		    DT_MupType(             /// Constructor for Begin-Tag
118 							const String &		i_sScope )
119 												:	sScope(i_sScope), bIsBegin(true) {}
120     virtual             ~DT_MupType();
121 
122 	virtual void		DisplayAt(
123 							DocumentationDisplay &
124 												o_rDisplay ) const;
Scope() const125 	const String  &		Scope() const			{ return sScope; }
IsBegin() const126 	bool				IsBegin() const			{ return bIsBegin; }
127 
128   private:
129 	String 				sScope;
130 	bool				bIsBegin;
131 };
132 
133 class DT_MupMember : public DT_MLTag
134 {
135   public:
DT_MupMember(bool)136 	explicit		    DT_MupMember(           /// Constructor for End-Tag
137 							bool				)	/// Must be there, but is not evaluated.
138 												:	bIsBegin(false) {}
DT_MupMember(const String & i_sScope)139 						DT_MupMember(           /// Constructor for Begin-Tag
140 							const String &      i_sScope )
141 												:	sScope(i_sScope), bIsBegin(true) {}
142     virtual             ~DT_MupMember();
143 
144 	virtual void		DisplayAt(
145 							DocumentationDisplay &
146 												o_rDisplay ) const;
Scope() const147 	const String  &		Scope() const			{ return sScope; }
IsBegin() const148 	bool				IsBegin() const			{ return bIsBegin; }
149 
150   private:
151 	String 				sScope;
152 	bool				bIsBegin;
153 };
154 
155 class DT_MupConst : public DT_Dsapi
156 {
157   public:
DT_MupConst(const char * i_sConstText)158 						DT_MupConst(
159 							const char *		i_sConstText )
160 												:	sConstText(i_sConstText) {}
161 	virtual             ~DT_MupConst();
162 
163 	virtual void		DisplayAt(
164 							DocumentationDisplay &
165 												o_rDisplay ) const;
GetText() const166 	const char *		GetText() const			{ return sConstText; }
167 
168   private:
169 	String 				sConstText;				/// Without HTML.
170 };
171 
172 
173 class DT_Style : public DT_MLTag
174 {
175   public:
DT_Style(const char * i_sPlainHtmlTag,bool i_bNewLine)176 						DT_Style(
177 							const char *		i_sPlainHtmlTag,
178 							bool                i_bNewLine )
179 												: sText(i_sPlainHtmlTag), bNewLine(i_bNewLine) {}
180 	virtual             ~DT_Style();
181 
182 	virtual void		DisplayAt(
183 							DocumentationDisplay &
184 												o_rDisplay ) const;
GetText() const185 	const char *		GetText() const			{ return sText; }
IsStartOfNewLine() const186 	bool				IsStartOfNewLine() const
187 												{ return bNewLine; }
188   private:
189 	String 				sText;					/// With HTML.
190 	E_Kind              eKind;
191 	bool				bNewLine;
192 };
193 
194 class DT_EOL : public DT_Dsapi
195 {
196   public:
DT_EOL()197                         DT_EOL() {}
198     virtual             ~DT_EOL();
199 
200 	virtual void		DisplayAt(
201 							DocumentationDisplay &
202 												o_rDisplay ) const;
203 	virtual bool		IsWhiteOnly() const;
204 };
205 
206 
207 class DT_AtTag : public ary::inf::AtTag2
208 {
209   public:
AddToken(DYN ary::inf::DocuToken & let_drToken)210 	void            	AddToken(
211 							DYN ary::inf::DocuToken &
212 												let_drToken )
213 												{	aText.AddToken(let_drToken); }
SetName(const char * i_sName)214 	void				SetName(
215 							const char *		i_sName )
216 												{ sTitle = i_sName; }
217 
218   protected:
DT_AtTag(const char * i_sTitle)219 						DT_AtTag(
220 							const char *		i_sTitle )
221 												:	ary::inf::AtTag2(i_sTitle) {}
222 };
223 
224 class DT_StdAtTag : public DT_AtTag
225 {
226   public:
DT_StdAtTag(const char * i_sTitle)227 	explicit			DT_StdAtTag(
228 							const char *		i_sTitle )
229 												:	DT_AtTag(i_sTitle) {}
230 	virtual             ~DT_StdAtTag();
231 
232 	virtual void		DisplayAt(
233 							DocumentationDisplay &
234 												o_rDisplay ) const;
235 };
236 
237 class DT_SeeAlsoAtTag : public DT_AtTag
238 {
239   public:
DT_SeeAlsoAtTag()240 						DT_SeeAlsoAtTag()		:	DT_AtTag("") {}
241     virtual             ~DT_SeeAlsoAtTag();
242 
243 	virtual void		DisplayAt(
244 							DocumentationDisplay &
245 												o_rDisplay ) const;
LinkText() const246 	const String  &		LinkText() const		{ return sTitle; }	// Missbrauch von sTitle
247 };
248 
249 class DT_ParameterAtTag : public DT_AtTag
250 {
251   public:
DT_ParameterAtTag()252 						DT_ParameterAtTag()		:	DT_AtTag("") {}
253     virtual             ~DT_ParameterAtTag();
254 
255 	void				SetTitle(
256 		                	const char *		i_sTitle );
257 	virtual void		DisplayAt(
258 							DocumentationDisplay &
259 												o_rDisplay ) const;
260 };
261 
262 class DT_SinceAtTag : public DT_AtTag
263 {
264   public:
DT_SinceAtTag()265 						DT_SinceAtTag()		:	DT_AtTag("Since version") {}
266     virtual             ~DT_SinceAtTag();
267 
268 	virtual void		DisplayAt(
269 							DocumentationDisplay &
270 												o_rDisplay ) const;
271 };
272 
273 
274 }   // namespace dsapi
275 }   // namespace csi
276 
277 #endif
278 
279