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 #ifndef _UNOSRCH_HXX 28*cdf0e10cSrcweir #define _UNOSRCH_HXX 29*cdf0e10cSrcweir 30*cdf0e10cSrcweir #include <com/sun/star/util/XPropertyReplace.hpp> 31*cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp> 32*cdf0e10cSrcweir #include <com/sun/star/lang/XUnoTunnel.hpp> 33*cdf0e10cSrcweir #include <cppuhelper/implbase3.hxx> // helper for implementations 34*cdf0e10cSrcweir #include <tools/string.hxx> 35*cdf0e10cSrcweir 36*cdf0e10cSrcweir /****************************************************************************** 37*cdf0e10cSrcweir * 38*cdf0e10cSrcweir ******************************************************************************/ 39*cdf0e10cSrcweir class SfxItemPropertySet; 40*cdf0e10cSrcweir class SwXTextDocument; 41*cdf0e10cSrcweir class SwSearchProperties_Impl; 42*cdf0e10cSrcweir class SfxItemSet; 43*cdf0e10cSrcweir 44*cdf0e10cSrcweir namespace com{namespace sun{namespace star{namespace util{ 45*cdf0e10cSrcweir struct SearchOptions; 46*cdf0e10cSrcweir }}}} 47*cdf0e10cSrcweir 48*cdf0e10cSrcweir 49*cdf0e10cSrcweir /*-----------------19.12.97 12:58------------------- 50*cdf0e10cSrcweir 51*cdf0e10cSrcweir --------------------------------------------------*/ 52*cdf0e10cSrcweir class SwXTextSearch : public cppu::WeakImplHelper3 53*cdf0e10cSrcweir < 54*cdf0e10cSrcweir ::com::sun::star::util::XPropertyReplace, 55*cdf0e10cSrcweir ::com::sun::star::lang::XServiceInfo, 56*cdf0e10cSrcweir ::com::sun::star::lang::XUnoTunnel 57*cdf0e10cSrcweir > 58*cdf0e10cSrcweir { 59*cdf0e10cSrcweir friend class SwXTextDocument; 60*cdf0e10cSrcweir 61*cdf0e10cSrcweir String sSearchText; 62*cdf0e10cSrcweir String sReplaceText; 63*cdf0e10cSrcweir 64*cdf0e10cSrcweir SwSearchProperties_Impl* pSearchProperties; 65*cdf0e10cSrcweir SwSearchProperties_Impl* pReplaceProperties; 66*cdf0e10cSrcweir 67*cdf0e10cSrcweir 68*cdf0e10cSrcweir const SfxItemPropertySet* m_pPropSet; 69*cdf0e10cSrcweir sal_Bool bAll : 1; 70*cdf0e10cSrcweir sal_Bool bWord : 1; 71*cdf0e10cSrcweir sal_Bool bBack : 1; 72*cdf0e10cSrcweir sal_Bool bExpr : 1; 73*cdf0e10cSrcweir sal_Bool bCase : 1; 74*cdf0e10cSrcweir // sal_Bool bInSel: 1; // wie geht Suchen in Selektionen? 75*cdf0e10cSrcweir sal_Bool bStyles:1; 76*cdf0e10cSrcweir sal_Bool bSimilarity : 1; 77*cdf0e10cSrcweir sal_Bool bLevRelax :1; 78*cdf0e10cSrcweir sal_Int16 nLevExchange; 79*cdf0e10cSrcweir sal_Int16 nLevAdd; 80*cdf0e10cSrcweir sal_Int16 nLevRemove; 81*cdf0e10cSrcweir 82*cdf0e10cSrcweir sal_Bool bIsValueSearch :1; 83*cdf0e10cSrcweir protected: 84*cdf0e10cSrcweir virtual ~SwXTextSearch(); 85*cdf0e10cSrcweir public: 86*cdf0e10cSrcweir SwXTextSearch(); 87*cdf0e10cSrcweir 88*cdf0e10cSrcweir 89*cdf0e10cSrcweir 90*cdf0e10cSrcweir static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId(); 91*cdf0e10cSrcweir 92*cdf0e10cSrcweir //XUnoTunnel 93*cdf0e10cSrcweir virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException); 94*cdf0e10cSrcweir 95*cdf0e10cSrcweir //XSearchDescriptor 96*cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getSearchString( ) throw(::com::sun::star::uno::RuntimeException); 97*cdf0e10cSrcweir virtual void SAL_CALL setSearchString( const ::rtl::OUString& aString ) throw(::com::sun::star::uno::RuntimeException); 98*cdf0e10cSrcweir 99*cdf0e10cSrcweir //XReplaceDescriptor 100*cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getReplaceString(void) throw( ::com::sun::star::uno::RuntimeException ); 101*cdf0e10cSrcweir virtual void SAL_CALL setReplaceString(const ::rtl::OUString& aReplaceString) throw( ::com::sun::star::uno::RuntimeException ); 102*cdf0e10cSrcweir 103*cdf0e10cSrcweir //XPropertySet 104*cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException); 105*cdf0e10cSrcweir virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); 106*cdf0e10cSrcweir virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); 107*cdf0e10cSrcweir virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); 108*cdf0e10cSrcweir virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); 109*cdf0e10cSrcweir virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); 110*cdf0e10cSrcweir virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); 111*cdf0e10cSrcweir 112*cdf0e10cSrcweir //XPropertyReplace 113*cdf0e10cSrcweir virtual sal_Bool SAL_CALL getValueSearch(void) throw( ::com::sun::star::uno::RuntimeException ); 114*cdf0e10cSrcweir virtual void SAL_CALL setValueSearch(sal_Bool ValueSearch_) throw( ::com::sun::star::uno::RuntimeException ); 115*cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > SAL_CALL getSearchAttributes(void) throw( ::com::sun::star::uno::RuntimeException ); 116*cdf0e10cSrcweir virtual void SAL_CALL setSearchAttributes(const ::com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& aSearchAttribs) throw( ::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); 117*cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > SAL_CALL getReplaceAttributes(void) throw( ::com::sun::star::uno::RuntimeException ); 118*cdf0e10cSrcweir virtual void SAL_CALL setReplaceAttributes(const ::com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& aSearchAttribs) throw( ::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException ); 119*cdf0e10cSrcweir 120*cdf0e10cSrcweir //XServiceInfo 121*cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException ); 122*cdf0e10cSrcweir virtual sal_Bool SAL_CALL supportsService(const ::rtl::OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException ); 123*cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException ); 124*cdf0e10cSrcweir 125*cdf0e10cSrcweir void FillSearchItemSet(SfxItemSet& rSet) const; 126*cdf0e10cSrcweir void FillReplaceItemSet(SfxItemSet& rSet) const; 127*cdf0e10cSrcweir 128*cdf0e10cSrcweir sal_Bool HasSearchAttributes() const; 129*cdf0e10cSrcweir sal_Bool HasReplaceAttributes() const; 130*cdf0e10cSrcweir 131*cdf0e10cSrcweir void FillSearchOptions( ::com::sun::star::util::SearchOptions& 132*cdf0e10cSrcweir rSearchOpt ) const; 133*cdf0e10cSrcweir }; 134*cdf0e10cSrcweir 135*cdf0e10cSrcweir #endif 136*cdf0e10cSrcweir 137