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