Update ooo320-m1
[ooovba.git] / autodoc / source / ary / idl / i_interface.cxx
blob9f400618a514071f3567394ef6db68ca0ad460a2
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: i_interface.cxx,v $
10 * $Revision: 1.8 $
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 #include <precomp.h>
32 #include <ary/idl/i_interface.hxx>
35 // NOT FULLY DECLARED SERVICES
36 #include <cosv/tpl/processor.hxx>
37 #include <ary/idl/ik_interface.hxx>
38 #include <ary/doc/d_oldidldocu.hxx>
39 #include <sci_impl.hxx>
40 #include "i2s_calculator.hxx"
43 namespace ary
45 namespace idl
49 class Interface_2s
54 Interface::Interface( const String & i_sName,
55 Ce_id i_nOwner )
56 : sName(i_sName),
57 nOwner(i_nOwner),
58 aBases(),
59 aFunctions(),
60 aAttributes(),
61 p2s()
65 Interface::~Interface()
67 for ( RelationList::iterator it = aBases.begin();
68 it != aBases.end();
69 ++it )
71 delete (*it).Info();
75 void
76 Interface::do_Accept( csv::ProcessorIfc & io_processor ) const
78 csv::CheckedCall(io_processor, *this);
81 ClassId
82 Interface::get_AryClass() const
84 return class_id;
87 const String &
88 Interface::inq_LocalName() const
90 return sName;
93 Ce_id
94 Interface::inq_NameRoom() const
96 return nOwner;
99 Ce_id
100 Interface::inq_Owner() const
102 return nOwner;
105 E_SightLevel
106 Interface::inq_SightLevel() const
108 return sl_File;
112 namespace ifc_interface
115 inline const Interface &
116 interface_cast( const CodeEntity & i_ce )
118 csv_assert( i_ce.AryClass() == Interface::class_id );
119 return static_cast< const Interface& >(i_ce);
122 void
123 attr::Get_Bases( Dyn_StdConstIterator<CommentedRelation> & o_result,
124 const CodeEntity & i_ce )
126 o_result = new SCI_Vector<CommentedRelation>(interface_cast(i_ce).aBases);
129 void
130 attr::Get_Functions( Dyn_CeIterator & o_result,
131 const CodeEntity & i_ce )
133 o_result = new SCI_Vector<Ce_id>(interface_cast(i_ce).aFunctions);
136 void
137 attr::Get_Attributes( Dyn_CeIterator & o_result,
138 const CodeEntity & i_ce )
140 o_result = new SCI_Vector<Ce_id>(interface_cast(i_ce).aAttributes);
143 void
144 xref::Get_Derivations( Dyn_CeIterator & o_result,
145 const CodeEntity & i_ce )
147 o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(interface_2s_Derivations));
150 void
151 xref::Get_SynonymTypedefs( Dyn_CeIterator & o_result,
152 const CodeEntity & i_ce )
154 o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(interface_2s_SynonymTypedefs));
157 void
158 xref::Get_ExportingServices( Dyn_CeIterator & o_result,
159 const CodeEntity & i_ce )
161 o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(interface_2s_ExportingServices));
164 void
165 xref::Get_ExportingSingletons( Dyn_CeIterator & o_result,
166 const CodeEntity & i_ce )
168 o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(interface_2s_ExportingSingletons));
171 void
172 xref::Get_AsReturns( Dyn_CeIterator & o_result,
173 const CodeEntity & i_ce )
175 o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(interface_2s_AsReturns));
178 void
179 xref::Get_AsParameters( Dyn_CeIterator & o_result,
180 const CodeEntity & i_ce )
182 o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(interface_2s_AsParameters));
185 void
186 xref::Get_AsDataTypes( Dyn_CeIterator & o_result,
187 const CodeEntity & i_ce )
189 o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(interface_2s_AsDataTypes));
195 } // namespace ifc_interface
198 } // namespace idl
199 } // namespace ary