Update ooo320-m1
[ooovba.git] / autodoc / inc / ary / cpp / inpcontx.hxx
blob150e64194bf5eee10c5e3b33fc258cfe82eaee90
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: inpcontx.hxx,v $
10 * $Revision: 1.5 $
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_INPCONTX_HXX
32 #define ARY_CPP_INPCONTX_HXX
36 // USED SERVICES
37 // BASE CLASSES
38 // OTHER
39 #include <ary/cpp/c_types4cpp.hxx>
43 namespace ary
45 namespace loc
47 class File;
49 namespace cpp
51 class Gate;
52 class Namespace;
53 class Class;
54 class Enum;
56 class OperationSignature;
62 namespace ary
64 namespace cpp
68 /** The context of a CodeEntity, which is going to be stored in the
69 repository. The information is used mainly by ->ary::cpp::CeAdmin.
71 class InputContext
73 public:
74 class Owner
76 public:
77 // LIFECYCLE
78 virtual ~Owner() {}
80 // OPERATIONS
81 /// Adds Class data to current inner scope (Namespace or Class).
82 void Add_Class(
83 const String & i_sLocalName,
84 Cid i_nId );
85 /// Adds Enum data to current inner scope (Namespace or Class).
86 void Add_Enum(
87 const String & i_sLocalName,
88 Cid i_nId );
89 /// Adds Typedef data to current inner scope (Namespace or Class).
90 void Add_Typedef(
91 const String & i_sLocalName,
92 Cid i_nId );
93 /// Adds Operation data to current inner scope (Namespace or Class).
94 void Add_Operation(
95 const String & i_sLocalName,
96 Cid i_nId,
97 bool i_bIsStaticMember ); /// True only for static class members.
98 /// Adds Variable data to current inner scope (Namespace or Class).
99 void Add_Variable(
100 const String & i_sLocalName,
101 Cid i_nId,
102 bool i_bIsConst,
103 bool i_bIsStaticMember ); /// True only for static class members.
104 // INQUIRY
105 Ce_id CeId() const;
107 /** @attention Must only be used by ary::cpp::GatePilot!
108 Will work nowhere else!
110 virtual bool HasClass(
111 const String & i_sLocalName ) = 0;
112 private:
113 virtual void do_Add_Class(
114 const String & i_sLocalName,
115 Cid i_nId ) = 0;
116 virtual void do_Add_Enum(
117 const String & i_sLocalName,
118 Cid i_nId ) = 0;
119 virtual void do_Add_Typedef(
120 const String & i_sLocalName,
121 Cid i_nId ) = 0;
122 virtual void do_Add_Operation(
123 const String & i_sLocalName,
124 Cid i_nId,
125 bool i_bIsStatic ) = 0;
126 virtual void do_Add_Variable(
127 const String & i_sLocalName,
128 Cid i_nId,
129 bool i_bIsConst,
130 bool i_bIsStatic ) = 0;
131 virtual Ce_id inq_CeId() const = 0;
134 // LIFECYCLE
135 virtual ~InputContext() {}
137 // OPERATIONS
139 // INQUIRY
140 loc::File & CurFile() const;
142 Namespace & CurNamespace() const;
143 Class * CurClass() const;
144 Enum * CurEnum() const;
146 Owner & CurOwner() const;
147 E_Protection CurProtection() const;
149 private:
150 virtual loc::File & inq_CurFile() const = 0;
152 virtual Namespace & inq_CurNamespace() const = 0;
153 virtual Class * inq_CurClass() const = 0;
154 virtual Enum * inq_CurEnum() const = 0;
156 virtual Owner & inq_CurOwner() const = 0;
157 virtual E_Protection
158 inq_CurProtection() const = 0;
164 // IMPLEMENTATION
165 inline loc::File &
166 InputContext::CurFile() const
167 { return inq_CurFile(); }
169 inline Namespace &
170 InputContext::CurNamespace() const
171 { return inq_CurNamespace(); }
172 inline Class *
173 InputContext::CurClass() const
174 { return inq_CurClass(); }
175 inline Enum *
176 InputContext::CurEnum() const
177 { return inq_CurEnum(); }
178 inline InputContext::Owner &
179 InputContext::CurOwner() const
180 { return inq_CurOwner(); }
181 inline E_Protection
182 InputContext::CurProtection() const
183 { return inq_CurProtection(); }
186 inline void
187 InputContext::Owner::Add_Class( const String & i_sLocalName,
188 Cid i_nId )
189 { do_Add_Class(i_sLocalName, i_nId); }
190 inline void
191 InputContext::Owner::Add_Enum( const String & i_sLocalName,
192 Cid i_nId )
193 { do_Add_Enum(i_sLocalName, i_nId); }
194 inline void
195 InputContext::Owner::Add_Typedef( const String & i_sLocalName,
196 Cid i_nId )
197 { do_Add_Typedef(i_sLocalName, i_nId); }
198 inline void
199 InputContext::Owner::Add_Operation( const String & i_sLocalName,
200 Cid i_nId,
201 bool i_bIsStatic )
202 { do_Add_Operation( i_sLocalName, i_nId, i_bIsStatic ); }
203 inline void
204 InputContext::Owner::Add_Variable( const String & i_sLocalName,
205 Cid i_nId,
206 bool i_bIsConst,
207 bool i_bIsStatic )
208 { do_Add_Variable( i_sLocalName, i_nId, i_bIsConst, i_bIsStatic ); }
209 inline Ce_id
210 InputContext::Owner::CeId() const
211 { return inq_CeId(); }
217 } // namespace cpp
218 } // namespace ary
219 #endif