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 INCLUDED_CODEMAKER_SOURCE_CPPUMAKER_INCLUDES_HXX 29 #define INCLUDED_CODEMAKER_SOURCE_CPPUMAKER_INCLUDES_HXX 30 31 #include "codemaker/dependencies.hxx" 32 #include "rtl/ustring.hxx" 33 34 class FileStream; 35 class TypeManager; 36 37 namespace codemaker { namespace cppumaker { 38 39 class Includes { 40 public: 41 Includes( 42 TypeManager const & manager, 43 codemaker::Dependencies const & dependencies, bool hpp); 44 45 ~Includes(); 46 47 void add(rtl::OString const & registryType); 48 49 void addAny() { m_includeAny = true; } 50 51 void addReference() { m_includeReference = true; } 52 53 void addSequence() { m_includeSequence = true; } 54 55 void addType() { m_includeType = true; } 56 57 void addCppuMacrosHxx() { m_includeCppuMacrosHxx = true; } 58 59 void addCppuUnotypeHxx() { m_includeCppuUnotypeHxx = true; } 60 61 void addOslDoublecheckedlockingH() 62 { m_includeOslDoublecheckedlockingH = true; } 63 64 void addOslMutexHxx() { m_includeOslMutexHxx = true; } 65 66 void addRtlStrbufHxx() { m_includeRtlStrbufHxx = true; } 67 68 void addRtlStringH() { m_includeRtlStringH = true; } 69 70 void addRtlTextencH() { m_includeRtlTextencH = true; } 71 72 void addRtlUstrbufHxx() { m_includeRtlUstrbufHxx = true; } 73 74 void addRtlUstringH() { m_includeRtlUstringH = true; } 75 76 void addRtlUstringHxx() { m_includeRtlUstringHxx = true; } 77 78 void addSalTypesH() { m_includeSalTypesH = true; } 79 80 void addTypelibTypeclassH() { m_includeTypelibTypeclassH = true; } 81 82 void addTypelibTypedescriptionH() 83 { m_includeTypelibTypedescriptionH = true; } 84 85 void dump(FileStream & out, rtl::OString const * companionHdl); 86 87 static void dumpInclude( 88 FileStream & out, rtl::OString const & registryType, bool hpp, 89 rtl::OString const & suffix = rtl::OString()); 90 91 private: 92 Includes(Includes &); // not implemented 93 void operator =(Includes); // not implemented; 94 95 bool isInterfaceType(rtl::OString const & registryType) const; 96 97 TypeManager const & m_manager; 98 codemaker::Dependencies::Map m_map; 99 bool m_hpp; 100 bool m_includeAny; 101 bool m_includeReference; 102 bool m_includeSequence; 103 bool m_includeType; 104 bool m_includeCppuMacrosHxx; 105 bool m_includeCppuUnotypeHxx; 106 bool m_includeOslDoublecheckedlockingH; 107 bool m_includeOslMutexHxx; 108 bool m_includeRtlStrbufHxx; 109 bool m_includeRtlStringH; 110 bool m_includeRtlTextencH; 111 bool m_includeRtlUstrbufHxx; 112 bool m_includeRtlUstringH; 113 bool m_includeRtlUstringHxx; 114 bool m_includeSalTypesH; 115 bool m_includeTypelibTypeclassH; 116 bool m_includeTypelibTypedescriptionH; 117 }; 118 119 } } 120 121 #endif // INCLUDED_CODEMAKER_SOURCE_CPPUMAKER_INCLUDES_HXX 122