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 #ifndef ARY_CPP_C_CE_HXX 29 #define ARY_CPP_C_CE_HXX 30 31 32 // USED SERVICES 33 // BASE CLASSES 34 #include <ary/cpp/c_cppentity.hxx> 35 // COMPONENTS 36 #include <ary/doc/d_docu.hxx> 37 // PARAMETERS 38 #include <ary/cpp/c_types4cpp.hxx> 39 #include <ary/cpp/c_traits.hxx> 40 #include <ary/loc/loc_types4loc.hxx> 41 42 43 namespace ary 44 { 45 namespace cpp 46 { 47 48 typedef loc::Le_id Lid; 49 50 51 52 /** Represents a C++ code entity. 53 */ 54 class CodeEntity : public ary::cpp::CppEntity 55 { 56 public: 57 typedef Ce_Traits traits_t; 58 59 // LIFECYCLE 60 virtual ~CodeEntity() {} 61 62 // INQUIRY 63 Ce_id CeId() const { return Ce_id(Id()); } 64 const String & LocalName() const; 65 Cid Owner() const; 66 Lid Location() const; 67 bool IsVisible() const; 68 69 // ACCESS 70 void Set_InVisible() { bIsVisible = false; } 71 72 protected: 73 CodeEntity() : bIsVisible(true) {} 74 75 private: 76 // Locals 77 virtual const String & 78 inq_LocalName() const = 0; 79 virtual Cid inq_Owner() const = 0; 80 virtual Lid inq_Location() const = 0; 81 82 // DATA 83 mutable bool bIsVisible; 84 }; 85 86 87 // IMPLEMENTATION 88 inline const String & 89 CodeEntity::LocalName() const 90 { return inq_LocalName(); } 91 inline Cid 92 CodeEntity::Owner() const 93 { return inq_Owner(); } 94 inline Lid 95 CodeEntity::Location() const 96 { return inq_Location(); } 97 98 99 100 101 } // namespace cpp 102 } // namespace ary 103 #endif 104