Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #ifndef INCLUDED_CODEMAKER_SOURCE_CPPUMAKER_INCLUDES_HXX
21 : #define INCLUDED_CODEMAKER_SOURCE_CPPUMAKER_INCLUDES_HXX
22 :
23 : #include "rtl/ref.hxx"
24 : #include "rtl/ustring.hxx"
25 :
26 : #include "dependencies.hxx"
27 :
28 : class FileStream;
29 : class TypeManager;
30 :
31 : namespace codemaker { namespace cppumaker {
32 :
33 : class Includes {
34 : public:
35 : Includes(
36 : rtl::Reference< TypeManager > const & manager,
37 : Dependencies const & dependencies, bool hpp);
38 :
39 : ~Includes();
40 :
41 : void add(OString const & entityName);
42 1036 : void addCassert() { m_includeCassert = true; }
43 7650 : void addException() { m_includeException = true; }
44 632 : void addAny() { m_includeAny = true; }
45 8686 : void addReference() { m_includeReference = true; }
46 419 : void addSequence() { m_includeSequence = true; }
47 5709 : void addType() { m_includeType = true; }
48 7240 : void addCppuMacrosHxx() { m_includeCppuMacrosHxx = true; }
49 8316 : void addCppuUnotypeHxx() { m_includeCppuUnotypeHxx = true; }
50 : void addOslDoublecheckedlockingH()
51 : { m_includeOslDoublecheckedlockingH = true; }
52 5277 : void addOslMutexHxx() { m_includeOslMutexHxx = true; }
53 10 : void addRtlStrbufHxx() { m_includeRtlStrbufHxx = true; }
54 6 : void addRtlStringH() { m_includeRtlStringH = true; }
55 10 : void addRtlTextencH() { m_includeRtlTextencH = true; }
56 6 : void addRtlUstrbufHxx() { m_includeRtlUstrbufHxx = true; }
57 1457 : void addRtlUstringH() { m_includeRtlUstringH = true; }
58 1467 : void addRtlUstringHxx() { m_includeRtlUstringHxx = true; }
59 5277 : void addRtlInstanceHxx() { m_includeRtlInstanceHxx = true; }
60 853 : void addSalTypesH() { m_includeSalTypesH = true; }
61 853 : void addTypelibTypeclassH() { m_includeTypelibTypeclassH = true; }
62 853 : void addTypelibTypedescriptionH()
63 853 : { m_includeTypelibTypedescriptionH = true; }
64 : void dump(FileStream & out, OUString const * companionHdl);
65 :
66 : static void dumpInclude(
67 : FileStream & out, OString const & entityName, bool hpp);
68 :
69 : private:
70 : Includes(Includes &); // not implemented
71 : void operator =(const Includes&); // not implemented;
72 :
73 : bool isInterfaceType(OString const & entityName) const;
74 :
75 : rtl::Reference< TypeManager > m_manager;
76 : Dependencies::Map m_map;
77 : bool m_hpp;
78 : bool m_includeCassert;
79 : bool m_includeException;
80 : bool m_includeAny;
81 : bool m_includeReference;
82 : bool m_includeSequence;
83 : bool m_includeType;
84 : bool m_includeCppuMacrosHxx;
85 : bool m_includeCppuUnotypeHxx;
86 : bool m_includeOslDoublecheckedlockingH;
87 : bool m_includeOslMutexHxx;
88 : bool m_includeRtlStrbufHxx;
89 : bool m_includeRtlStringH;
90 : bool m_includeRtlTextencH;
91 : bool m_includeRtlUstrbufHxx;
92 : bool m_includeRtlUstringH;
93 : bool m_includeRtlUstringHxx;
94 : bool m_includeRtlInstanceHxx;
95 : bool m_includeSalTypesH;
96 : bool m_includeTypelibTypeclassH;
97 : bool m_includeTypelibTypedescriptionH;
98 : };
99 :
100 : } }
101 :
102 : #endif // INCLUDED_CODEMAKER_SOURCE_CPPUMAKER_INCLUDES_HXX
103 :
104 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|