1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 #include <precomp.h> 29 #include <ary/idl/i_property.hxx> 30 #include <ary/idl/ik_property.hxx> 31 32 33 // NOT FULLY DECLARED SERVICES 34 #include <cosv/tpl/processor.hxx> 35 36 37 namespace ary 38 { 39 namespace idl 40 { 41 42 43 Property::Property( const String & i_sName, 44 Ce_id i_nService, 45 Ce_id i_nModule, 46 Type_id i_nType, 47 Stereotypes i_stereotypes ) 48 : sName(i_sName), 49 nOwner(i_nService), 50 nNameRoom(i_nModule), 51 nType(i_nType), 52 aStereotypes(i_stereotypes) 53 { 54 } 55 56 Property::~Property() 57 { 58 } 59 60 61 void 62 Property::do_Accept( csv::ProcessorIfc & io_processor ) const 63 { 64 csv::CheckedCall(io_processor, *this); 65 } 66 67 ClassId 68 Property::get_AryClass() const 69 { 70 return class_id; 71 } 72 73 const String & 74 Property::inq_LocalName() const 75 { 76 return sName; 77 } 78 79 Ce_id 80 Property::inq_NameRoom() const 81 { 82 return nNameRoom; 83 } 84 85 Ce_id 86 Property::inq_Owner() const 87 { 88 return nOwner; 89 } 90 91 E_SightLevel 92 Property::inq_SightLevel() const 93 { 94 return sl_Member; 95 } 96 97 namespace ifc_property 98 { 99 100 inline const Property & 101 property_cast( const CodeEntity & i_ce ) 102 { 103 csv_assert( i_ce.AryClass() == Property::class_id ); 104 return static_cast< const Property& >(i_ce); 105 } 106 107 bool 108 attr::HasAnyStereotype( const CodeEntity & i_ce ) 109 { 110 return property_cast(i_ce).aStereotypes.HasAny(); 111 } 112 113 bool 114 attr::IsReadOnly( const CodeEntity & i_ce ) 115 { 116 return property_cast(i_ce).aStereotypes.IsReadOnly(); 117 } 118 119 bool 120 attr::IsBound( const CodeEntity & i_ce ) 121 { 122 return property_cast(i_ce).aStereotypes.IsBound(); 123 } 124 125 bool 126 attr::IsConstrained( const CodeEntity & i_ce ) 127 { 128 return property_cast(i_ce).aStereotypes.IsConstrained(); 129 } 130 131 bool 132 attr::IsMayBeAmbiguous( const CodeEntity & i_ce ) 133 { 134 return property_cast(i_ce).aStereotypes.IsMayBeAmbiguous(); 135 } 136 137 bool 138 attr::IsMayBeDefault( const CodeEntity & i_ce ) 139 { 140 return property_cast(i_ce).aStereotypes.IsMayBeDefault(); 141 } 142 143 bool 144 attr::IsMayBeVoid( const CodeEntity & i_ce ) 145 { 146 return property_cast(i_ce).aStereotypes.IsMayBeVoid(); 147 } 148 149 bool 150 attr::IsRemovable( const CodeEntity & i_ce ) 151 { 152 return property_cast(i_ce).aStereotypes.IsRemovable(); 153 } 154 155 bool 156 attr::IsTransient( const CodeEntity & i_ce ) 157 { 158 return property_cast(i_ce).aStereotypes.IsTransient(); 159 } 160 161 Type_id 162 attr::Type( const CodeEntity & i_ce ) 163 { 164 return property_cast(i_ce).nType; 165 } 166 167 } // namespace ifc_property 168 169 170 } // namespace idl 171 } // namespace ary 172