1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: unosrch.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
33 #include <com/sun/star/util/XPropertyReplace.hpp>
34 #include <com/sun/star/lang/XServiceInfo.hpp>
35 #include <com/sun/star/lang/XUnoTunnel.hpp>
36 #include <cppuhelper/implbase3.hxx> // helper for implementations
37 #include <tools/string.hxx>
39 /******************************************************************************
41 ******************************************************************************/
42 class SfxItemPropertySet
;
43 class SwXTextDocument
;
44 class SwSearchProperties_Impl
;
47 namespace com
{namespace sun
{namespace star
{namespace util
{
52 /*-----------------19.12.97 12:58-------------------
54 --------------------------------------------------*/
55 class SwXTextSearch
: public cppu::WeakImplHelper3
57 ::com::sun::star::util::XPropertyReplace
,
58 ::com::sun::star::lang::XServiceInfo
,
59 ::com::sun::star::lang::XUnoTunnel
62 friend class SwXTextDocument
;
67 SwSearchProperties_Impl
* pSearchProperties
;
68 SwSearchProperties_Impl
* pReplaceProperties
;
71 const SfxItemPropertySet
* m_pPropSet
;
77 // sal_Bool bInSel: 1; // wie geht Suchen in Selektionen?
79 sal_Bool bSimilarity
: 1;
80 sal_Bool bLevRelax
:1;
81 sal_Int16 nLevExchange
;
85 sal_Bool bIsValueSearch
:1;
87 virtual ~SwXTextSearch();
93 static const ::com::sun::star::uno::Sequence
< sal_Int8
> & getUnoTunnelId();
96 virtual sal_Int64 SAL_CALL
getSomething( const ::com::sun::star::uno::Sequence
< sal_Int8
>& aIdentifier
) throw(::com::sun::star::uno::RuntimeException
);
99 virtual ::rtl::OUString SAL_CALL
getSearchString( ) throw(::com::sun::star::uno::RuntimeException
);
100 virtual void SAL_CALL
setSearchString( const ::rtl::OUString
& aString
) throw(::com::sun::star::uno::RuntimeException
);
103 virtual ::rtl::OUString SAL_CALL
getReplaceString(void) throw( ::com::sun::star::uno::RuntimeException
);
104 virtual void SAL_CALL
setReplaceString(const ::rtl::OUString
& aReplaceString
) throw( ::com::sun::star::uno::RuntimeException
);
107 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException
);
108 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
);
109 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
);
110 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
);
111 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
);
112 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
);
113 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
);
116 virtual sal_Bool SAL_CALL
getValueSearch(void) throw( ::com::sun::star::uno::RuntimeException
);
117 virtual void SAL_CALL
setValueSearch(sal_Bool ValueSearch_
) throw( ::com::sun::star::uno::RuntimeException
);
118 virtual ::com::sun::star::uno::Sequence
< com::sun::star::beans::PropertyValue
> SAL_CALL
getSearchAttributes(void) throw( ::com::sun::star::uno::RuntimeException
);
119 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
);
120 virtual ::com::sun::star::uno::Sequence
< com::sun::star::beans::PropertyValue
> SAL_CALL
getReplaceAttributes(void) throw( ::com::sun::star::uno::RuntimeException
);
121 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
);
124 virtual ::rtl::OUString SAL_CALL
getImplementationName(void) throw( ::com::sun::star::uno::RuntimeException
);
125 virtual BOOL SAL_CALL
supportsService(const ::rtl::OUString
& ServiceName
) throw( ::com::sun::star::uno::RuntimeException
);
126 virtual ::com::sun::star::uno::Sequence
< ::rtl::OUString
> SAL_CALL
getSupportedServiceNames(void) throw( ::com::sun::star::uno::RuntimeException
);
128 void FillSearchItemSet(SfxItemSet
& rSet
) const;
129 void FillReplaceItemSet(SfxItemSet
& rSet
) const;
131 sal_Bool
HasSearchAttributes() const;
132 sal_Bool
HasReplaceAttributes() const;
134 void FillSearchOptions( ::com::sun::star::util::SearchOptions
&