merge the formfield patch from ooo-build
[ooovba.git] / autodoc / inc / ary / cpp / c_class.hxx
blobd05eb4e8ce276e214873d83cec2508cc26641f91
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: c_class.hxx,v $
10 * $Revision: 1.4 $
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_CPP_C_CLASS_HXX
32 #define ARY_CPP_C_CLASS_HXX
36 // USED SERVICES
37 // BASE CLASSES
38 #include <ary/cpp/c_ce.hxx>
39 #include <ary/arygroup.hxx>
40 // OTHER
41 #include <ary/symtreenode.hxx>
42 #include <ary/cessentl.hxx>
43 #include <ary/sequentialids.hxx>
44 #include <ary/cpp/c_types4cpp.hxx>
45 #include <ary/cpp/c_slntry.hxx>
47 namespace ary
49 namespace cpp
51 class Enum;
52 class Typedef;
53 class Function;
54 class Variable;
60 namespace ary
62 namespace cpp
66 /** A C++ class.
68 class Class : public CodeEntity,
69 public AryGroup
71 public:
72 enum E_ClassId { class_id = 1001 };
74 enum E_Slots
76 SLOT_Bases = 1,
77 SLOT_NestedClasses,
78 SLOT_Enums,
79 SLOT_Typedefs,
80 SLOT_Operations,
81 SLOT_StaticOperations,
82 SLOT_Data,
83 SLOT_StaticData,
84 SLOT_FriendClasses,
85 SLOT_FriendOperations
88 typedef ::ary::symtree::Node<CeNode_Traits> node_t;
91 // LIFECYCLE
92 Class(
93 const String & i_sLocalName,
94 Ce_id i_nOwner,
95 E_Protection i_eProtection,
96 loc::Le_id i_nFile,
97 E_ClassKey i_eClassKey );
98 ~Class();
100 // OPERATIONS
101 void Add_BaseClass(
102 const S_Classes_Base &
103 i_rBaseClass );
104 void Add_TemplateParameterType(
105 const String & i_sLocalName,
106 Type_id i_nIdAsType );
107 void Add_KnownDerivative(
108 Ce_id i_nId )
109 { aKnownDerivatives.Add(i_nId); }
111 void Add_LocalClass(
112 const String & i_sLocalName,
113 Cid i_nId );
114 void Add_LocalEnum(
115 const String & i_sLocalName,
116 Cid i_nId );
117 void Add_LocalTypedef(
118 const String & i_sLocalName,
119 Cid i_nId );
120 void Add_LocalOperation(
121 const String & i_sLocalName,
122 Cid i_nId );
123 void Add_LocalStaticOperation(
124 const String & i_sLocalName,
125 Cid i_nId );
126 void Add_LocalData(
127 const String & i_sLocalName,
128 Cid i_nId );
129 void Add_LocalStaticData(
130 const String & i_sLocalName,
131 Cid i_nId );
133 void UpdateVirtuality(
134 E_Virtuality i_eVirtuality )
135 { if ( int(i_eVirtuality) > int(eVirtuality) )
136 eVirtuality = i_eVirtuality; }
137 const List_TplParam &
138 TemplateParameters() const
139 { return aTemplateParameterTypes; }
140 const List_Bases & BaseClasses() const { return aBaseClasses; }
141 const SequentialIds<Ce_id> &
142 KnownDerivatives() const
143 { return aKnownDerivatives; }
145 // INQUIRY
146 E_ClassKey ClassKey() const;
147 E_Protection Protection() const;
148 E_Virtuality Virtuality() const { return eVirtuality; }
150 Ce_id Search_Child(
151 const String & i_key ) const;
152 Rid Search_LocalClass(
153 const String & i_sName ) const;
154 const node_t & AsNode() const;
156 // ACCESS
157 node_t & AsNode();
159 private:
160 NON_COPYABLE(Class);
162 // Interface csv::ConstProcessorClient
163 virtual void do_Accept(
164 csv::ProcessorIfc & io_processor ) const;
166 // Interface ary::cpp::CodeEntity
167 virtual const String &
168 inq_LocalName() const;
169 virtual Cid inq_Owner() const;
170 virtual loc::Le_id inq_Location() const;
172 // Interface ary::cpp::CppEntity
173 virtual ClassId get_AryClass() const;
175 // Interface ary::AryGroup
176 virtual Gid inq_Id_Group() const;
177 virtual const cpp::CppEntity &
178 inq_RE_Group() const;
179 virtual const group::SlotList &
180 inq_Slots() const;
181 virtual DYN Slot * inq_Create_Slot(
182 SlotAccessId i_nSlot ) const;
183 // Local
184 typedef List_LocalCe::const_iterator CIterator_Locals;
185 typedef List_LocalCe::iterator Iterator_Locals;
186 typedef SequentialIds<Ce_id> IdSequence;
188 CIterator_Locals PosOfName(
189 const List_LocalCe& i_rList,
190 const String & i_sName ) const;
191 // DATA
192 CeEssentials aEssentials;
193 node_t aAssignedNode;
195 List_Bases aBaseClasses;
196 List_TplParam aTemplateParameterTypes;
198 List_LocalCe aClasses;
199 List_LocalCe aEnums;
200 List_LocalCe aTypedefs;
201 List_LocalCe aOperations;
202 List_LocalCe aStaticOperations;
203 List_LocalCe aData;
204 List_LocalCe aStaticData;
206 IdSequence aFriendClasses;
207 IdSequence aFriendOperations;
208 IdSequence aKnownDerivatives;
210 E_ClassKey eClassKey;
211 E_Protection eProtection;
212 E_Virtuality eVirtuality;
218 // IMPLEMENTATION
219 inline E_ClassKey
220 Class::ClassKey() const
222 return eClassKey;
225 inline E_Protection
226 Class::Protection() const
228 return eProtection;
231 inline const Class::node_t &
232 Class::AsNode() const
234 return aAssignedNode;
237 inline Class::node_t &
238 Class::AsNode()
240 return aAssignedNode;
246 } // namespace cpp
247 } // namespace ary
248 #endif