Update ooo320-m1
[ooovba.git] / autodoc / source / ary / idl / i2s_calculator.hxx
blob9f9dbea9224eebbeabad0ac0178fb4c1356d0cab
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: i2s_calculator.hxx,v $
10 * $Revision: 1.3 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef ARY_IDL_I2S_CALCULATOR_HXX
32 #define ARY_IDL_I2S_CALCULATOR_HXX
35 // USED SERVICES
36 // BASE CLASSES
37 #include <cosv/tpl/processor.hxx>
38 // PARAMETERS
39 #include <ary/idl/i_types4idl.hxx>
42 namespace ary
44 namespace idl
46 class CeAdmin;
47 class Ce_Storage;
48 class TypeAdmin;
49 class Type_Storage;
50 class Module;
51 class ExplicitType;
52 class Function;
53 class Interface;
54 class Property;
55 class Typedef;
56 class Service;
57 class Singleton;
58 class SglIfcService;
59 class SglIfcSingleton;
60 class Struct;
61 class StructElement;
62 class Exception;
63 class Ce_2s;
72 namespace ary
74 namespace idl
78 enum E_2s_of_Service
80 service_2s_IncludingServices,
81 service_2s_InstantiatingSingletons
84 enum E_2s_of_Interface
86 interface_2s_Derivations,
87 interface_2s_ExportingServices,
88 interface_2s_ExportingSingletons,
89 interface_2s_SynonymTypedefs,
90 // interface_2s_UsingTypedefs,
91 interface_2s_AsReturns,
92 // interface_2s_AsIndirectReturns,
93 interface_2s_AsParameters,
94 // interface_2s_AsIndirectParameters,
95 interface_2s_AsDataTypes
98 enum E_2s_of_Struct
100 struct_2s_Derivations,
101 struct_2s_SynonymTypedefs,
102 // struct_2s_UsingTypedefs,
103 struct_2s_AsReturns,
104 // struct_2s_AsIndirectReturns,
105 struct_2s_AsParameters,
106 // struct_2s_AsIndirectParameters,
107 struct_2s_AsDataTypes
110 enum E_2s_of_Enum
112 enum_2s_SynonymTypedefs,
113 // enum_2s_UsingTypedefs,
114 enum_2s_AsReturns,
115 // enum_2s_AsIndirectReturns,
116 enum_2s_AsParameters,
117 // enum_2s_AsIndirectParameters,
118 enum_2s_AsDataTypes
121 enum E_2s_of_Typedef
123 typedef_2s_SynonymTypedefs,
124 // typedef_2s_UsingTypedefs,
125 typedef_2s_AsReturns,
126 // typedef_2s_AsIndirectReturns,
127 typedef_2s_AsParameters,
128 // typedef_2s_AsIndirectParameters,
129 typedef_2s_AsDataTypes
132 enum E_2s_of_Exceptions
134 exception_2s_Derivations,
135 exception_2s_RaisingFunctions
140 class SPInst_asHost : public csv::ProcessorIfc,
141 public csv::ConstProcessor<Service>,
142 public csv::ConstProcessor<Interface>,
143 public csv::ConstProcessor<Struct>,
144 public csv::ConstProcessor<Exception>,
145 public csv::ConstProcessor<Typedef>,
146 public csv::ConstProcessor<Singleton>,
147 public csv::ConstProcessor<Function>,
148 public csv::ConstProcessor<StructElement>,
149 public csv::ConstProcessor<Property>,
150 public csv::ConstProcessor<SglIfcService>,
151 public csv::ConstProcessor<SglIfcSingleton>
158 /** This class scans the parsed data and produces several
159 secondary data like cross references and alphabetical indices.
161 In this declaration "Secondaries" or "2s" mean those secondary data.
163 @see Ce_2s
165 class SecondariesCalculator : public SPInst_asHost
167 public:
168 // LIFECYCLE
169 SecondariesCalculator(
170 CeAdmin & i_ces,
171 TypeAdmin & i_types );
172 virtual ~SecondariesCalculator();
174 // OPERATIONS
175 void CheckAllInterfaceBases();
176 void Connect_Types2Ces();
177 void Gather_CrossReferences();
178 void Make_Links2DeveloperManual(
179 const String & i_devman_reffilepath );
181 private:
182 // Interface CeHost These are the points to gather cross
183 // references:
184 virtual void do_Process(
185 const Service & i_rData );
186 virtual void do_Process(
187 const Interface & i_rData );
188 virtual void do_Process(
189 const Struct & i_rData );
190 virtual void do_Process(
191 const Exception & i_rData );
192 virtual void do_Process(
193 const Typedef & i_rData );
194 virtual void do_Process(
195 const Singleton & i_rData );
196 virtual void do_Process(
197 const Function & i_rData );
198 virtual void do_Process(
199 const StructElement &
200 i_rData );
201 virtual void do_Process(
202 const Property & i_rData );
203 virtual void do_Process(
204 const SglIfcService &
205 i_rData );
206 virtual void do_Process(
207 const SglIfcSingleton &
208 i_rData );
210 // Locals
211 const Ce_Storage & my_CeStorage() const;
212 const Type_Storage &
213 my_TypeStorage() const;
214 Ce_Storage & my_CeStorage();
215 Type_Storage & my_TypeStorage();
217 template <class DEST>
218 DEST * SearchCe4Type(
219 Type_id i_type );
220 Ce_id lhf_Search_CeForType(
221 const ExplicitType &
222 i_rType ) const;
223 Ce_id lhf_Search_CeFromTypeId(
224 Type_id i_nType ) const;
225 Service * lhf_SearchService(
226 Type_id i_nServ );
227 Interface * lhf_SearchInterface(
228 Type_id i_nIfc );
229 Struct * lhf_SearchStruct(
230 Type_id i_nIfc );
231 Exception * lhf_SearchException(
232 Type_id i_nIfc );
233 void assign_CurLink(
234 char * i_text,
235 const String & i_link,
236 const String & i_linkUI,
237 bool i_isDescr, /// @descr true: description, false: reference.
238 int i_lineCount );
239 void gather_Synonyms();
240 void recursive_AssignAsSynonym(
241 Ce_id i_synonymousTypedefsId,
242 const Typedef & i_TypedefToCheck );
243 void recursive_AssignIncludingService(
244 Ce_id i_includingServicesId,
245 const Service & i_ServiceToCheckItsIncludes );
246 void assign_AsDerivedInterface(
247 const Interface & i_rDerived );
248 void assign_AsDerivedStruct(
249 const Struct & i_rDerived );
250 void assign_AsDerivedException(
251 const Exception & i_rDerived );
252 void assignImplementation_toAServicesInterfaces(
253 Ce_id i_nImpl,
254 Ce_id i_nService,
255 E_2s_of_Interface i_eList );
256 void recursive_AssignImplementation_toExportedInterface(
257 Ce_id i_nService,
258 Type_id i_nExportedInterface,
259 E_2s_of_Interface i_eList );
260 void recursive_AssignFunction_toCeAsReturn(
261 Ce_id i_nFunction,
262 Type_id i_nReturnType );
263 void recursive_AssignFunction_toCeAsParameter(
264 Ce_id i_nFunction,
265 Type_id i_nParameterType );
267 /** @param i_nDataElement
268 May be the ID of an struct element as well as an exception element
269 or a property.
271 void recursive_AssignStructElement_toCeAsDataType(
272 Ce_id i_nDataElement,
273 Type_id i_nDataType );
274 void insert_into2sList(
275 CodeEntity & o_out,
276 int i_listIndex,
277 Ce_id i_nCe );
278 void insert_into2sUnique(
279 CodeEntity & o_out,
280 int i_listIndex,
281 Ce_id i_nCe );
282 /// Sorts secondary production lists alphabetical.
283 void sort_All2s();
285 void Read_Links2DevManual(
286 csv::bstream & i_file );
288 // DATA
289 CeAdmin * pCes;
290 TypeAdmin * pTypes;
296 } // namespace idl
297 } // namespace ary
298 #endif