xref: /aoo41x/main/autodoc/inc/ary_i/d_token.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef CSI_DSAPI_D_TOKEN_HXX
29 #define CSI_DSAPI_D_TOKEN_HXX
30 
31 // BASE CLASSES
32 #include <ary_i/ci_text2.hxx>
33 #include <ary_i/ci_atag2.hxx>
34 
35 
36 namespace ary
37 {
38 namespace inf
39 {
40     class DocumentationDisplay;
41 }
42 }
43 
44 
45 
46 namespace csi
47 {
48 namespace dsapi
49 {
50 
51 using ary::inf::DocumentationDisplay;
52 
53 
54 class DT_Dsapi : public ary::inf::DocuToken
55 {
56   public:
57 	virtual void		DisplayAt(
58 							DocumentationDisplay &
59 												o_rDisplay ) const  = 0;
60 	virtual bool		IsWhiteOnly() const;
61 };
62 
63 
64 
65 class DT_TextToken : public DT_Dsapi
66 {
67   public:
68 	explicit		    DT_TextToken(
69 							const char *		i_sText )
70 												:	sText(i_sText) {}
71 	explicit		    DT_TextToken(
72 							const String &  	i_sText )
73 												:	sText(i_sText) {}
74     virtual             ~DT_TextToken();
75 
76 	virtual void		DisplayAt(
77 							DocumentationDisplay &
78 												o_rDisplay ) const;
79 	const char *		GetText() const			{ return sText; }
80 	const String &      GetTextStr() const		{ return sText; }
81 
82 	String &            Access_Text()   		{ return sText; }
83 
84 	virtual bool		IsWhiteOnly() const;
85 
86   private:
87 	String				sText;
88 };
89 
90 class DT_White : public DT_Dsapi
91 {
92   public:
93                         DT_White() {}
94     virtual             ~DT_White();
95 
96 	virtual void		DisplayAt(
97 							DocumentationDisplay &
98 												o_rDisplay ) const;
99 	virtual bool		IsWhiteOnly() const;
100 };
101 
102 
103 class DT_MLTag : public DT_Dsapi
104 {
105   public:
106 	enum E_Kind
107 	{
108 		k_unknown = 0,
109 		k_begin,
110 		k_end,
111 		k_single
112 	};
113 };
114 
115 class DT_MupType : public DT_MLTag
116 {
117   public:
118 	explicit		    DT_MupType(             /// Constructor for End-Tag
119 							bool				)	/// Must be there, but is not evaluated.
120                                                 :	bIsBegin(false) {}
121 	explicit		    DT_MupType(             /// Constructor for Begin-Tag
122 							const String &		i_sScope )
123 												:	sScope(i_sScope), bIsBegin(true) {}
124     virtual             ~DT_MupType();
125 
126 	virtual void		DisplayAt(
127 							DocumentationDisplay &
128 												o_rDisplay ) const;
129 	const String  &		Scope() const			{ return sScope; }
130 	bool				IsBegin() const			{ return bIsBegin; }
131 
132   private:
133 	String 				sScope;
134 	bool				bIsBegin;
135 };
136 
137 class DT_MupMember : public DT_MLTag
138 {
139   public:
140 	explicit		    DT_MupMember(           /// Constructor for End-Tag
141 							bool				)	/// Must be there, but is not evaluated.
142 												:	bIsBegin(false) {}
143 						DT_MupMember(           /// Constructor for Begin-Tag
144 							const String &      i_sScope )
145 												:	sScope(i_sScope), bIsBegin(true) {}
146     virtual             ~DT_MupMember();
147 
148 	virtual void		DisplayAt(
149 							DocumentationDisplay &
150 												o_rDisplay ) const;
151 	const String  &		Scope() const			{ return sScope; }
152 	bool				IsBegin() const			{ return bIsBegin; }
153 
154   private:
155 	String 				sScope;
156 	bool				bIsBegin;
157 };
158 
159 class DT_MupConst : public DT_Dsapi
160 {
161   public:
162 						DT_MupConst(
163 							const char *		i_sConstText )
164 												:	sConstText(i_sConstText) {}
165 	virtual             ~DT_MupConst();
166 
167 	virtual void		DisplayAt(
168 							DocumentationDisplay &
169 												o_rDisplay ) const;
170 	const char *		GetText() const			{ return sConstText; }
171 
172   private:
173 	String 				sConstText;				/// Without HTML.
174 };
175 
176 
177 class DT_Style : public DT_MLTag
178 {
179   public:
180 						DT_Style(
181 							const char *		i_sPlainHtmlTag,
182 							bool                i_bNewLine )
183 												: sText(i_sPlainHtmlTag), bNewLine(i_bNewLine) {}
184 	virtual             ~DT_Style();
185 
186 	virtual void		DisplayAt(
187 							DocumentationDisplay &
188 												o_rDisplay ) const;
189 	const char *		GetText() const			{ return sText; }
190 	bool				IsStartOfNewLine() const
191 												{ return bNewLine; }
192   private:
193 	String 				sText;					/// With HTML.
194 	E_Kind              eKind;
195 	bool				bNewLine;
196 };
197 
198 class DT_EOL : public DT_Dsapi
199 {
200   public:
201                         DT_EOL() {}
202     virtual             ~DT_EOL();
203 
204 	virtual void		DisplayAt(
205 							DocumentationDisplay &
206 												o_rDisplay ) const;
207 	virtual bool		IsWhiteOnly() const;
208 };
209 
210 
211 class DT_AtTag : public ary::inf::AtTag2
212 {
213   public:
214 	void            	AddToken(
215 							DYN ary::inf::DocuToken &
216 												let_drToken )
217 												{	aText.AddToken(let_drToken); }
218 	void				SetName(
219 							const char *		i_sName )
220 												{ sTitle = i_sName; }
221 
222   protected:
223 						DT_AtTag(
224 							const char *		i_sTitle )
225 												:	ary::inf::AtTag2(i_sTitle) {}
226 };
227 
228 class DT_StdAtTag : public DT_AtTag
229 {
230   public:
231 	explicit			DT_StdAtTag(
232 							const char *		i_sTitle )
233 												:	DT_AtTag(i_sTitle) {}
234 	virtual             ~DT_StdAtTag();
235 
236 	virtual void		DisplayAt(
237 							DocumentationDisplay &
238 												o_rDisplay ) const;
239 };
240 
241 class DT_SeeAlsoAtTag : public DT_AtTag
242 {
243   public:
244 						DT_SeeAlsoAtTag()		:	DT_AtTag("") {}
245     virtual             ~DT_SeeAlsoAtTag();
246 
247 	virtual void		DisplayAt(
248 							DocumentationDisplay &
249 												o_rDisplay ) const;
250 	const String  &		LinkText() const		{ return sTitle; }	// Missbrauch von sTitle
251 };
252 
253 class DT_ParameterAtTag : public DT_AtTag
254 {
255   public:
256 						DT_ParameterAtTag()		:	DT_AtTag("") {}
257     virtual             ~DT_ParameterAtTag();
258 
259 	void				SetTitle(
260 		                	const char *		i_sTitle );
261 	virtual void		DisplayAt(
262 							DocumentationDisplay &
263 												o_rDisplay ) const;
264 };
265 
266 class DT_SinceAtTag : public DT_AtTag
267 {
268   public:
269 						DT_SinceAtTag()		:	DT_AtTag("Since version") {}
270     virtual             ~DT_SinceAtTag();
271 
272 	virtual void		DisplayAt(
273 							DocumentationDisplay &
274 												o_rDisplay ) const;
275 };
276 
277 
278 }   // namespace dsapi
279 }   // namespace csi
280 
281 #endif
282 
283