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 ADC_CX_DSAPI_HXX 29 #define ADC_CX_DSAPI_HXX 30 31 // USED SERVICES 32 // BASE CLASSES 33 #include <tokens/tkpcont2.hxx> 34 // COMPONENTS 35 #include <cosv/tpl/dyn.hxx> 36 #include <tokens/tkpstam2.hxx> 37 // PARAMETERS 38 39 40 namespace csi 41 { 42 namespace dsapi 43 { 44 45 class Token_Receiver; 46 class Token; 47 48 class Cx_EoHtml; 49 class Cx_EoXmlConst; 50 class Cx_EoXmlLink_BeginTag; 51 class Cx_EoXmlLink_EndTag; 52 class Cx_EoXmlFormat_BeginTag; 53 class Cx_EoXmlFormat_EndTag; 54 class Cx_CheckStar; 55 56 /** 57 @descr 58 */ 59 class Context_Docu : public TkpDocuContext, 60 private StateMachineContext 61 { 62 public: 63 // LIFECYCLE 64 Context_Docu( 65 Token_Receiver & o_rReceiver ); 66 virtual void SetParentContext( 67 TkpContext & io_rParentContext, 68 const char * i_sMultiLineEndToken ); 69 70 ~Context_Docu(); 71 // OPERATIONS 72 virtual void ReadCharChain( 73 CharacterSource & io_rText ); 74 75 virtual bool PassNewToken(); 76 virtual void SetMode_IsMultiLine( 77 bool i_bTrue ); 78 79 // INQUIRY 80 virtual TkpContext & 81 FollowUpContext(); 82 private: 83 // SERVICE FUNCTIONS 84 virtual void PerformStatusFunction( 85 uintt i_nStatusSignal, 86 UINT16 i_nTokenId, 87 CharacterSource & io_rText ); 88 89 void SetupStateMachine(); 90 91 // DATA 92 StateMachin2 aStateMachine; 93 Token_Receiver * pReceiver; 94 95 // Contexts 96 TkpContext * pParentContext; 97 String sMultiLineEndToken; 98 99 Dyn<Cx_EoHtml> pCx_EoHtml; 100 Dyn<Cx_EoXmlConst> pCx_EoXmlConst; 101 Dyn<Cx_EoXmlLink_BeginTag> 102 pCx_EoXmlLink_BeginTag; 103 Dyn<Cx_EoXmlLink_EndTag> 104 pCx_EoXmlLink_EndTag; 105 Dyn<Cx_EoXmlFormat_BeginTag> 106 pCx_EoXmlFormat_BeginTag; 107 Dyn<Cx_EoXmlFormat_EndTag> 108 pCx_EoXmlFormat_EndTag; 109 Dyn<Cx_CheckStar> pCx_CheckStar; 110 111 // Temporary data, used during ReadCharChain() 112 Dyn<Token> pNewToken; 113 ::TkpContext * pFollowUpContext; 114 bool bIsMultiline; 115 }; 116 117 118 } // namespace dsapi 119 } // namespace csi 120 121 122 #endif 123 124