1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef INCLUDED_UNODEVTOOLS_SOURCE_SKELETONMAKER_SKELETONCPP_HXX
24 #define INCLUDED_UNODEVTOOLS_SOURCE_SKELETONMAKER_SKELETONCPP_HXX
25 
26 #include <fstream>
27 
28 #include "codemaker/generatedtypeset.hxx"
29 #include "skeletoncommon.hxx"
30 
31 namespace skeletonmaker { namespace cpp {
32 
33 // referenceType
34 // 0 = no reference
35 // 1 = use of css::uno::Reference for interfaces
36 // 2 = reference (includes css::uno::Reference for interfaces)
37 // 4 = const reference  (includes css::uno::Reference for interfaces)
38 // 8 = default construction for example for return types, means "return <type>();"
39 // 16 = default member initialization in a constructor
40 void printType(std::ostream & o,
41                ProgramOptions const & options, TypeManager const & manager,
42                codemaker::UnoType::Sort sort, RTTypeClass typeClass,
43                rtl::OString const & name, sal_Int32 rank,
44                std::vector< rtl::OString > const & arguments,
45                short referenceType, bool defaultvalue=false);
46 
47 void printType(std::ostream & o,
48                ProgramOptions const & options, TypeManager const & manager,
49                rtl::OString const & type, short referenceType,
50                bool defaultvalue=false);
51 
52 
53 bool printConstructorParameters(std::ostream & o,
54                                 ProgramOptions const & options,
55                                 TypeManager const & manager,
56                                 typereg::Reader const & reader,
57                                 typereg::Reader const & outerReader,
58                                 std::vector< rtl::OString > const & arguments);
59 
60 
61 void printConstructor(std::ostream & o,
62                       ProgramOptions const & options,
63                       TypeManager const & manager,
64                       typereg::Reader const & reader,
65                       std::vector< rtl::OString > const & arguments);
66 
67 
68 void printMethodParameters(std::ostream & o,
69                            ProgramOptions const & options,
70                            TypeManager const & manager,
71                            typereg::Reader const & reader,
72                            sal_uInt16 method, bool previous,
73                            bool withtype);
74 
75 
76 void printExceptionSpecification(std::ostream & o,
77                                  ProgramOptions const & options,
78                                  TypeManager const & manager,
79                                  typereg::Reader const & reader,
80                                  sal_uInt16 method);
81 
82 
83 void printMethods(std::ostream & o,
84                   ProgramOptions const & options, TypeManager const & manager,
85                   typereg::Reader const & reader,
86                   codemaker::GeneratedTypeSet & generated,
87                   rtl::OString const & delegate,
88                   rtl::OString const & classname=rtl::OString(),
89                   rtl::OString const & indentation=rtl::OString(),
90                   bool defaultvalue=false,
91                   rtl::OString const & propertyhelper=rtl::OString());
92 
93 
94 void printConstructionMethods(std::ostream & o,
95                               ProgramOptions const & options,
96                               TypeManager const & manager,
97                               typereg::Reader const & reader);
98 
99 
100 void printServiceMembers(std::ostream & o,
101                          ProgramOptions const & options,
102                          TypeManager const & manager,
103                          typereg::Reader const & reader,
104                          rtl::OString const & type,
105                          rtl::OString const & delegate);
106 
107 
108 void printMapsToCppType(std::ostream & o,
109                         ProgramOptions const & options,
110                         TypeManager const & manager,
111                         codemaker::UnoType::Sort sort,
112                         RTTypeClass typeClass,
113                         rtl::OString const & name,
114                         sal_Int32 rank,
115                         std::vector< rtl::OString > const & arguments,
116                         const char * cppTypeSort);
117 
118 
119 void generateDocumentation(std::ostream & o,
120                            ProgramOptions const & options,
121                            TypeManager const & manager,
122                            rtl::OString const & type,
123                            rtl::OString const & delegate);
124 
125 
126 void generateSkeleton(ProgramOptions const & options,
127                       TypeManager const & manager,
128                       std::vector< rtl::OString > const & types,
129                       rtl::OString const & delegate);
130 
131 void generateCalcAddin(ProgramOptions const & options,
132                        TypeManager const & manager,
133                        std::vector< rtl::OString > const & types);
134 
135 } }
136 
137 #endif // INCLUDED_UNODEVTOOLS_SOURCE_SKELETONMAKER_SKELETONCPP_HXX
138 
139