xref: /trunk/main/unodevtools/source/skeletonmaker/skeletoncpp.hxx (revision 137931e43899a1545869cb6af6ea936d8cee4956)
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 printMethods(std::ostream & o,
77                   ProgramOptions const & options, TypeManager const & manager,
78                   typereg::Reader const & reader,
79                   codemaker::GeneratedTypeSet & generated,
80                   rtl::OString const & delegate,
81                   rtl::OString const & classname=rtl::OString(),
82                   rtl::OString const & indentation=rtl::OString(),
83                   bool defaultvalue=false,
84                   rtl::OString const & propertyhelper=rtl::OString());
85 
86 
87 void printConstructionMethods(std::ostream & o,
88                               ProgramOptions const & options,
89                               TypeManager const & manager,
90                               typereg::Reader const & reader);
91 
92 
93 void printServiceMembers(std::ostream & o,
94                          ProgramOptions const & options,
95                          TypeManager const & manager,
96                          typereg::Reader const & reader,
97                          rtl::OString const & type,
98                          rtl::OString const & delegate);
99 
100 
101 void printMapsToCppType(std::ostream & o,
102                         ProgramOptions const & options,
103                         TypeManager const & manager,
104                         codemaker::UnoType::Sort sort,
105                         RTTypeClass typeClass,
106                         rtl::OString const & name,
107                         sal_Int32 rank,
108                         std::vector< rtl::OString > const & arguments,
109                         const char * cppTypeSort);
110 
111 
112 void generateDocumentation(std::ostream & o,
113                            ProgramOptions const & options,
114                            TypeManager const & manager,
115                            rtl::OString const & type,
116                            rtl::OString const & delegate);
117 
118 
119 void generateSkeleton(ProgramOptions const & options,
120                       TypeManager const & manager,
121                       std::vector< rtl::OString > const & types,
122                       rtl::OString const & delegate);
123 
124 void generateCalcAddin(ProgramOptions const & options,
125                        TypeManager const & manager,
126                        std::vector< rtl::OString > const & types);
127 
128 } }
129 
130 #endif // INCLUDED_UNODEVTOOLS_SOURCE_SKELETONMAKER_SKELETONCPP_HXX
131