Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / unodevtools / source / skeletonmaker / skeletoncommon.hxx
blob97c0e72a63241f997b1b166b9f1cf6e89f4a9767
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_UNODEVTOOLS_SOURCE_SKELETONMAKER_SKELETONCOMMON_HXX
20 #define INCLUDED_UNODEVTOOLS_SOURCE_SKELETONMAKER_SKELETONCOMMON_HXX
22 #include "sal/config.h"
24 #include "rtl/ref.hxx"
25 #include "rtl/string.hxx"
26 #include "codemaker/typemanager.hxx"
27 #include "codemaker/unotype.hxx"
28 #include "unoidl/unoidl.hxx"
30 #include <fstream>
31 #include <map>
32 #include <set>
34 namespace skeletonmaker {
36 typedef ::std::map< OString, ::std::vector< OString > > ProtocolCmdMap;
38 typedef ::std::vector< unoidl::AccumulationBasedServiceEntity::Property >
39 AttributeInfo;
41 struct ProgramOptions {
42 ProgramOptions(): all(false), dump(false), license(false),
43 shortnames(false), supportpropertysetmixin(false),
44 backwardcompatible(false), language(1), componenttype(1) {}
46 bool all;
47 bool dump;
48 bool license;
49 bool shortnames;
50 bool supportpropertysetmixin;
51 bool backwardcompatible;
52 // language specifier - is extendable
53 // 1 = Java
54 // 2 = C++
55 short language;
56 // component type
57 // 1 = default UNO component - is extendable
58 // 2 = calc add-in
59 // 3 = add-on
60 short componenttype;
61 OString outputpath;
62 OString implname;
63 ProtocolCmdMap protocolCmdMap;
67 /**
68 print the standard OpenOffice.org license header
70 @param o specifies the output stream
71 @param filename specifies the source file name
73 void printLicenseHeader(std::ostream& o, OString const & filename);
75 /**
76 create dependent on the output path, the implementation name and the
77 extension a new output file. If output path is equal "stdout" the tool
78 generates the output to standard out.
80 @param options the program options including the output path and the
81 implementation name
82 @param extension specifies the file extensions (e.g. .cxx or .java)
83 @param ppOutputStream out parameter returning the output stream
84 @param targetSourceFileName out parameter returning the generated file name
85 constructed on base of the output path, the
86 implementation name and the extension
87 @param tmpSourceFileName out parameter returning the temporary file name based
88 on the output path and a generated temporary file name.
89 @return true if output is generated to standard out or else false
91 bool getOutputStream(ProgramOptions const & options,
92 OString const & extension,
93 std::ostream** ppOutputStream,
94 OString & targetSourceFileName,
95 OString & tmpSourceFileName);
97 void checkType(rtl::Reference< TypeManager > const & manager,
98 OUString const & type,
99 std::set< OUString >& interfaceTypes,
100 std::set< OUString >& serviceTypes,
101 AttributeInfo& properties);
103 void checkDefaultInterfaces(
104 std::set< OUString >& interfaces,
105 const std::set< OUString >& services,
106 const OUString & propertyhelper);
108 OUString checkPropertyHelper(
109 ProgramOptions const & options, rtl::Reference< TypeManager > const & manager,
110 const std::set< OUString >& services,
111 const std::set< OUString >& interfaces,
112 AttributeInfo& attributes,
113 std::set< OUString >& propinterfaces);
116 checks if XComponent have to be supported, if yes it removes it from the
117 supported interfaces list because it becomes implemented by the appropriate
118 helper
120 @param manager a type manager
121 @param interfaces a list of interfaces which should be implemented
123 @return true if XComponent have to be supported
125 bool checkXComponentSupport(rtl::Reference< TypeManager > const & manager,
126 std::set< OUString >& interfaces);
129 unoidl::AccumulationBasedServiceEntity::Property::Attributes
130 checkAdditionalPropertyFlags(
131 unoidl::InterfaceTypeEntity::Attribute const & attribute);
133 void generateFunctionParameterMap(std::ostream& o,
134 ProgramOptions const & options,
135 rtl::Reference< TypeManager > const & manager,
136 const std::set< OUString >& interfaces);
140 #endif // INCLUDED_UNODEVTOOLS_SOURCE_SKELETONMAKER_SKELETONCOMMON_HXX
142 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */