1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef SW_UNOSECTION_HXX 25 #define SW_UNOSECTION_HXX 26 27 #include <com/sun/star/lang/XUnoTunnel.hpp> 28 #include <com/sun/star/lang/XServiceInfo.hpp> 29 #include <com/sun/star/beans/XPropertySet.hpp> 30 #include <com/sun/star/beans/XPropertyState.hpp> 31 #include <com/sun/star/beans/XMultiPropertySet.hpp> 32 #include <com/sun/star/container/XNamed.hpp> 33 #include <com/sun/star/text/XTextContent.hpp> 34 #include <com/sun/star/text/XTextSection.hpp> 35 36 #include <cppuhelper/implbase7.hxx> 37 38 #include <sfx2/Metadatable.hxx> 39 40 #include <unobaseclass.hxx> 41 42 43 class SwSectionFmt; 44 45 46 /*-----------------09.03.98 13:57------------------- 47 48 --------------------------------------------------*/ 49 50 51 struct SwTextSectionProperties_Impl; 52 53 typedef ::cppu::ImplInheritanceHelper7 54 < ::sfx2::MetadatableMixin 55 , ::com::sun::star::lang::XUnoTunnel 56 , ::com::sun::star::lang::XServiceInfo 57 , ::com::sun::star::beans::XPropertySet 58 , ::com::sun::star::beans::XPropertyState 59 , ::com::sun::star::beans::XMultiPropertySet 60 , ::com::sun::star::container::XNamed 61 , ::com::sun::star::text::XTextSection 62 > SwXTextSection_Base; 63 64 class SwXTextSection 65 : public SwXTextSection_Base 66 { 67 68 private: 69 70 class Impl; 71 ::sw::UnoImplPtr<Impl> m_pImpl; 72 73 SwXTextSection(SwSectionFmt *const pFmt, const bool bIndexHeader = false); 74 75 virtual ~SwXTextSection(); 76 77 public: 78 79 SwSectionFmt* GetFmt() const; 80 81 static ::com::sun::star::uno::Reference< 82 ::com::sun::star::text::XTextSection > 83 CreateXTextSection(SwSectionFmt *const pFmt = 0, 84 const bool bIndexHeader = false); 85 86 // MetadatableMixin 87 virtual ::sfx2::Metadatable* GetCoreObject(); 88 virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > 89 GetModel(); 90 91 static const ::com::sun::star::uno::Sequence< sal_Int8 >& getUnoTunnelId(); 92 93 // XUnoTunnel 94 virtual sal_Int64 SAL_CALL getSomething( 95 const ::com::sun::star::uno::Sequence< sal_Int8 >& rIdentifier); 96 97 // XServiceInfo 98 virtual ::rtl::OUString SAL_CALL getImplementationName(); 99 virtual sal_Bool SAL_CALL supportsService( 100 const ::rtl::OUString& rServiceName); 101 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL 102 getSupportedServiceNames(); 103 104 // XComponent 105 virtual void SAL_CALL dispose(); 106 virtual void SAL_CALL addEventListener( 107 const ::com::sun::star::uno::Reference< 108 ::com::sun::star::lang::XEventListener > & xListener); 109 virtual void SAL_CALL removeEventListener( 110 const ::com::sun::star::uno::Reference< 111 ::com::sun::star::lang::XEventListener > & xListener); 112 113 // XPropertySet 114 virtual ::com::sun::star::uno::Reference< 115 ::com::sun::star::beans::XPropertySetInfo > SAL_CALL 116 getPropertySetInfo(); 117 virtual void SAL_CALL setPropertyValue( 118 const ::rtl::OUString& rPropertyName, 119 const ::com::sun::star::uno::Any& rValue); 120 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( 121 const ::rtl::OUString& rPropertyName); 122 virtual void SAL_CALL addPropertyChangeListener( 123 const ::rtl::OUString& rPropertyName, 124 const ::com::sun::star::uno::Reference< 125 ::com::sun::star::beans::XPropertyChangeListener >& xListener); 126 virtual void SAL_CALL removePropertyChangeListener( 127 const ::rtl::OUString& rPropertyName, 128 const ::com::sun::star::uno::Reference< 129 ::com::sun::star::beans::XPropertyChangeListener >& xListener); 130 virtual void SAL_CALL addVetoableChangeListener( 131 const ::rtl::OUString& rPropertyName, 132 const ::com::sun::star::uno::Reference< 133 ::com::sun::star::beans::XVetoableChangeListener >& xListener); 134 virtual void SAL_CALL removeVetoableChangeListener( 135 const ::rtl::OUString& rPropertyName, 136 const ::com::sun::star::uno::Reference< 137 ::com::sun::star::beans::XVetoableChangeListener >& xListener); 138 139 // XPropertyState 140 virtual ::com::sun::star::beans::PropertyState SAL_CALL 141 getPropertyState(const ::rtl::OUString& rPropertyName); 142 virtual ::com::sun::star::uno::Sequence< 143 ::com::sun::star::beans::PropertyState > SAL_CALL 144 getPropertyStates( 145 const ::com::sun::star::uno::Sequence< 146 ::rtl::OUString >& rPropertyNames); 147 virtual void SAL_CALL setPropertyToDefault( 148 const ::rtl::OUString& rPropertyName); 149 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( 150 const ::rtl::OUString& rPropertyName); 151 152 // XMultiPropertySet 153 virtual void SAL_CALL setPropertyValues( 154 const ::com::sun::star::uno::Sequence< ::rtl::OUString >& 155 rPropertyNames, 156 const ::com::sun::star::uno::Sequence< 157 ::com::sun::star::uno::Any >& rValues); 158 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > 159 SAL_CALL getPropertyValues( 160 const ::com::sun::star::uno::Sequence< ::rtl::OUString >& 161 rPropertyNames); 162 virtual void SAL_CALL addPropertiesChangeListener( 163 const ::com::sun::star::uno::Sequence< ::rtl::OUString >& 164 rPropertyNames, 165 const ::com::sun::star::uno::Reference< 166 ::com::sun::star::beans::XPropertiesChangeListener >& xListener); 167 virtual void SAL_CALL removePropertiesChangeListener( 168 const ::com::sun::star::uno::Reference< 169 ::com::sun::star::beans::XPropertiesChangeListener >& xListener); 170 virtual void SAL_CALL firePropertiesChangeEvent( 171 const ::com::sun::star::uno::Sequence< ::rtl::OUString >& 172 rPropertyNames, 173 const ::com::sun::star::uno::Reference< 174 ::com::sun::star::beans::XPropertiesChangeListener >& xListener); 175 176 // XNamed 177 virtual ::rtl::OUString SAL_CALL getName(); 178 virtual void SAL_CALL setName(const ::rtl::OUString& rName); 179 180 // XTextContent 181 virtual void SAL_CALL attach( 182 const ::com::sun::star::uno::Reference< 183 ::com::sun::star::text::XTextRange > & xTextRange); 184 virtual ::com::sun::star::uno::Reference< 185 ::com::sun::star::text::XTextRange > SAL_CALL getAnchor(); 186 187 // XTextSection 188 virtual ::com::sun::star::uno::Reference< 189 ::com::sun::star::text::XTextSection > SAL_CALL 190 getParentSection(); 191 virtual ::com::sun::star::uno::Sequence< 192 ::com::sun::star::uno::Reference< 193 ::com::sun::star::text::XTextSection > > SAL_CALL 194 getChildSections(); 195 196 }; 197 198 #endif // SW_UNOSECTION_HXX 199