Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #ifndef CSI_DSAPI_D_TOKEN_HXX
21 : #define CSI_DSAPI_D_TOKEN_HXX
22 :
23 : // BASE CLASSES
24 : #include <ary_i/ci_text2.hxx>
25 : #include <ary_i/ci_atag2.hxx>
26 :
27 :
28 : namespace ary
29 : {
30 : namespace inf
31 : {
32 : class DocumentationDisplay;
33 : }
34 : }
35 :
36 :
37 :
38 : namespace csi
39 : {
40 : namespace dsapi
41 : {
42 :
43 : using ary::inf::DocumentationDisplay;
44 :
45 :
46 2160467 : class DT_Dsapi : public ary::inf::DocuToken
47 : {
48 : public:
49 : virtual void DisplayAt(
50 : DocumentationDisplay &
51 : o_rDisplay ) const = 0;
52 : virtual bool IsWhiteOnly() const;
53 : };
54 :
55 :
56 :
57 : class DT_TextToken : public DT_Dsapi
58 : {
59 : public:
60 512794 : explicit DT_TextToken(
61 : const char * i_sText )
62 512794 : : sText(i_sText) {}
63 413 : explicit DT_TextToken(
64 : const String & i_sText )
65 413 : : sText(i_sText) {}
66 : virtual ~DT_TextToken();
67 :
68 : virtual void DisplayAt(
69 : DocumentationDisplay &
70 : o_rDisplay ) const;
71 564274 : const char * GetText() const { return sText; }
72 413 : const String & GetTextStr() const { return sText; }
73 :
74 5428 : String & Access_Text() { return sText; }
75 :
76 : virtual bool IsWhiteOnly() const;
77 :
78 : private:
79 : String sText;
80 : };
81 :
82 : class DT_White : public DT_Dsapi
83 : {
84 : public:
85 546612 : DT_White() {}
86 : virtual ~DT_White();
87 :
88 : virtual void DisplayAt(
89 : DocumentationDisplay &
90 : o_rDisplay ) const;
91 : virtual bool IsWhiteOnly() const;
92 : };
93 :
94 : class DT_MupType : public DT_Dsapi
95 : {
96 : public:
97 5961 : explicit DT_MupType() /// Constructor for End-Tag
98 5961 : : bIsBegin(false) {}
99 5962 : explicit DT_MupType( /// Constructor for Begin-Tag
100 : const String & i_sScope )
101 5962 : : sScope(i_sScope), bIsBegin(true) {}
102 : virtual ~DT_MupType();
103 :
104 : virtual void DisplayAt(
105 : DocumentationDisplay &
106 : o_rDisplay ) const;
107 5089 : const String & Scope() const { return sScope; }
108 9859 : bool IsBegin() const { return bIsBegin; }
109 :
110 : private:
111 : String sScope;
112 : bool bIsBegin;
113 : };
114 :
115 : class DT_MupMember : public DT_Dsapi
116 : {
117 : public:
118 2730 : explicit DT_MupMember() /// Constructor for End-Tag
119 2730 : : bIsBegin(false) {}
120 2734 : DT_MupMember( /// Constructor for Begin-Tag
121 : const String & i_sScope )
122 2734 : : sScope(i_sScope), bIsBegin(true) {}
123 : virtual ~DT_MupMember();
124 :
125 : virtual void DisplayAt(
126 : DocumentationDisplay &
127 : o_rDisplay ) const;
128 2619 : const String & Scope() const { return sScope; }
129 5169 : bool IsBegin() const { return bIsBegin; }
130 :
131 : private:
132 : String sScope;
133 : bool bIsBegin;
134 : };
135 :
136 : class DT_MupConst : public DT_Dsapi
137 : {
138 : public:
139 1855 : DT_MupConst(
140 : const char * i_sConstText )
141 1855 : : sConstText(i_sConstText) {}
142 : virtual ~DT_MupConst();
143 :
144 : virtual void DisplayAt(
145 : DocumentationDisplay &
146 : o_rDisplay ) const;
147 2174 : const char * GetText() const { return sConstText; }
148 :
149 : private:
150 : String sConstText; /// Without HTML.
151 : };
152 :
153 :
154 : class DT_Style : public DT_Dsapi
155 : {
156 : public:
157 32453 : DT_Style(
158 : const char * i_sPlainHtmlTag,
159 : bool i_bNewLine )
160 32453 : : sText(i_sPlainHtmlTag), bNewLine(i_bNewLine) {}
161 : virtual ~DT_Style();
162 :
163 : virtual void DisplayAt(
164 : DocumentationDisplay &
165 : o_rDisplay ) const;
166 24853 : const char * GetText() const { return sText; }
167 : bool IsStartOfNewLine() const
168 : { return bNewLine; }
169 : private:
170 : String sText; /// With HTML.
171 : bool bNewLine;
172 : };
173 :
174 : class DT_EOL : public DT_Dsapi
175 : {
176 : public:
177 99573 : DT_EOL() {}
178 : virtual ~DT_EOL();
179 :
180 : virtual void DisplayAt(
181 : DocumentationDisplay &
182 : o_rDisplay ) const;
183 : virtual bool IsWhiteOnly() const;
184 : };
185 :
186 :
187 0 : class DT_AtTag : public ary::inf::AtTag2
188 : {
189 : public:
190 240184 : void AddToken(
191 : DYN ary::inf::DocuToken &
192 : let_drToken )
193 240184 : { aText.AddToken(let_drToken); }
194 6980 : void SetName(
195 : const char * i_sName )
196 6980 : { sTitle = i_sName; }
197 :
198 : protected:
199 12344 : DT_AtTag(
200 : const char * i_sTitle )
201 12344 : : ary::inf::AtTag2(i_sTitle) {}
202 : };
203 :
204 : class DT_StdAtTag : public DT_AtTag
205 : {
206 : public:
207 4068 : explicit DT_StdAtTag(
208 : const char * i_sTitle )
209 4068 : : DT_AtTag(i_sTitle) {}
210 : virtual ~DT_StdAtTag();
211 :
212 : virtual void DisplayAt(
213 : DocumentationDisplay &
214 : o_rDisplay ) const;
215 : };
216 :
217 : class DT_SeeAlsoAtTag : public DT_AtTag
218 : {
219 : public:
220 3495 : DT_SeeAlsoAtTag() : DT_AtTag("") {}
221 : virtual ~DT_SeeAlsoAtTag();
222 :
223 : virtual void DisplayAt(
224 : DocumentationDisplay &
225 : o_rDisplay ) const;
226 1615 : const String & LinkText() const { return sTitle; } // abuse of sTitle
227 : };
228 :
229 : class DT_ParameterAtTag : public DT_AtTag
230 : {
231 : public:
232 3489 : DT_ParameterAtTag() : DT_AtTag("") {}
233 : virtual ~DT_ParameterAtTag();
234 :
235 : void SetTitle(
236 : const char * i_sTitle );
237 : virtual void DisplayAt(
238 : DocumentationDisplay &
239 : o_rDisplay ) const;
240 : };
241 :
242 : class DT_SinceAtTag : public DT_AtTag
243 : {
244 : public:
245 1292 : DT_SinceAtTag() : DT_AtTag("Since version") {}
246 : virtual ~DT_SinceAtTag();
247 :
248 : virtual void DisplayAt(
249 : DocumentationDisplay &
250 : o_rDisplay ) const;
251 : };
252 :
253 :
254 : } // namespace dsapi
255 : } // namespace csi
256 :
257 : #endif
258 :
259 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|