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_constant.hxx> 30 31 32 // NOT FULLY DECLARED SERVICES 33 #include <cosv/tpl/processor.hxx> 34 #include <ary/idl/ik_constant.hxx> 35 36 37 namespace ary 38 { 39 namespace idl 40 { 41 42 Constant::Constant( const String & i_sName, 43 Ce_id i_nOwner, 44 Ce_id i_nNameRoom, 45 Type_id i_nType, 46 const String & i_sInitValue ) 47 : sName(i_sName), 48 nNameRoom(i_nNameRoom), 49 nOwner(i_nOwner), 50 nType(i_nType), 51 sInitValue(i_sInitValue) 52 { 53 } 54 55 Constant::~Constant() 56 { 57 } 58 59 void 60 Constant::do_Accept( csv::ProcessorIfc & io_processor ) const 61 { 62 csv::CheckedCall(io_processor, *this); 63 } 64 65 66 ClassId 67 Constant::get_AryClass() const 68 { 69 return class_id; 70 } 71 72 const String & 73 Constant::inq_LocalName() const 74 { 75 return sName; 76 } 77 78 Ce_id 79 Constant::inq_NameRoom() const 80 { 81 return nNameRoom; 82 } 83 84 Ce_id 85 Constant::inq_Owner() const 86 { 87 return nOwner; 88 } 89 90 E_SightLevel 91 Constant::inq_SightLevel() const 92 { 93 return sl_Member; 94 } 95 96 97 namespace ifc_constant 98 { 99 100 inline const Constant & 101 constant_cast( const CodeEntity & i_ce ) 102 { 103 csv_assert( i_ce.AryClass() == Constant::class_id ); 104 return static_cast< const Constant& >(i_ce); 105 } 106 107 Type_id 108 attr::Type( const CodeEntity & i_ce ) 109 { 110 return constant_cast(i_ce).nType; 111 } 112 113 const String & 114 attr::Value( const CodeEntity & i_ce ) 115 { 116 return constant_cast(i_ce).sInitValue; 117 } 118 119 } // namespace ifc_constant 120 121 122 } // namespace idl 123 } // namespace ary 124