1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: inpcontx.hxx,v $
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
39 #include <ary/cpp/c_types4cpp.hxx>
56 class OperationSignature
;
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.
81 /// Adds Class data to current inner scope (Namespace or Class).
83 const String
& i_sLocalName
,
85 /// Adds Enum data to current inner scope (Namespace or Class).
87 const String
& i_sLocalName
,
89 /// Adds Typedef data to current inner scope (Namespace or Class).
91 const String
& i_sLocalName
,
93 /// Adds Operation data to current inner scope (Namespace or Class).
95 const String
& i_sLocalName
,
97 bool i_bIsStaticMember
); /// True only for static class members.
98 /// Adds Variable data to current inner scope (Namespace or Class).
100 const String
& i_sLocalName
,
103 bool i_bIsStaticMember
); /// True only for static class members.
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;
113 virtual void do_Add_Class(
114 const String
& i_sLocalName
,
116 virtual void do_Add_Enum(
117 const String
& i_sLocalName
,
119 virtual void do_Add_Typedef(
120 const String
& i_sLocalName
,
122 virtual void do_Add_Operation(
123 const String
& i_sLocalName
,
125 bool i_bIsStatic
) = 0;
126 virtual void do_Add_Variable(
127 const String
& i_sLocalName
,
130 bool i_bIsStatic
) = 0;
131 virtual Ce_id
inq_CeId() const = 0;
135 virtual ~InputContext() {}
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;
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;
158 inq_CurProtection() const = 0;
166 InputContext::CurFile() const
167 { return inq_CurFile(); }
170 InputContext::CurNamespace() const
171 { return inq_CurNamespace(); }
173 InputContext::CurClass() const
174 { return inq_CurClass(); }
176 InputContext::CurEnum() const
177 { return inq_CurEnum(); }
178 inline InputContext::Owner
&
179 InputContext::CurOwner() const
180 { return inq_CurOwner(); }
182 InputContext::CurProtection() const
183 { return inq_CurProtection(); }
187 InputContext::Owner::Add_Class( const String
& i_sLocalName
,
189 { do_Add_Class(i_sLocalName
, i_nId
); }
191 InputContext::Owner::Add_Enum( const String
& i_sLocalName
,
193 { do_Add_Enum(i_sLocalName
, i_nId
); }
195 InputContext::Owner::Add_Typedef( const String
& i_sLocalName
,
197 { do_Add_Typedef(i_sLocalName
, i_nId
); }
199 InputContext::Owner::Add_Operation( const String
& i_sLocalName
,
202 { do_Add_Operation( i_sLocalName
, i_nId
, i_bIsStatic
); }
204 InputContext::Owner::Add_Variable( const String
& i_sLocalName
,
208 { do_Add_Variable( i_sLocalName
, i_nId
, i_bIsConst
, i_bIsStatic
); }
210 InputContext::Owner::CeId() const
211 { return inq_CeId(); }