1*cdf0e10cSrcweir /************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir 28*cdf0e10cSrcweir #ifndef SW_UNOTEXTBODYHF_HXX 29*cdf0e10cSrcweir #define SW_UNOTEXTBODYHF_HXX 30*cdf0e10cSrcweir 31*cdf0e10cSrcweir #include <com/sun/star/lang/XUnoTunnel.hpp> 32*cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp> 33*cdf0e10cSrcweir #include <com/sun/star/container/XEnumerationAccess.hpp> 34*cdf0e10cSrcweir 35*cdf0e10cSrcweir #include <cppuhelper/implbase2.hxx> 36*cdf0e10cSrcweir 37*cdf0e10cSrcweir #include <unotext.hxx> 38*cdf0e10cSrcweir 39*cdf0e10cSrcweir 40*cdf0e10cSrcweir class SwDoc; 41*cdf0e10cSrcweir class SwFrmFmt; 42*cdf0e10cSrcweir class SwXTextCursor; 43*cdf0e10cSrcweir 44*cdf0e10cSrcweir 45*cdf0e10cSrcweir typedef ::cppu::WeakAggImplHelper2 46*cdf0e10cSrcweir < ::com::sun::star::lang::XServiceInfo 47*cdf0e10cSrcweir , ::com::sun::star::container::XEnumerationAccess 48*cdf0e10cSrcweir > SwXBodyText_Base; 49*cdf0e10cSrcweir 50*cdf0e10cSrcweir class SwXBodyText 51*cdf0e10cSrcweir : public SwXBodyText_Base 52*cdf0e10cSrcweir , public SwXText 53*cdf0e10cSrcweir { 54*cdf0e10cSrcweir 55*cdf0e10cSrcweir protected: 56*cdf0e10cSrcweir 57*cdf0e10cSrcweir virtual ~SwXBodyText(); 58*cdf0e10cSrcweir 59*cdf0e10cSrcweir public: 60*cdf0e10cSrcweir 61*cdf0e10cSrcweir SwXBodyText(SwDoc *const pDoc); 62*cdf0e10cSrcweir 63*cdf0e10cSrcweir SwXTextCursor * CreateTextCursor(const bool bIgnoreTables = false); 64*cdf0e10cSrcweir 65*cdf0e10cSrcweir // XInterface 66*cdf0e10cSrcweir virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( 67*cdf0e10cSrcweir const ::com::sun::star::uno::Type& rType) 68*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 69*cdf0e10cSrcweir virtual void SAL_CALL acquire() throw() { OWeakObject::acquire(); } 70*cdf0e10cSrcweir virtual void SAL_CALL release() throw() { OWeakObject::release(); } 71*cdf0e10cSrcweir 72*cdf0e10cSrcweir // XAggregation 73*cdf0e10cSrcweir virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( 74*cdf0e10cSrcweir const ::com::sun::star::uno::Type& rType) 75*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 76*cdf0e10cSrcweir 77*cdf0e10cSrcweir // XTypeProvider 78*cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > 79*cdf0e10cSrcweir SAL_CALL getTypes() 80*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 81*cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL 82*cdf0e10cSrcweir getImplementationId() 83*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 84*cdf0e10cSrcweir 85*cdf0e10cSrcweir // XServiceInfo 86*cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getImplementationName() 87*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 88*cdf0e10cSrcweir virtual sal_Bool SAL_CALL supportsService( 89*cdf0e10cSrcweir const ::rtl::OUString& rServiceName) 90*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 91*cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL 92*cdf0e10cSrcweir getSupportedServiceNames() 93*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 94*cdf0e10cSrcweir 95*cdf0e10cSrcweir // XElementAccess 96*cdf0e10cSrcweir virtual ::com::sun::star::uno::Type SAL_CALL getElementType() 97*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 98*cdf0e10cSrcweir virtual sal_Bool SAL_CALL hasElements() 99*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 100*cdf0e10cSrcweir 101*cdf0e10cSrcweir // XEnumerationAccess 102*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 103*cdf0e10cSrcweir ::com::sun::star::container::XEnumeration > SAL_CALL 104*cdf0e10cSrcweir createEnumeration() 105*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 106*cdf0e10cSrcweir 107*cdf0e10cSrcweir // XSimpleText 108*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 109*cdf0e10cSrcweir ::com::sun::star::text::XTextCursor > SAL_CALL 110*cdf0e10cSrcweir createTextCursor() 111*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 112*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 113*cdf0e10cSrcweir ::com::sun::star::text::XTextCursor > SAL_CALL 114*cdf0e10cSrcweir createTextCursorByRange( 115*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< 116*cdf0e10cSrcweir ::com::sun::star::text::XTextRange > & xTextPosition) 117*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 118*cdf0e10cSrcweir 119*cdf0e10cSrcweir }; 120*cdf0e10cSrcweir 121*cdf0e10cSrcweir 122*cdf0e10cSrcweir /* -----------------25.08.98 11:02------------------- 123*cdf0e10cSrcweir * 124*cdf0e10cSrcweir * --------------------------------------------------*/ 125*cdf0e10cSrcweir typedef ::cppu::WeakImplHelper2 126*cdf0e10cSrcweir < ::com::sun::star::lang::XServiceInfo 127*cdf0e10cSrcweir , ::com::sun::star::container::XEnumerationAccess 128*cdf0e10cSrcweir > SwXHeadFootText_Base; 129*cdf0e10cSrcweir 130*cdf0e10cSrcweir class SwXHeadFootText 131*cdf0e10cSrcweir : public SwXHeadFootText_Base 132*cdf0e10cSrcweir , public SwXText 133*cdf0e10cSrcweir { 134*cdf0e10cSrcweir 135*cdf0e10cSrcweir private: 136*cdf0e10cSrcweir 137*cdf0e10cSrcweir class Impl; 138*cdf0e10cSrcweir ::sw::UnoImplPtr<Impl> m_pImpl; 139*cdf0e10cSrcweir 140*cdf0e10cSrcweir protected: 141*cdf0e10cSrcweir 142*cdf0e10cSrcweir virtual const SwStartNode *GetStartNode() const; 143*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 144*cdf0e10cSrcweir ::com::sun::star::text::XTextCursor > 145*cdf0e10cSrcweir CreateCursor() 146*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 147*cdf0e10cSrcweir 148*cdf0e10cSrcweir virtual ~SwXHeadFootText(); 149*cdf0e10cSrcweir 150*cdf0e10cSrcweir SwXHeadFootText(SwFrmFmt & rHeadFootFmt, const bool bIsHeader); 151*cdf0e10cSrcweir 152*cdf0e10cSrcweir public: 153*cdf0e10cSrcweir 154*cdf0e10cSrcweir static ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > 155*cdf0e10cSrcweir CreateXHeadFootText(SwFrmFmt & rHeadFootFmt, const bool bIsHeader); 156*cdf0e10cSrcweir static bool IsXHeadFootText(SwClient *const pClient); 157*cdf0e10cSrcweir 158*cdf0e10cSrcweir // XInterface 159*cdf0e10cSrcweir virtual ::com::sun::star::uno::Any SAL_CALL queryInterface( 160*cdf0e10cSrcweir const ::com::sun::star::uno::Type& rType) 161*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 162*cdf0e10cSrcweir virtual void SAL_CALL acquire() throw() { OWeakObject::acquire(); } 163*cdf0e10cSrcweir virtual void SAL_CALL release() throw() { OWeakObject::release(); } 164*cdf0e10cSrcweir 165*cdf0e10cSrcweir // XTypeProvider 166*cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type > 167*cdf0e10cSrcweir SAL_CALL getTypes() 168*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 169*cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL 170*cdf0e10cSrcweir getImplementationId() 171*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 172*cdf0e10cSrcweir 173*cdf0e10cSrcweir // XServiceInfo 174*cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getImplementationName() 175*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 176*cdf0e10cSrcweir virtual sal_Bool SAL_CALL supportsService( 177*cdf0e10cSrcweir const ::rtl::OUString& rServiceName) 178*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 179*cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL 180*cdf0e10cSrcweir getSupportedServiceNames() 181*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 182*cdf0e10cSrcweir 183*cdf0e10cSrcweir // XElementAccess 184*cdf0e10cSrcweir virtual ::com::sun::star::uno::Type SAL_CALL getElementType() 185*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 186*cdf0e10cSrcweir virtual sal_Bool SAL_CALL hasElements() 187*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 188*cdf0e10cSrcweir 189*cdf0e10cSrcweir // XEnumerationAccess 190*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 191*cdf0e10cSrcweir ::com::sun::star::container::XEnumeration > SAL_CALL 192*cdf0e10cSrcweir createEnumeration() 193*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 194*cdf0e10cSrcweir 195*cdf0e10cSrcweir // XSimpleText 196*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 197*cdf0e10cSrcweir ::com::sun::star::text::XTextCursor > SAL_CALL 198*cdf0e10cSrcweir createTextCursor() 199*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 200*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 201*cdf0e10cSrcweir ::com::sun::star::text::XTextCursor > SAL_CALL 202*cdf0e10cSrcweir createTextCursorByRange( 203*cdf0e10cSrcweir const ::com::sun::star::uno::Reference< 204*cdf0e10cSrcweir ::com::sun::star::text::XTextRange > & xTextPosition) 205*cdf0e10cSrcweir throw (::com::sun::star::uno::RuntimeException); 206*cdf0e10cSrcweir 207*cdf0e10cSrcweir }; 208*cdf0e10cSrcweir 209*cdf0e10cSrcweir #endif // SW_UNOTEXTBODYHF_HXX 210*cdf0e10cSrcweir 211