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 DSAPI_CX_DOCU2_HXX
21 : #define DSAPI_CX_DOCU2_HXX
22 :
23 : // USED SERVICES
24 : // BASE CLASSES
25 : #include <tokens/tkpcont2.hxx>
26 : // COMPONENTS
27 : // PARAMETERS
28 : #include <s2_dsapi/tk_xml.hxx>
29 :
30 : namespace csi
31 : {
32 : namespace dsapi
33 : {
34 :
35 : class Token_Receiver;
36 :
37 :
38 : /**
39 : @descr
40 : */
41 :
42 21 : class Cx_Base : public ::TkpContext
43 : {
44 : public:
45 : virtual bool PassNewToken();
46 : virtual TkpContext &
47 : FollowUpContext();
48 : protected:
49 : // LIFECYCLE
50 21 : Cx_Base(
51 : Token_Receiver & o_rReceiver,
52 : TkpContext & i_rFollowUpContext )
53 : : rReceiver(o_rReceiver),
54 21 : pFollowUpContext(&i_rFollowUpContext)
55 : // pNewToken
56 21 : { }
57 : protected:
58 71720 : void SetToken(
59 : DYN Token * let_dpToken )
60 71720 : { pNewToken = let_dpToken; }
61 : void Handle_DocuSyntaxError(
62 : CharacterSource & io_rText );
63 :
64 : private:
65 : // DATA
66 : Token_Receiver & rReceiver;
67 : TkpContext * pFollowUpContext;
68 : Dyn<Token> pNewToken;
69 : };
70 :
71 :
72 6 : class Cx_EoHtml : public Cx_Base
73 : {
74 : public:
75 : // LIFECYCLE
76 3 : Cx_EoHtml(
77 : Token_Receiver & o_rReceiver,
78 : TkpContext & i_rFollowUpContext )
79 3 : : Cx_Base(o_rReceiver, i_rFollowUpContext) {}
80 : // OPERATIONS
81 : virtual void ReadCharChain(
82 : CharacterSource & io_rText );
83 27471 : void SetIfIsStartOfParagraph(
84 : bool i_bNextTokenProperty )
85 27471 : { bToken_IsStartOfParagraph = i_bNextTokenProperty; }
86 :
87 : private:
88 : bool bToken_IsStartOfParagraph;
89 : };
90 :
91 6 : class Cx_EoXmlConst : public Cx_Base
92 : {
93 : public:
94 : // LIFECYCLE
95 3 : Cx_EoXmlConst(
96 : Token_Receiver & o_rReceiver,
97 : TkpContext & i_rFollowUpContext )
98 3 : : Cx_Base(o_rReceiver, i_rFollowUpContext) {}
99 : // OPERATIONS
100 : virtual void ReadCharChain(
101 : CharacterSource & io_rText );
102 1855 : void SetTokenId(
103 : lux::Enum< Tok_XmlConst::E_TokenId >
104 : i_eTokenId )
105 1855 : { eTokenId = i_eTokenId; }
106 : private:
107 : Tok_XmlConst::EV_TokenId
108 : eTokenId;
109 : };
110 :
111 6 : class Cx_EoXmlLink_BeginTag : public Cx_Base
112 : {
113 : public:
114 : // LIFECYCLE
115 3 : Cx_EoXmlLink_BeginTag(
116 : Token_Receiver & o_rReceiver,
117 : TkpContext & i_rFollowUpContext )
118 3 : : Cx_Base(o_rReceiver, i_rFollowUpContext) {}
119 : // OPERATIONS
120 : virtual void ReadCharChain(
121 : CharacterSource & io_rText );
122 9570 : void SetTokenId(
123 : Tok_XmlLink_BeginTag::EV_TokenId
124 : i_eTokenId )
125 9570 : { eTokenId = i_eTokenId; }
126 : private:
127 : Tok_XmlLink_BeginTag::EV_TokenId
128 : eTokenId;
129 : };
130 :
131 6 : class Cx_EoXmlLink_EndTag : public Cx_Base
132 : {
133 : public:
134 : // LIFECYCLE
135 3 : Cx_EoXmlLink_EndTag(
136 : Token_Receiver & o_rReceiver,
137 : TkpContext & i_rFollowUpContext )
138 3 : : Cx_Base(o_rReceiver, i_rFollowUpContext) {}
139 : // OPERATIONS
140 : virtual void ReadCharChain(
141 : CharacterSource & io_rText );
142 9561 : void SetTokenId(
143 : Tok_XmlLink_EndTag::EV_TokenId
144 : i_eTokenId )
145 9561 : { eTokenId = i_eTokenId; }
146 : private:
147 : Tok_XmlLink_EndTag::E_TokenId
148 : eTokenId;
149 : };
150 :
151 6 : class Cx_EoXmlFormat_BeginTag : public Cx_Base
152 : {
153 : public:
154 : // LIFECYCLE
155 3 : Cx_EoXmlFormat_BeginTag(
156 : Token_Receiver & o_rReceiver,
157 : TkpContext & i_rFollowUpContext )
158 3 : : Cx_Base(o_rReceiver, i_rFollowUpContext) {}
159 : // OPERATIONS
160 : virtual void ReadCharChain(
161 : CharacterSource & io_rText );
162 1648 : void SetTokenId(
163 : lux::Enum< Tok_XmlFormat_BeginTag::E_TokenId >
164 : i_eTokenId )
165 1648 : { eTokenId = i_eTokenId; }
166 : private:
167 : lux::Enum< Tok_XmlFormat_BeginTag::E_TokenId >
168 : eTokenId;
169 : };
170 :
171 6 : class Cx_EoXmlFormat_EndTag : public Cx_Base
172 : {
173 : public:
174 : // LIFECYCLE
175 3 : Cx_EoXmlFormat_EndTag(
176 : Token_Receiver & o_rReceiver,
177 : TkpContext & i_rFollowUpContext )
178 3 : : Cx_Base(o_rReceiver, i_rFollowUpContext) {}
179 : // OPERATIONS
180 : virtual void ReadCharChain(
181 : CharacterSource & io_rText );
182 1639 : void SetTokenId(
183 : lux::Enum< Tok_XmlFormat_EndTag::E_TokenId >
184 : i_eTokenId )
185 1639 : { eTokenId = i_eTokenId; }
186 : private:
187 : lux::Enum< Tok_XmlFormat_EndTag::E_TokenId >
188 : eTokenId;
189 : };
190 :
191 6 : class Cx_CheckStar : public Cx_Base
192 : {
193 : public:
194 : // LIFECYCLE
195 3 : Cx_CheckStar(
196 : Token_Receiver & o_rReceiver,
197 : TkpContext & i_rFollowUpContext )
198 : : Cx_Base(o_rReceiver, i_rFollowUpContext),
199 3 : bIsEnd(false), bEndTokenFound(false)
200 3 : { }
201 3 : void Set_End_FolloUpContext(
202 : TkpContext & i_rEnd_FollowUpContext )
203 3 : { pEnd_FollowUpContext = &i_rEnd_FollowUpContext; }
204 :
205 : virtual void ReadCharChain(
206 : CharacterSource & io_rText );
207 19976 : void SetIsEnd(
208 : bool i_bIsEnd )
209 19976 : { bIsEnd = i_bIsEnd; }
210 : virtual TkpContext &
211 : FollowUpContext();
212 : private:
213 : TkpContext * pEnd_FollowUpContext;
214 : bool bIsEnd;
215 : bool bEndTokenFound;
216 : };
217 :
218 :
219 : } // namespace dsapi
220 : } // namespace csi
221 :
222 :
223 :
224 : #endif
225 :
226 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|