1*2037b4deSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*2037b4deSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*2037b4deSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*2037b4deSAndrew Rist  * distributed with this work for additional information
6*2037b4deSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*2037b4deSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*2037b4deSAndrew Rist  * "License"); you may not use this file except in compliance
9*2037b4deSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*2037b4deSAndrew Rist  *
11*2037b4deSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*2037b4deSAndrew Rist  *
13*2037b4deSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*2037b4deSAndrew Rist  * software distributed under the License is distributed on an
15*2037b4deSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*2037b4deSAndrew Rist  * KIND, either express or implied.  See the License for the
17*2037b4deSAndrew Rist  * specific language governing permissions and limitations
18*2037b4deSAndrew Rist  * under the License.
19*2037b4deSAndrew Rist  *
20*2037b4deSAndrew Rist  *************************************************************/
21*2037b4deSAndrew Rist 
22*2037b4deSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef INCLUDED_CODEMAKER_SOURCE_CPPUMAKER_INCLUDES_HXX
25cdf0e10cSrcweir #define INCLUDED_CODEMAKER_SOURCE_CPPUMAKER_INCLUDES_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include "codemaker/dependencies.hxx"
28cdf0e10cSrcweir #include "rtl/ustring.hxx"
29cdf0e10cSrcweir 
30cdf0e10cSrcweir class FileStream;
31cdf0e10cSrcweir class TypeManager;
32cdf0e10cSrcweir 
33cdf0e10cSrcweir namespace codemaker { namespace cppumaker {
34cdf0e10cSrcweir 
35cdf0e10cSrcweir class Includes {
36cdf0e10cSrcweir public:
37cdf0e10cSrcweir     Includes(
38cdf0e10cSrcweir         TypeManager const & manager,
39cdf0e10cSrcweir         codemaker::Dependencies const & dependencies, bool hpp);
40cdf0e10cSrcweir 
41cdf0e10cSrcweir     ~Includes();
42cdf0e10cSrcweir 
43cdf0e10cSrcweir     void add(rtl::OString const & registryType);
44cdf0e10cSrcweir 
addAny()45cdf0e10cSrcweir     void addAny() { m_includeAny = true; }
46cdf0e10cSrcweir 
addReference()47cdf0e10cSrcweir     void addReference() { m_includeReference = true; }
48cdf0e10cSrcweir 
addSequence()49cdf0e10cSrcweir     void addSequence() { m_includeSequence = true; }
50cdf0e10cSrcweir 
addType()51cdf0e10cSrcweir     void addType() { m_includeType = true; }
52cdf0e10cSrcweir 
addCppuMacrosHxx()53cdf0e10cSrcweir     void addCppuMacrosHxx() { m_includeCppuMacrosHxx = true; }
54cdf0e10cSrcweir 
addCppuUnotypeHxx()55cdf0e10cSrcweir     void addCppuUnotypeHxx() { m_includeCppuUnotypeHxx = true; }
56cdf0e10cSrcweir 
addOslDoublecheckedlockingH()57cdf0e10cSrcweir     void addOslDoublecheckedlockingH()
58cdf0e10cSrcweir     { m_includeOslDoublecheckedlockingH = true; }
59cdf0e10cSrcweir 
addOslMutexHxx()60cdf0e10cSrcweir     void addOslMutexHxx() { m_includeOslMutexHxx = true; }
61cdf0e10cSrcweir 
addRtlStrbufHxx()62cdf0e10cSrcweir     void addRtlStrbufHxx() { m_includeRtlStrbufHxx = true; }
63cdf0e10cSrcweir 
addRtlStringH()64cdf0e10cSrcweir     void addRtlStringH() { m_includeRtlStringH = true; }
65cdf0e10cSrcweir 
addRtlTextencH()66cdf0e10cSrcweir     void addRtlTextencH() { m_includeRtlTextencH = true; }
67cdf0e10cSrcweir 
addRtlUstrbufHxx()68cdf0e10cSrcweir     void addRtlUstrbufHxx() { m_includeRtlUstrbufHxx = true; }
69cdf0e10cSrcweir 
addRtlUstringH()70cdf0e10cSrcweir     void addRtlUstringH() { m_includeRtlUstringH = true; }
71cdf0e10cSrcweir 
addRtlUstringHxx()72cdf0e10cSrcweir     void addRtlUstringHxx() { m_includeRtlUstringHxx = true; }
73cdf0e10cSrcweir 
addSalTypesH()74cdf0e10cSrcweir     void addSalTypesH() { m_includeSalTypesH = true; }
75cdf0e10cSrcweir 
addTypelibTypeclassH()76cdf0e10cSrcweir     void addTypelibTypeclassH() { m_includeTypelibTypeclassH = true; }
77cdf0e10cSrcweir 
addTypelibTypedescriptionH()78cdf0e10cSrcweir     void addTypelibTypedescriptionH()
79cdf0e10cSrcweir     { m_includeTypelibTypedescriptionH = true; }
80cdf0e10cSrcweir 
81cdf0e10cSrcweir     void dump(FileStream & out, rtl::OString const * companionHdl);
82cdf0e10cSrcweir 
83cdf0e10cSrcweir     static void dumpInclude(
84cdf0e10cSrcweir         FileStream & out, rtl::OString const & registryType, bool hpp,
85cdf0e10cSrcweir         rtl::OString const & suffix = rtl::OString());
86cdf0e10cSrcweir 
87cdf0e10cSrcweir private:
88cdf0e10cSrcweir     Includes(Includes &); // not implemented
89cdf0e10cSrcweir     void operator =(Includes); // not implemented;
90cdf0e10cSrcweir 
91cdf0e10cSrcweir     bool isInterfaceType(rtl::OString const & registryType) const;
92cdf0e10cSrcweir 
93cdf0e10cSrcweir     TypeManager const & m_manager;
94cdf0e10cSrcweir     codemaker::Dependencies::Map m_map;
95cdf0e10cSrcweir     bool m_hpp;
96cdf0e10cSrcweir     bool m_includeAny;
97cdf0e10cSrcweir     bool m_includeReference;
98cdf0e10cSrcweir     bool m_includeSequence;
99cdf0e10cSrcweir     bool m_includeType;
100cdf0e10cSrcweir     bool m_includeCppuMacrosHxx;
101cdf0e10cSrcweir     bool m_includeCppuUnotypeHxx;
102cdf0e10cSrcweir     bool m_includeOslDoublecheckedlockingH;
103cdf0e10cSrcweir     bool m_includeOslMutexHxx;
104cdf0e10cSrcweir     bool m_includeRtlStrbufHxx;
105cdf0e10cSrcweir     bool m_includeRtlStringH;
106cdf0e10cSrcweir     bool m_includeRtlTextencH;
107cdf0e10cSrcweir     bool m_includeRtlUstrbufHxx;
108cdf0e10cSrcweir     bool m_includeRtlUstringH;
109cdf0e10cSrcweir     bool m_includeRtlUstringHxx;
110cdf0e10cSrcweir     bool m_includeSalTypesH;
111cdf0e10cSrcweir     bool m_includeTypelibTypeclassH;
112cdf0e10cSrcweir     bool m_includeTypelibTypedescriptionH;
113cdf0e10cSrcweir };
114cdf0e10cSrcweir 
115cdf0e10cSrcweir } }
116cdf0e10cSrcweir 
117cdf0e10cSrcweir #endif // INCLUDED_CODEMAKER_SOURCE_CPPUMAKER_INCLUDES_HXX
118