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