1*1c78a5d6SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*1c78a5d6SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*1c78a5d6SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*1c78a5d6SAndrew Rist * distributed with this work for additional information 6*1c78a5d6SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*1c78a5d6SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*1c78a5d6SAndrew Rist * "License"); you may not use this file except in compliance 9*1c78a5d6SAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 11*1c78a5d6SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 13*1c78a5d6SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*1c78a5d6SAndrew Rist * software distributed under the License is distributed on an 15*1c78a5d6SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*1c78a5d6SAndrew Rist * KIND, either express or implied. See the License for the 17*1c78a5d6SAndrew Rist * specific language governing permissions and limitations 18*1c78a5d6SAndrew Rist * under the License. 19cdf0e10cSrcweir * 20*1c78a5d6SAndrew Rist *************************************************************/ 21*1c78a5d6SAndrew Rist 22*1c78a5d6SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef DSAPI_CX_DOCU2_HXX 25cdf0e10cSrcweir #define DSAPI_CX_DOCU2_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir // USED SERVICES 28cdf0e10cSrcweir // BASE CLASSES 29cdf0e10cSrcweir #include <tokens/tkpcont2.hxx> 30cdf0e10cSrcweir // COMPONENTS 31cdf0e10cSrcweir // PARAMETERS 32cdf0e10cSrcweir #include <s2_dsapi/tk_xml.hxx> 33cdf0e10cSrcweir 34cdf0e10cSrcweir namespace csi 35cdf0e10cSrcweir { 36cdf0e10cSrcweir namespace dsapi 37cdf0e10cSrcweir { 38cdf0e10cSrcweir 39cdf0e10cSrcweir class Token_Receiver; 40cdf0e10cSrcweir 41cdf0e10cSrcweir 42cdf0e10cSrcweir /** 43cdf0e10cSrcweir @descr 44cdf0e10cSrcweir */ 45cdf0e10cSrcweir 46cdf0e10cSrcweir class Cx_Base : public ::TkpContext 47cdf0e10cSrcweir { 48cdf0e10cSrcweir public: 49cdf0e10cSrcweir virtual bool PassNewToken(); 50cdf0e10cSrcweir virtual TkpContext & 51cdf0e10cSrcweir FollowUpContext(); 52cdf0e10cSrcweir protected: 53cdf0e10cSrcweir // LIFECYCLE Cx_Base(Token_Receiver & o_rReceiver,TkpContext & i_rFollowUpContext)54cdf0e10cSrcweir Cx_Base( 55cdf0e10cSrcweir Token_Receiver & o_rReceiver, 56cdf0e10cSrcweir TkpContext & i_rFollowUpContext ) 57cdf0e10cSrcweir : rReceiver(o_rReceiver), 58cdf0e10cSrcweir pFollowUpContext(&i_rFollowUpContext) 59cdf0e10cSrcweir // pNewToken 60cdf0e10cSrcweir { } 61cdf0e10cSrcweir protected: SetToken(DYN Token * let_dpToken)62cdf0e10cSrcweir void SetToken( 63cdf0e10cSrcweir DYN Token * let_dpToken ) 64cdf0e10cSrcweir { pNewToken = let_dpToken; } 65cdf0e10cSrcweir void Handle_DocuSyntaxError( 66cdf0e10cSrcweir CharacterSource & io_rText ); 67cdf0e10cSrcweir 68cdf0e10cSrcweir private: 69cdf0e10cSrcweir // DATA 70cdf0e10cSrcweir Token_Receiver & rReceiver; 71cdf0e10cSrcweir TkpContext * pFollowUpContext; 72cdf0e10cSrcweir Dyn<Token> pNewToken; 73cdf0e10cSrcweir }; 74cdf0e10cSrcweir 75cdf0e10cSrcweir 76cdf0e10cSrcweir class Cx_EoHtml : public Cx_Base 77cdf0e10cSrcweir { 78cdf0e10cSrcweir public: 79cdf0e10cSrcweir // LIFECYCLE Cx_EoHtml(Token_Receiver & o_rReceiver,TkpContext & i_rFollowUpContext)80cdf0e10cSrcweir Cx_EoHtml( 81cdf0e10cSrcweir Token_Receiver & o_rReceiver, 82cdf0e10cSrcweir TkpContext & i_rFollowUpContext ) 83cdf0e10cSrcweir : Cx_Base(o_rReceiver, i_rFollowUpContext) {} 84cdf0e10cSrcweir // OPERATIONS 85cdf0e10cSrcweir virtual void ReadCharChain( 86cdf0e10cSrcweir CharacterSource & io_rText ); SetIfIsStartOfParagraph(bool i_bNextTokenProperty)87cdf0e10cSrcweir void SetIfIsStartOfParagraph( 88cdf0e10cSrcweir bool i_bNextTokenProperty ) 89cdf0e10cSrcweir { bToken_IsStartOfParagraph = i_bNextTokenProperty; } 90cdf0e10cSrcweir 91cdf0e10cSrcweir private: 92cdf0e10cSrcweir bool bToken_IsStartOfParagraph; 93cdf0e10cSrcweir }; 94cdf0e10cSrcweir 95cdf0e10cSrcweir class Cx_EoXmlConst : public Cx_Base 96cdf0e10cSrcweir { 97cdf0e10cSrcweir public: 98cdf0e10cSrcweir // LIFECYCLE Cx_EoXmlConst(Token_Receiver & o_rReceiver,TkpContext & i_rFollowUpContext)99cdf0e10cSrcweir Cx_EoXmlConst( 100cdf0e10cSrcweir Token_Receiver & o_rReceiver, 101cdf0e10cSrcweir TkpContext & i_rFollowUpContext ) 102cdf0e10cSrcweir : Cx_Base(o_rReceiver, i_rFollowUpContext) {} 103cdf0e10cSrcweir // OPERATIONS 104cdf0e10cSrcweir virtual void ReadCharChain( 105cdf0e10cSrcweir CharacterSource & io_rText ); SetTokenId(lux::Enum<Tok_XmlConst::E_TokenId> i_eTokenId)106cdf0e10cSrcweir void SetTokenId( 107cdf0e10cSrcweir lux::Enum< Tok_XmlConst::E_TokenId > 108cdf0e10cSrcweir i_eTokenId ) 109cdf0e10cSrcweir { eTokenId = i_eTokenId; } 110cdf0e10cSrcweir private: 111cdf0e10cSrcweir Tok_XmlConst::EV_TokenId 112cdf0e10cSrcweir eTokenId; 113cdf0e10cSrcweir }; 114cdf0e10cSrcweir 115cdf0e10cSrcweir class Cx_EoXmlLink_BeginTag : public Cx_Base 116cdf0e10cSrcweir { 117cdf0e10cSrcweir public: 118cdf0e10cSrcweir // LIFECYCLE Cx_EoXmlLink_BeginTag(Token_Receiver & o_rReceiver,TkpContext & i_rFollowUpContext)119cdf0e10cSrcweir Cx_EoXmlLink_BeginTag( 120cdf0e10cSrcweir Token_Receiver & o_rReceiver, 121cdf0e10cSrcweir TkpContext & i_rFollowUpContext ) 122cdf0e10cSrcweir : Cx_Base(o_rReceiver, i_rFollowUpContext) {} 123cdf0e10cSrcweir // OPERATIONS 124cdf0e10cSrcweir virtual void ReadCharChain( 125cdf0e10cSrcweir CharacterSource & io_rText ); SetTokenId(Tok_XmlLink_BeginTag::EV_TokenId i_eTokenId)126cdf0e10cSrcweir void SetTokenId( 127cdf0e10cSrcweir Tok_XmlLink_BeginTag::EV_TokenId 128cdf0e10cSrcweir i_eTokenId ) 129cdf0e10cSrcweir { eTokenId = i_eTokenId; } 130cdf0e10cSrcweir private: 131cdf0e10cSrcweir Tok_XmlLink_BeginTag::EV_TokenId 132cdf0e10cSrcweir eTokenId; 133cdf0e10cSrcweir }; 134cdf0e10cSrcweir 135cdf0e10cSrcweir class Cx_EoXmlLink_EndTag : public Cx_Base 136cdf0e10cSrcweir { 137cdf0e10cSrcweir public: 138cdf0e10cSrcweir // LIFECYCLE Cx_EoXmlLink_EndTag(Token_Receiver & o_rReceiver,TkpContext & i_rFollowUpContext)139cdf0e10cSrcweir Cx_EoXmlLink_EndTag( 140cdf0e10cSrcweir Token_Receiver & o_rReceiver, 141cdf0e10cSrcweir TkpContext & i_rFollowUpContext ) 142cdf0e10cSrcweir : Cx_Base(o_rReceiver, i_rFollowUpContext) {} 143cdf0e10cSrcweir // OPERATIONS 144cdf0e10cSrcweir virtual void ReadCharChain( 145cdf0e10cSrcweir CharacterSource & io_rText ); SetTokenId(Tok_XmlLink_EndTag::EV_TokenId i_eTokenId)146cdf0e10cSrcweir void SetTokenId( 147cdf0e10cSrcweir Tok_XmlLink_EndTag::EV_TokenId 148cdf0e10cSrcweir i_eTokenId ) 149cdf0e10cSrcweir { eTokenId = i_eTokenId; } 150cdf0e10cSrcweir private: 151cdf0e10cSrcweir Tok_XmlLink_EndTag::E_TokenId 152cdf0e10cSrcweir eTokenId; 153cdf0e10cSrcweir }; 154cdf0e10cSrcweir 155cdf0e10cSrcweir class Cx_EoXmlFormat_BeginTag : public Cx_Base 156cdf0e10cSrcweir { 157cdf0e10cSrcweir public: 158cdf0e10cSrcweir // LIFECYCLE Cx_EoXmlFormat_BeginTag(Token_Receiver & o_rReceiver,TkpContext & i_rFollowUpContext)159cdf0e10cSrcweir Cx_EoXmlFormat_BeginTag( 160cdf0e10cSrcweir Token_Receiver & o_rReceiver, 161cdf0e10cSrcweir TkpContext & i_rFollowUpContext ) 162cdf0e10cSrcweir : Cx_Base(o_rReceiver, i_rFollowUpContext) {} 163cdf0e10cSrcweir // OPERATIONS 164cdf0e10cSrcweir virtual void ReadCharChain( 165cdf0e10cSrcweir CharacterSource & io_rText ); SetTokenId(lux::Enum<Tok_XmlFormat_BeginTag::E_TokenId> i_eTokenId)166cdf0e10cSrcweir void SetTokenId( 167cdf0e10cSrcweir lux::Enum< Tok_XmlFormat_BeginTag::E_TokenId > 168cdf0e10cSrcweir i_eTokenId ) 169cdf0e10cSrcweir { eTokenId = i_eTokenId; } 170cdf0e10cSrcweir private: 171cdf0e10cSrcweir lux::Enum< Tok_XmlFormat_BeginTag::E_TokenId > 172cdf0e10cSrcweir eTokenId; 173cdf0e10cSrcweir }; 174cdf0e10cSrcweir 175cdf0e10cSrcweir class Cx_EoXmlFormat_EndTag : public Cx_Base 176cdf0e10cSrcweir { 177cdf0e10cSrcweir public: 178cdf0e10cSrcweir // LIFECYCLE Cx_EoXmlFormat_EndTag(Token_Receiver & o_rReceiver,TkpContext & i_rFollowUpContext)179cdf0e10cSrcweir Cx_EoXmlFormat_EndTag( 180cdf0e10cSrcweir Token_Receiver & o_rReceiver, 181cdf0e10cSrcweir TkpContext & i_rFollowUpContext ) 182cdf0e10cSrcweir : Cx_Base(o_rReceiver, i_rFollowUpContext) {} 183cdf0e10cSrcweir // OPERATIONS 184cdf0e10cSrcweir virtual void ReadCharChain( 185cdf0e10cSrcweir CharacterSource & io_rText ); SetTokenId(lux::Enum<Tok_XmlFormat_EndTag::E_TokenId> i_eTokenId)186cdf0e10cSrcweir void SetTokenId( 187cdf0e10cSrcweir lux::Enum< Tok_XmlFormat_EndTag::E_TokenId > 188cdf0e10cSrcweir i_eTokenId ) 189cdf0e10cSrcweir { eTokenId = i_eTokenId; } 190cdf0e10cSrcweir private: 191cdf0e10cSrcweir lux::Enum< Tok_XmlFormat_EndTag::E_TokenId > 192cdf0e10cSrcweir eTokenId; 193cdf0e10cSrcweir }; 194cdf0e10cSrcweir 195cdf0e10cSrcweir class Cx_CheckStar : public Cx_Base 196cdf0e10cSrcweir { 197cdf0e10cSrcweir public: 198cdf0e10cSrcweir // LIFECYCLE Cx_CheckStar(Token_Receiver & o_rReceiver,TkpContext & i_rFollowUpContext)199cdf0e10cSrcweir Cx_CheckStar( 200cdf0e10cSrcweir Token_Receiver & o_rReceiver, 201cdf0e10cSrcweir TkpContext & i_rFollowUpContext ) 202cdf0e10cSrcweir : Cx_Base(o_rReceiver, i_rFollowUpContext), 203cdf0e10cSrcweir bIsEnd(false), bEndTokenFound(false) 204cdf0e10cSrcweir { } Set_End_FolloUpContext(TkpContext & i_rEnd_FollowUpContext)205cdf0e10cSrcweir void Set_End_FolloUpContext( 206cdf0e10cSrcweir TkpContext & i_rEnd_FollowUpContext ) 207cdf0e10cSrcweir { pEnd_FollowUpContext = &i_rEnd_FollowUpContext; } 208cdf0e10cSrcweir 209cdf0e10cSrcweir virtual void ReadCharChain( 210cdf0e10cSrcweir CharacterSource & io_rText ); SetIsEnd(bool i_bIsEnd)211cdf0e10cSrcweir void SetIsEnd( 212cdf0e10cSrcweir bool i_bIsEnd ) 213cdf0e10cSrcweir { bIsEnd = i_bIsEnd; } 214cdf0e10cSrcweir virtual TkpContext & 215cdf0e10cSrcweir FollowUpContext(); 216cdf0e10cSrcweir private: 217cdf0e10cSrcweir TkpContext * pEnd_FollowUpContext; 218cdf0e10cSrcweir bool bIsEnd; 219cdf0e10cSrcweir bool bEndTokenFound; 220cdf0e10cSrcweir }; 221cdf0e10cSrcweir 222cdf0e10cSrcweir 223cdf0e10cSrcweir } // namespace dsapi 224cdf0e10cSrcweir } // namespace csi 225cdf0e10cSrcweir 226cdf0e10cSrcweir 227cdf0e10cSrcweir 228cdf0e10cSrcweir #endif 229cdf0e10cSrcweir 230