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_CESLOT_HXX 29 #define ARY_CESLOT_HXX 30 // KORR_DEPRECATED_3.0 31 32 33 // USED SERVICES 34 // BASE CLASSES 35 // COMPONENTS 36 // PARAMETERS 37 38 namespace ary 39 { 40 41 class Display; 42 43 /** Unterscheidungen von Slots 44 45 Slots: 46 - ReadWrite or ReadOnly 47 - ContentType 48 - Groups 49 - MemberLink 'EnumValue from Enum' or 'Class from Namespace' 50 - MemberData 'Parameter from Operation' 51 - SimpleLink 52 - CommentedLink 'Baseclass from Class' 53 - DefaultCommentedLink 'Class from GlobaIndex' 54 */ 55 56 class Slot 57 { 58 public: 59 virtual ~Slot() {} 60 61 virtual void StoreAt( 62 Display & o_rDestination ) const; 63 virtual uintt Size() const = 0; 64 65 private: 66 virtual void StoreEntries( 67 Display & o_rDestination ) const = 0; 68 }; 69 70 class Slot_AutoPtr 71 { 72 public: 73 Slot_AutoPtr( 74 Slot * i_pSlot = 0 ) 75 : pSlot(i_pSlot) {} 76 ~Slot_AutoPtr() { if (pSlot != 0) delete pSlot; } 77 78 Slot_AutoPtr & operator=( 79 Slot * i_pSlot ) 80 { if (pSlot != 0) delete pSlot; 81 pSlot = i_pSlot; 82 return *this; } 83 operator bool() const { return pSlot != 0; } 84 85 const Slot & operator*() { csv_assert(pSlot != 0); 86 return *pSlot; } 87 const Slot * operator->() { csv_assert(pSlot != 0); 88 return pSlot; } 89 90 private: 91 // Forbidden functions 92 Slot_AutoPtr(const Slot_AutoPtr &); 93 Slot_AutoPtr & operator=(const Slot_AutoPtr &); 94 95 // DATA 96 Slot * pSlot; 97 }; 98 99 100 101 102 } // namespace ary 103 #endif 104