xref: /aoo41x/main/autodoc/source/ary/idl/ia_ce.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef ARY_IDL_IA_CE_HXX
29 #define ARY_IDL_IA_CE_HXX
30 
31 
32 // USED SERVICES
33     // BASE CLASSES
34 #include <ary/idl/ip_ce.hxx>
35     // COMPONENTS
36     // PARAMETERS
37 
38 
39 namespace ary
40 {
41 namespace idl
42 {
43 
44 class Ce_Storage;
45 class TypeAdmin;
46 
47 
48 /** @resp
49     Implements ::ary::idl::CePilot. Provides the access logic for all
50     IDL code entities.
51 
52     @collab Ce_Storage
53     @collab TypeAdmin
54 
55     @see CodeEntity
56 */
57 class CeAdmin : public CePilot
58 {
59   public:
60     // LIFECYCLE
61                         CeAdmin(
62                             NameLookup &        io_rNameDictionary,
63                             TypeAdmin &         io_rTypePilot );
64     virtual             ~CeAdmin();
65 
66     // OPERATIONS
67 
68     // INQUIRY
69     const Ce_Storage &  Storage() const;
70 
71     // ACCESS
72     Ce_Storage &        Storage();
73 
74     // INHERITED
75         // Interface ::ary::idl::CePilot:
76     virtual Module &    CheckIn_Module(
77                             Ce_id               i_nParentId,
78                             const String &      i_sName );
79     virtual Service &   Store_Service(
80                             Ce_id               i_nOwner,
81                             const String &      i_sName );
82     virtual SglIfcService &
83                         Store_SglIfcService(
84                             Ce_id               i_nOwner,
85                             const String &      i_sName,
86                             Type_id             i_nBaseInterface );
87     virtual Interface & Store_Interface(
88                             Ce_id               i_nOwner,
89                             const String &      i_sName,
90                             Type_id             i_nBase );
91     virtual Struct &    Store_Struct(
92                             Ce_id               i_nOwner,
93                             const String &      i_sName,
94                             Type_id             i_nBase,
95                             const String &      i_sTemplateParam );
96     virtual Exception & Store_Exception(
97                             Ce_id               i_nOwner,
98                             const String &      i_sName,
99                             Type_id             i_nBase );
100     virtual Enum &      Store_Enum(
101                             Ce_id               i_nOwner,
102                             const String &      i_sName );
103     virtual Typedef &   Store_Typedef(
104                             Ce_id               i_nOwner,
105                             const String &      i_sName,
106                             Type_id             i_nDefiningType );
107     virtual ConstantsGroup &
108                         Store_ConstantsGroup(
109                             Ce_id               i_nOwner,
110                             const String &      i_sName );
111     virtual Singleton & Store_Singleton(
112                             Ce_id               i_nOwner,
113                             const String &      i_sName );
114     virtual SglIfcSingleton &
115                         Store_SglIfcSingleton(
116                             Ce_id               i_nOwner,
117                             const String &      i_sName,
118                             Type_id             i_nBaseInterface );
119 
120     virtual Constant &  Store_Constant(
121                             Ce_id               i_nOwner,
122                             const String &      i_sName,
123                             Type_id             i_nType,
124                             const String &      i_sValue );
125     virtual Property &  Store_Property(
126                             Ce_id               i_nOwner,
127                             const String &      i_sName,
128                             Type_id             i_nType,
129                             Property::Stereotypes
130                                                 i_stereotypes );
131     virtual Function &  Store_Function(
132                             Ce_id               i_nOwner,
133                             const String &      i_sName,
134                             Type_id             i_nReturnType,
135                             bool                i_bOneWay );
136     virtual Function &  Store_ServiceConstructor(
137                             Ce_id               i_nOwner,
138                             const String &      i_sName );
139     virtual StructElement &
140                         Store_StructMember(
141                             Ce_id               i_nOwner,
142                             const String &      i_sName,
143                             Type_id             i_nType );
144     virtual StructElement &
145                         Store_ExceptionMember(
146                             Ce_id               i_nOwner,
147                             const String &      i_sName,
148                             Type_id             i_nType );
149     virtual EnumValue & Store_EnumValue(
150                             Ce_id               i_nOwner,
151                             const String &      i_sName,
152                             const String &      i_sValue );
153     virtual Attribute & Store_Attribute(
154                             Ce_id               i_nOwner,
155                             const String &      i_sName,
156                             Type_id             i_nType,
157                             bool                i_bReadOnly,
158                             bool                i_bBound );
159 
160     virtual const Module &
161                         GlobalNamespace() const;
162     virtual const CodeEntity &
163                         Find_Ce(
164                             Ce_id               i_nId ) const;
165     virtual const Module &
166                         Find_Module(
167                             Ce_id               i_nId ) const;
168     virtual const Module *
169                         Search_Module(
170                             Ce_id               i_nId ) const;
171     virtual const Function &
172                         Find_Function(
173                             Ce_id               i_nId ) const;
174     virtual const Property &
175                         Find_Property(
176                             Ce_id               i_nId ) const;
177     virtual const EnumValue &
178                         Find_EnumValue(
179                             Ce_id               i_nId ) const;
180     virtual const Constant &
181                         Find_Constant(
182                             Ce_id               i_nId ) const;
183     virtual const StructElement &
184                         Find_StructElement(
185                             Ce_id               i_nId ) const;
186     virtual void        Get_Text(
187                             StringVector &      o_module,
188                             String &            o_ce,
189                             String &            o_member,
190                             const CodeEntity &  i_ce ) const;
191     virtual const NameLookup &
192                         NameDictionary() const;
193     virtual void        Get_AlphabeticalIndex(
194                             std::vector<Ce_id> &
195                                                 o_rResult,
196                             alphabetical_index::E_Letter
197                                                 i_cLetter) const;
198     // ACCESS
199     virtual Module &    GlobalNamespace();
200     virtual CodeEntity &
201                         Find_Ce(
202                             Ce_id               i_nId );
203   private:
204     // Locals
205     Module &            lhf_Access_Module(
206                             Ce_id               i_nId );
207     void                lhf_Put2Storage_and_AssignId(
208                             CodeEntity &        pass_io_rCe );
209     void                lhf_Store_NewEntity(
210                             DYN CodeEntity &    pass_io_rCe,
211                             Module &            i_rOwner );
212     void                lhf_Store_NewEntity(
213                             DYN CodeEntity &    pass_io_rCe,
214                             Ce_id               i_nOwnerModule );
215     void                get_ModuleText(
216                             StringVector &      o_module,
217                             const CodeEntity &  i_ce ) const;
218     Struct &            lhf_Store_TplStruct(
219                             Ce_id               i_nOwner,
220                             const String &      i_sName,
221                             Type_id             i_nBase,
222                             const String &      i_sTemplateParam );
223 
224     const Ce_Storage &  my_Storage() const;
225     Ce_Storage &        my_Storage();
226     NameLookup &        my_NameDictionary()     { return *pNameDictionary; }
227 
228     // DATA
229     Dyn<Ce_Storage>     pStorage;           /// @inv pStorage != 0;
230     Module *            pGlobalNamespace;
231     NameLookup *        pNameDictionary;
232     TypeAdmin *         pTypePilot;
233 };
234 
235 
236 // IMPLEMENTATION
237 inline const Ce_Storage &
238 CeAdmin::Storage() const
239 {
240     return *pStorage;
241 }
242 
243 inline Ce_Storage &
244 CeAdmin::Storage()
245 {
246     return *pStorage;
247 }
248 
249 
250 
251 }   // namespace idl
252 }   // namespace ary
253 #endif
254