1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
21 #include <sal/config.h>
23 #include <rtl/ref.hxx>
24 #include <rtl/string.hxx>
25 #include <codemaker/typemanager.hxx>
26 #include <unoidl/unoidl.hxx>
32 namespace skeletonmaker
{
34 typedef ::std::map
< OString
, ::std::vector
< OString
> > ProtocolCmdMap
;
36 typedef ::std::vector
< unoidl::AccumulationBasedServiceEntity::Property
>
39 struct ProgramOptions
{
40 ProgramOptions(): all(false), dump(false), license(false),
41 shortnames(false), supportpropertysetmixin(false),
42 backwardcompatible(false), language(1), componenttype(1) {}
48 bool supportpropertysetmixin
;
49 bool backwardcompatible
;
50 // language specifier - is extendable
55 // 1 = default UNO component - is extendable
61 ProtocolCmdMap protocolCmdMap
;
66 print the standard OpenOffice.org license header
68 @param o specifies the output stream
69 @param filename specifies the source file name
71 void printLicenseHeader(std::ostream
& o
);
74 create dependent on the output path, the implementation name and the
75 extension a new output file. If output path is equal "stdout" the tool
76 generates the output to standard out.
78 @param options the program options including the output path and the
80 @param extension specifies the file extensions (e.g. .cxx or .java)
81 @param ppOutputStream out parameter returning the output stream
82 @param targetSourceFileName out parameter returning the generated file name
83 constructed on base of the output path, the
84 implementation name and the extension
85 @param tmpSourceFileName out parameter returning the temporary file name based
86 on the output path and a generated temporary file name.
87 @return true if output is generated to standard out or else false
89 bool getOutputStream(ProgramOptions
const & options
,
90 OString
const & extension
,
91 std::ostream
** ppOutputStream
,
92 OString
& targetSourceFileName
,
93 OString
& tmpSourceFileName
);
95 void checkType(rtl::Reference
< TypeManager
> const & manager
,
96 OUString
const & type
,
97 std::set
< OUString
>& interfaceTypes
,
98 std::set
< OUString
>& serviceTypes
,
99 AttributeInfo
& properties
);
101 void checkDefaultInterfaces(
102 std::set
< OUString
>& interfaces
,
103 const std::set
< OUString
>& services
,
104 std::u16string_view propertyhelper
);
106 OUString
checkPropertyHelper(
107 ProgramOptions
const & options
, rtl::Reference
< TypeManager
> const & manager
,
108 const std::set
< OUString
>& services
,
109 const std::set
< OUString
>& interfaces
,
110 AttributeInfo
& attributes
,
111 std::set
< OUString
>& propinterfaces
);
114 checks if XComponent have to be supported, if yes it removes it from the
115 supported interfaces list because it becomes implemented by the appropriate
118 @param manager a type manager
119 @param interfaces a list of interfaces which should be implemented
121 @return true if XComponent have to be supported
123 bool checkXComponentSupport(rtl::Reference
< TypeManager
> const & manager
,
124 std::set
< OUString
>& interfaces
);
127 unoidl::AccumulationBasedServiceEntity::Property::Attributes
128 checkAdditionalPropertyFlags(
129 unoidl::InterfaceTypeEntity::Attribute
const & attribute
);
131 void generateFunctionParameterMap(std::ostream
& o
,
132 ProgramOptions
const & options
,
133 rtl::Reference
< TypeManager
> const & manager
,
134 const std::set
< OUString
>& interfaces
);
138 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */