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_CPP_C_DEALER_HXX 29 #define ADC_CPP_C_DEALER_HXX 30 31 32 33 // USED SERVICES 34 // BASE CLASSES 35 #include <cpp/ctokdeal.hxx> 36 #include <adoc/atokdeal.hxx> 37 #include <ary/info/docstore.hxx> 38 // COMPONENTS 39 #include "preproc.hxx" 40 #include "c_rcode.hxx" 41 #include <adoc/a_rdocu.hxx> 42 // PARAMETERS 43 44 namespace csv 45 { 46 namespace ploc 47 { 48 class Path; 49 class DirectoryChain; 50 } 51 } 52 53 54 class TokenParser; 55 56 57 namespace cpp 58 { 59 60 class PE_File; 61 class DefineDescription; 62 63 64 class Distributor : public cpp::TokenDealer, /// Handle C++ code tokens. 65 public adoc::TokenDealer /// Handle Autodoc documentation tokens. 66 { 67 public: 68 typedef std::map< String, DefineDescription* > MacroMap; 69 70 // LIFECYCLE 71 Distributor( 72 ary::cpp::Gate & io_rGate ); 73 ~Distributor(); 74 // OPERATIONS 75 void AssignPartners( 76 CharacterSource & io_rSourceText, 77 const MacroMap & i_rValidMacros ); 78 void StartNewFile( 79 const csv::ploc::Path & 80 i_file ); 81 virtual void Deal_Eol(); 82 virtual void Deal_Eof(); 83 84 virtual void Deal_CppCode( 85 cpp::Token & let_drToken ); 86 virtual void Deal_Cpp_UnblockMacro( 87 Tok_UnblockMacro & let_drToken ); 88 89 virtual void Deal_AdcDocu( 90 adoc::Token & let_drToken ); 91 virtual Distributor * 92 AsDistributor(); 93 private: 94 // DATA 95 PreProcessor aCppPreProcessor; 96 CodeExplorer aCodeExplorer; 97 adoc::DocuExplorer aDocuExplorer; 98 ary::cpp::Gate * pGate; 99 FileScope_EventHandler * 100 pFileEventHandler; 101 DocuDealer * pDocuDistributor; 102 }; 103 104 105 106 } // namespace cpp 107 #endif 108 109