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