1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef DSAPI_CX_DOCU2_HXX
21 #define DSAPI_CX_DOCU2_HXX
25 #include <tokens/tkpcont2.hxx>
28 #include <s2_dsapi/tk_xml.hxx>
42 class Cx_Base
: public ::TkpContext
45 virtual bool PassNewToken();
51 Token_Receiver
& o_rReceiver
,
52 TkpContext
& i_rFollowUpContext
)
53 : rReceiver(o_rReceiver
),
54 pFollowUpContext(&i_rFollowUpContext
)
59 DYN Token
* let_dpToken
)
60 { pNewToken
= let_dpToken
; }
61 void Handle_DocuSyntaxError(
62 CharacterSource
& io_rText
);
66 Token_Receiver
& rReceiver
;
67 TkpContext
* pFollowUpContext
;
72 class Cx_EoHtml
: public Cx_Base
77 Token_Receiver
& o_rReceiver
,
78 TkpContext
& i_rFollowUpContext
)
79 : Cx_Base(o_rReceiver
, i_rFollowUpContext
) {}
81 virtual void ReadCharChain(
82 CharacterSource
& io_rText
);
83 void SetIfIsStartOfParagraph(
84 bool i_bNextTokenProperty
)
85 { bToken_IsStartOfParagraph
= i_bNextTokenProperty
; }
88 bool bToken_IsStartOfParagraph
;
91 class Cx_EoXmlConst
: public Cx_Base
96 Token_Receiver
& o_rReceiver
,
97 TkpContext
& i_rFollowUpContext
)
98 : Cx_Base(o_rReceiver
, i_rFollowUpContext
) {}
100 virtual void ReadCharChain(
101 CharacterSource
& io_rText
);
103 lux::Enum
< Tok_XmlConst::E_TokenId
>
105 { eTokenId
= i_eTokenId
; }
107 Tok_XmlConst::EV_TokenId
111 class Cx_EoXmlLink_BeginTag
: public Cx_Base
115 Cx_EoXmlLink_BeginTag(
116 Token_Receiver
& o_rReceiver
,
117 TkpContext
& i_rFollowUpContext
)
118 : Cx_Base(o_rReceiver
, i_rFollowUpContext
) {}
120 virtual void ReadCharChain(
121 CharacterSource
& io_rText
);
123 Tok_XmlLink_BeginTag::EV_TokenId
125 { eTokenId
= i_eTokenId
; }
127 Tok_XmlLink_BeginTag::EV_TokenId
131 class Cx_EoXmlLink_EndTag
: public Cx_Base
136 Token_Receiver
& o_rReceiver
,
137 TkpContext
& i_rFollowUpContext
)
138 : Cx_Base(o_rReceiver
, i_rFollowUpContext
) {}
140 virtual void ReadCharChain(
141 CharacterSource
& io_rText
);
143 Tok_XmlLink_EndTag::EV_TokenId
145 { eTokenId
= i_eTokenId
; }
147 Tok_XmlLink_EndTag::E_TokenId
151 class Cx_EoXmlFormat_BeginTag
: public Cx_Base
155 Cx_EoXmlFormat_BeginTag(
156 Token_Receiver
& o_rReceiver
,
157 TkpContext
& i_rFollowUpContext
)
158 : Cx_Base(o_rReceiver
, i_rFollowUpContext
) {}
160 virtual void ReadCharChain(
161 CharacterSource
& io_rText
);
163 lux::Enum
< Tok_XmlFormat_BeginTag::E_TokenId
>
165 { eTokenId
= i_eTokenId
; }
167 lux::Enum
< Tok_XmlFormat_BeginTag::E_TokenId
>
171 class Cx_EoXmlFormat_EndTag
: public Cx_Base
175 Cx_EoXmlFormat_EndTag(
176 Token_Receiver
& o_rReceiver
,
177 TkpContext
& i_rFollowUpContext
)
178 : Cx_Base(o_rReceiver
, i_rFollowUpContext
) {}
180 virtual void ReadCharChain(
181 CharacterSource
& io_rText
);
183 lux::Enum
< Tok_XmlFormat_EndTag::E_TokenId
>
185 { eTokenId
= i_eTokenId
; }
187 lux::Enum
< Tok_XmlFormat_EndTag::E_TokenId
>
191 class Cx_CheckStar
: public Cx_Base
196 Token_Receiver
& o_rReceiver
,
197 TkpContext
& i_rFollowUpContext
)
198 : Cx_Base(o_rReceiver
, i_rFollowUpContext
),
199 bIsEnd(false), bEndTokenFound(false)
201 void Set_End_FolloUpContext(
202 TkpContext
& i_rEnd_FollowUpContext
)
203 { pEnd_FollowUpContext
= &i_rEnd_FollowUpContext
; }
205 virtual void ReadCharChain(
206 CharacterSource
& io_rText
);
209 { bIsEnd
= i_bIsEnd
; }
213 TkpContext
* pEnd_FollowUpContext
;
226 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */