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_UIDL_PE_ENUM2_HXX 29 #define ADC_UIDL_PE_ENUM2_HXX 30 31 32 33 // USED SERVICES 34 // BASE CLASSES 35 #include <s2_luidl/parsenv2.hxx> 36 #include <s2_luidl/pestate.hxx> 37 // COMPONENTS 38 // PARAMETERS 39 40 41 42 namespace csi 43 { 44 namespace uidl 45 { 46 47 // class Enum; 48 49 class PE_Value; 50 51 class PE_Enum : public UnoIDL_PE, 52 public ParseEnvState 53 { 54 public: 55 PE_Enum(); 56 virtual void EstablishContacts( 57 UnoIDL_PE * io_pParentPE, 58 ary::Repository & io_rRepository, 59 TokenProcessing_Result & 60 o_rResult ); 61 ~PE_Enum(); 62 63 virtual void ProcessToken( 64 const Token & i_rToken ); 65 66 virtual void Process_Identifier( 67 const TokIdentifier & 68 i_rToken ); 69 virtual void Process_Punctuation( 70 const TokPunctuation & 71 i_rToken ); 72 73 private: 74 enum E_State 75 { 76 e_none, 77 expect_name, 78 expect_curl_bracket_open, 79 expect_value, 80 expect_finish, 81 e_STATES_MAX 82 }; 83 enum E_TokenType 84 { 85 tt_identifier, 86 tt_punctuation, 87 tt_MAX 88 }; 89 typedef void (PE_Enum::*F_TOK)(const char *); 90 91 92 void CallHandler( 93 const char * i_sTokenText, 94 E_TokenType i_eTokenType ); 95 96 void On_expect_name_Identifier(const char * i_sText); 97 void On_expect_curl_bracket_open_Punctuation(const char * i_sText); 98 void On_expect_value_Punctuation(const char * i_sText); 99 void On_expect_value_Identifier(const char * i_sText); 100 void On_expect_finish_Punctuation(const char * i_sText); 101 void On_Default(const char * ); 102 103 void EmptySingleValueData(); 104 void CreateSingleValue(); 105 106 virtual void InitData(); 107 virtual void ReceiveData(); 108 virtual void TransferData(); 109 virtual UnoIDL_PE & MyPE(); 110 111 // DATA 112 static F_TOK aDispatcher[e_STATES_MAX][tt_MAX]; 113 114 E_State eState; 115 116 String sData_Name; 117 ary::idl::Ce_id nDataId; 118 119 Dyn<PE_Value> pPE_Value; 120 String sName; 121 String sAssignment; 122 }; 123 124 125 126 } // namespace uidl 127 } // namespace csi 128 129 130 #endif 131 132