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 SW_UNOREFMARK_HXX 29 #define SW_UNOREFMARK_HXX 30 31 #include <com/sun/star/lang/XUnoTunnel.hpp> 32 #include <com/sun/star/lang/XServiceInfo.hpp> 33 #include <com/sun/star/beans/XPropertySet.hpp> 34 #include <com/sun/star/container/XNamed.hpp> 35 #include <com/sun/star/text/XTextContent.hpp> 36 37 #include <cppuhelper/implbase5.hxx> 38 39 #include <unobaseclass.hxx> 40 41 42 class SwDoc; 43 class SwModify; 44 class SwFmtRefMark; 45 46 47 /* -----------------27.08.98 15:11------------------- 48 * 49 * --------------------------------------------------*/ 50 typedef ::cppu::WeakImplHelper5 51 < ::com::sun::star::lang::XUnoTunnel 52 , ::com::sun::star::lang::XServiceInfo 53 , ::com::sun::star::beans::XPropertySet 54 , ::com::sun::star::container::XNamed 55 , ::com::sun::star::text::XTextContent 56 > SwXReferenceMark_Base; 57 58 class SwXReferenceMark 59 : public SwXReferenceMark_Base 60 { 61 62 private: 63 64 class Impl; 65 ::sw::UnoImplPtr<Impl> m_pImpl; 66 67 virtual ~SwXReferenceMark(); 68 69 public: 70 71 SwXReferenceMark(SwDoc *const pDoc, const SwFmtRefMark *const pMark); 72 73 static SwXReferenceMark * 74 CreateXReferenceMark(SwDoc & rDoc, SwFmtRefMark const& rMarkFmt); 75 /// may return 0 76 static SwXReferenceMark * 77 GetReferenceMark(SwModify const& rUnoCB, SwFmtRefMark const& rMarkFmt); 78 79 static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId(); 80 81 // XUnoTunnel 82 virtual sal_Int64 SAL_CALL getSomething( 83 const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier) 84 throw (::com::sun::star::uno::RuntimeException); 85 86 // XServiceInfo 87 virtual ::rtl::OUString SAL_CALL getImplementationName() 88 throw (::com::sun::star::uno::RuntimeException); 89 virtual sal_Bool SAL_CALL supportsService( 90 const ::rtl::OUString& rServiceName) 91 throw (::com::sun::star::uno::RuntimeException); 92 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL 93 getSupportedServiceNames() 94 throw (::com::sun::star::uno::RuntimeException); 95 96 // XComponent 97 virtual void SAL_CALL dispose() 98 throw (::com::sun::star::uno::RuntimeException); 99 virtual void SAL_CALL addEventListener( 100 const ::com::sun::star::uno::Reference< 101 ::com::sun::star::lang::XEventListener > & xListener) 102 throw (::com::sun::star::uno::RuntimeException); 103 virtual void SAL_CALL removeEventListener( 104 const ::com::sun::star::uno::Reference< 105 ::com::sun::star::lang::XEventListener > & xListener) 106 throw (::com::sun::star::uno::RuntimeException); 107 108 // XPropertySet 109 virtual ::com::sun::star::uno::Reference< 110 ::com::sun::star::beans::XPropertySetInfo > SAL_CALL 111 getPropertySetInfo() 112 throw (::com::sun::star::uno::RuntimeException); 113 virtual void SAL_CALL setPropertyValue( 114 const ::rtl::OUString& rPropertyName, 115 const ::com::sun::star::uno::Any& rValue) 116 throw (::com::sun::star::beans::UnknownPropertyException, 117 ::com::sun::star::beans::PropertyVetoException, 118 ::com::sun::star::lang::IllegalArgumentException, 119 ::com::sun::star::lang::WrappedTargetException, 120 ::com::sun::star::uno::RuntimeException); 121 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( 122 const ::rtl::OUString& rPropertyName) 123 throw (::com::sun::star::beans::UnknownPropertyException, 124 ::com::sun::star::lang::WrappedTargetException, 125 ::com::sun::star::uno::RuntimeException); 126 virtual void SAL_CALL addPropertyChangeListener( 127 const ::rtl::OUString& rPropertyName, 128 const ::com::sun::star::uno::Reference< 129 ::com::sun::star::beans::XPropertyChangeListener >& xListener) 130 throw (::com::sun::star::beans::UnknownPropertyException, 131 ::com::sun::star::lang::WrappedTargetException, 132 ::com::sun::star::uno::RuntimeException); 133 virtual void SAL_CALL removePropertyChangeListener( 134 const ::rtl::OUString& rPropertyName, 135 const ::com::sun::star::uno::Reference< 136 ::com::sun::star::beans::XPropertyChangeListener >& xListener) 137 throw (::com::sun::star::beans::UnknownPropertyException, 138 ::com::sun::star::lang::WrappedTargetException, 139 ::com::sun::star::uno::RuntimeException); 140 virtual void SAL_CALL addVetoableChangeListener( 141 const ::rtl::OUString& rPropertyName, 142 const ::com::sun::star::uno::Reference< 143 ::com::sun::star::beans::XVetoableChangeListener >& xListener) 144 throw (::com::sun::star::beans::UnknownPropertyException, 145 ::com::sun::star::lang::WrappedTargetException, 146 ::com::sun::star::uno::RuntimeException); 147 virtual void SAL_CALL removeVetoableChangeListener( 148 const ::rtl::OUString& rPropertyName, 149 const ::com::sun::star::uno::Reference< 150 ::com::sun::star::beans::XVetoableChangeListener >& xListener) 151 throw (::com::sun::star::beans::UnknownPropertyException, 152 ::com::sun::star::lang::WrappedTargetException, 153 ::com::sun::star::uno::RuntimeException); 154 155 // XNamed 156 virtual ::rtl::OUString SAL_CALL getName() 157 throw (::com::sun::star::uno::RuntimeException); 158 virtual void SAL_CALL setName(const ::rtl::OUString& rName) 159 throw (::com::sun::star::uno::RuntimeException); 160 161 // XTextContent 162 virtual void SAL_CALL attach( 163 const ::com::sun::star::uno::Reference< 164 ::com::sun::star::text::XTextRange > & xTextRange) 165 throw (::com::sun::star::lang::IllegalArgumentException, 166 ::com::sun::star::uno::RuntimeException); 167 virtual ::com::sun::star::uno::Reference< 168 ::com::sun::star::text::XTextRange > SAL_CALL getAnchor() 169 throw (::com::sun::star::uno::RuntimeException); 170 171 }; 172 173 #endif // SW_UNOREFMARK_HXX 174 175