merge the formfield patch from ooo-build
[ooovba.git] / autodoc / source / ary / idl / i_service.cxx
blob74856e618d0f0f255c2148ab5cbf0e93168ecd25
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_service.cxx,v $
10 * $Revision: 1.7 $
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_service.hxx>
35 // NOT FULLY DECLARED SERVICES
36 #include <cosv/tpl/processor.hxx>
37 #include <ary/idl/ik_service.hxx>
38 #include <ary/doc/d_oldidldocu.hxx>
39 #include <sci_impl.hxx>
40 #include "i2s_calculator.hxx"
43 namespace ary
45 namespace idl
48 Service::Service( const String & i_sName,
49 Ce_id i_nOwner )
50 : sName(i_sName),
51 nOwner(i_nOwner),
52 aIncludedServices(),
53 aSupportedInterfaces(),
54 aProperties()
58 Service::~Service()
60 for ( RelationList::iterator it = aIncludedServices.begin();
61 it != aIncludedServices.end();
62 ++it )
64 delete (*it).Info();
67 for ( RelationList::iterator it = aSupportedInterfaces.begin();
68 it != aSupportedInterfaces.end();
69 ++it )
71 delete (*it).Info();
75 void
76 Service::Get_SupportedInterfaces( Dyn_StdConstIterator<CommentedRelation> & o_rResult ) const
78 o_rResult = new SCI_Vector<CommentedRelation>(aSupportedInterfaces);
81 void
82 Service::Get_IncludedServices( Dyn_StdConstIterator<CommentedRelation> & o_rResult ) const
84 o_rResult = new SCI_Vector<CommentedRelation>(aIncludedServices);
87 void
88 Service::do_Accept( csv::ProcessorIfc & io_processor ) const
90 csv::CheckedCall(io_processor, *this);
93 ClassId
94 Service::get_AryClass() const
96 return class_id;
99 const String &
100 Service::inq_LocalName() const
102 return sName;
105 Ce_id
106 Service::inq_NameRoom() const
108 return nOwner;
111 Ce_id
112 Service::inq_Owner() const
114 return nOwner;
117 E_SightLevel
118 Service::inq_SightLevel() const
120 return sl_File;
124 namespace ifc_service
127 inline const Service &
128 service_cast( const CodeEntity & i_ce )
130 csv_assert( i_ce.AryClass() == Service::class_id );
131 return static_cast< const Service& >(i_ce);
134 void
135 attr::Get_IncludedServices( Dyn_StdConstIterator<CommentedRelation> & o_result,
136 const CodeEntity & i_ce )
138 o_result = new SCI_Vector<CommentedRelation>( service_cast(i_ce).aIncludedServices );
141 void
142 attr::Get_ExportedInterfaces( Dyn_StdConstIterator<CommentedRelation> & o_result,
143 const CodeEntity & i_ce )
145 o_result = new SCI_Vector<CommentedRelation>( service_cast(i_ce).aSupportedInterfaces );
148 void
149 attr::Get_Properties( Dyn_CeIterator & o_result,
150 const CodeEntity & i_ce )
152 o_result = new SCI_Vector<Ce_id>( service_cast(i_ce).aProperties );
155 void
156 xref::Get_IncludingServices( Dyn_CeIterator & o_result,
157 const CodeEntity & i_ce )
159 o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(service_2s_IncludingServices));
162 void
163 xref::Get_InstantiatingSingletons( Dyn_CeIterator & o_result,
164 const CodeEntity & i_ce )
166 o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(service_2s_InstantiatingSingletons));
170 } // namespace ifc_service
173 } // namespace idl
174 } // namespace ary