1*1d2dbeb0SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*1d2dbeb0SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*1d2dbeb0SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*1d2dbeb0SAndrew Rist * distributed with this work for additional information 6*1d2dbeb0SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*1d2dbeb0SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*1d2dbeb0SAndrew Rist * "License"); you may not use this file except in compliance 9*1d2dbeb0SAndrew Rist * with the License. You may obtain a copy of the License at 10*1d2dbeb0SAndrew Rist * 11*1d2dbeb0SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*1d2dbeb0SAndrew Rist * 13*1d2dbeb0SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*1d2dbeb0SAndrew Rist * software distributed under the License is distributed on an 15*1d2dbeb0SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*1d2dbeb0SAndrew Rist * KIND, either express or implied. See the License for the 17*1d2dbeb0SAndrew Rist * specific language governing permissions and limitations 18*1d2dbeb0SAndrew Rist * under the License. 19*1d2dbeb0SAndrew Rist * 20*1d2dbeb0SAndrew Rist *************************************************************/ 21*1d2dbeb0SAndrew Rist 22*1d2dbeb0SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef SW_UNOTEXTBODYHF_HXX 25cdf0e10cSrcweir #define SW_UNOTEXTBODYHF_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include <com/sun/star/lang/XUnoTunnel.hpp> 28cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp> 29cdf0e10cSrcweir #include <com/sun/star/container/XEnumerationAccess.hpp> 30cdf0e10cSrcweir 31cdf0e10cSrcweir #include <cppuhelper/implbase2.hxx> 32cdf0e10cSrcweir 33cdf0e10cSrcweir #include <unotext.hxx> 34cdf0e10cSrcweir 35cdf0e10cSrcweir 36cdf0e10cSrcweir class SwDoc; 37cdf0e10cSrcweir class SwFrmFmt; 38cdf0e10cSrcweir class SwXTextCursor; 39cdf0e10cSrcweir 40cdf0e10cSrcweir 41cdf0e10cSrcweir typedef ::cppu::WeakAggImplHelper2 42cdf0e10cSrcweir < ::com::sun::star::lang::XServiceInfo 43cdf0e10cSrcweir , ::com::sun::star::container::XEnumerationAccess 44cdf0e10cSrcweir > SwXBodyText_Base; 45cdf0e10cSrcweir 46cdf0e10cSrcweir class SwXBodyText 47cdf0e10cSrcweir : public SwXBodyText_Base 48cdf0e10cSrcweir , public SwXText 49cdf0e10cSrcweir { 50cdf0e10cSrcweir 51cdf0e10cSrcweir protected: 52cdf0e10cSrcweir 53cdf0e10cSrcweir virtual ~SwXBodyText(); 54cdf0e10cSrcweir 55cdf0e10cSrcweir public: 56cdf0e10cSrcweir 57cdf0e10cSrcweir SwXBodyText(SwDoc *const pDoc); 58cdf0e10cSrcweir 59cdf0e10cSrcweir SwXTextCursor * CreateTextCursor(const bool bIgnoreTables = false); 60cdf0e10cSrcweir 61cdf0e10cSrcweir // XInterface 62cdf0e10cSrcweir virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( 63cdf0e10cSrcweir const ::com::sun::star::uno::Type& rType) 64cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); acquire()65cdf0e10cSrcweir virtual void SAL_CALL acquire() throw() { OWeakObject::acquire(); } release()66cdf0e10cSrcweir virtual void SAL_CALL release() throw() { OWeakObject::release(); } 67cdf0e10cSrcweir 68cdf0e10cSrcweir // XAggregation 69cdf0e10cSrcweir virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( 70cdf0e10cSrcweir const ::com::sun::star::uno::Type& rType) 71cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 72cdf0e10cSrcweir 73cdf0e10cSrcweir // XTypeProvider 74cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > 75cdf0e10cSrcweir SAL_CALL getTypes() 76cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 77cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL 78cdf0e10cSrcweir getImplementationId() 79cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 80cdf0e10cSrcweir 81cdf0e10cSrcweir // XServiceInfo 82cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getImplementationName() 83cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 84cdf0e10cSrcweir virtual sal_Bool SAL_CALL supportsService( 85cdf0e10cSrcweir const ::rtl::OUString& rServiceName) 86cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 87cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL 88cdf0e10cSrcweir getSupportedServiceNames() 89cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 90cdf0e10cSrcweir 91cdf0e10cSrcweir // XElementAccess 92cdf0e10cSrcweir virtual ::com::sun::star::uno::Type SAL_CALL getElementType() 93cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 94cdf0e10cSrcweir virtual sal_Bool SAL_CALL hasElements() 95cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 96cdf0e10cSrcweir 97cdf0e10cSrcweir // XEnumerationAccess 98cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 99cdf0e10cSrcweir ::com::sun::star::container::XEnumeration > SAL_CALL 100cdf0e10cSrcweir createEnumeration() 101cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 102cdf0e10cSrcweir 103cdf0e10cSrcweir // XSimpleText 104cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 105cdf0e10cSrcweir ::com::sun::star::text::XTextCursor > SAL_CALL 106cdf0e10cSrcweir createTextCursor() 107cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 108cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 109cdf0e10cSrcweir ::com::sun::star::text::XTextCursor > SAL_CALL 110cdf0e10cSrcweir createTextCursorByRange( 111cdf0e10cSrcweir const ::com::sun::star::uno::Reference< 112cdf0e10cSrcweir ::com::sun::star::text::XTextRange > & xTextPosition) 113cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 114cdf0e10cSrcweir 115cdf0e10cSrcweir }; 116cdf0e10cSrcweir 117cdf0e10cSrcweir 118cdf0e10cSrcweir /* -----------------25.08.98 11:02------------------- 119cdf0e10cSrcweir * 120cdf0e10cSrcweir * --------------------------------------------------*/ 121cdf0e10cSrcweir typedef ::cppu::WeakImplHelper2 122cdf0e10cSrcweir < ::com::sun::star::lang::XServiceInfo 123cdf0e10cSrcweir , ::com::sun::star::container::XEnumerationAccess 124cdf0e10cSrcweir > SwXHeadFootText_Base; 125cdf0e10cSrcweir 126cdf0e10cSrcweir class SwXHeadFootText 127cdf0e10cSrcweir : public SwXHeadFootText_Base 128cdf0e10cSrcweir , public SwXText 129cdf0e10cSrcweir { 130cdf0e10cSrcweir 131cdf0e10cSrcweir private: 132cdf0e10cSrcweir 133cdf0e10cSrcweir class Impl; 134cdf0e10cSrcweir ::sw::UnoImplPtr<Impl> m_pImpl; 135cdf0e10cSrcweir 136cdf0e10cSrcweir protected: 137cdf0e10cSrcweir 138cdf0e10cSrcweir virtual const SwStartNode *GetStartNode() const; 139cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 140cdf0e10cSrcweir ::com::sun::star::text::XTextCursor > 141cdf0e10cSrcweir CreateCursor() 142cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 143cdf0e10cSrcweir 144cdf0e10cSrcweir virtual ~SwXHeadFootText(); 145cdf0e10cSrcweir 146cdf0e10cSrcweir SwXHeadFootText(SwFrmFmt & rHeadFootFmt, const bool bIsHeader); 147cdf0e10cSrcweir 148cdf0e10cSrcweir public: 149cdf0e10cSrcweir 150cdf0e10cSrcweir static ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > 151cdf0e10cSrcweir CreateXHeadFootText(SwFrmFmt & rHeadFootFmt, const bool bIsHeader); 152cdf0e10cSrcweir static bool IsXHeadFootText(SwClient *const pClient); 153cdf0e10cSrcweir 154cdf0e10cSrcweir // XInterface 155cdf0e10cSrcweir virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( 156cdf0e10cSrcweir const ::com::sun::star::uno::Type& rType) 157cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); acquire()158cdf0e10cSrcweir virtual void SAL_CALL acquire() throw() { OWeakObject::acquire(); } release()159cdf0e10cSrcweir virtual void SAL_CALL release() throw() { OWeakObject::release(); } 160cdf0e10cSrcweir 161cdf0e10cSrcweir // XTypeProvider 162cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > 163cdf0e10cSrcweir SAL_CALL getTypes() 164cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 165cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL 166cdf0e10cSrcweir getImplementationId() 167cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 168cdf0e10cSrcweir 169cdf0e10cSrcweir // XServiceInfo 170cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getImplementationName() 171cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 172cdf0e10cSrcweir virtual sal_Bool SAL_CALL supportsService( 173cdf0e10cSrcweir const ::rtl::OUString& rServiceName) 174cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 175cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL 176cdf0e10cSrcweir getSupportedServiceNames() 177cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 178cdf0e10cSrcweir 179cdf0e10cSrcweir // XElementAccess 180cdf0e10cSrcweir virtual ::com::sun::star::uno::Type SAL_CALL getElementType() 181cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 182cdf0e10cSrcweir virtual sal_Bool SAL_CALL hasElements() 183cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 184cdf0e10cSrcweir 185cdf0e10cSrcweir // XEnumerationAccess 186cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 187cdf0e10cSrcweir ::com::sun::star::container::XEnumeration > SAL_CALL 188cdf0e10cSrcweir createEnumeration() 189cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 190cdf0e10cSrcweir 191cdf0e10cSrcweir // XSimpleText 192cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 193cdf0e10cSrcweir ::com::sun::star::text::XTextCursor > SAL_CALL 194cdf0e10cSrcweir createTextCursor() 195cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 196cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 197cdf0e10cSrcweir ::com::sun::star::text::XTextCursor > SAL_CALL 198cdf0e10cSrcweir createTextCursorByRange( 199cdf0e10cSrcweir const ::com::sun::star::uno::Reference< 200cdf0e10cSrcweir ::com::sun::star::text::XTextRange > & xTextPosition) 201cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 202cdf0e10cSrcweir 203cdf0e10cSrcweir }; 204cdf0e10cSrcweir 205cdf0e10cSrcweir #endif // SW_UNOTEXTBODYHF_HXX 206cdf0e10cSrcweir 207