Branch libreoffice-5-0-4
[LibreOffice.git] / sw / inc / unosrch.hxx
blob7867f502447b3b5b309b9ba202edf643aa1bf128
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_SW_INC_UNOSRCH_HXX
20 #define INCLUDED_SW_INC_UNOSRCH_HXX
22 #include <com/sun/star/util/XPropertyReplace.hpp>
23 #include <com/sun/star/lang/XServiceInfo.hpp>
24 #include <com/sun/star/lang/XUnoTunnel.hpp>
25 #include <cppuhelper/implbase.hxx>
26 #include <rtl/ustring.hxx>
28 class SfxItemPropertySet;
29 class SwXTextDocument;
30 class SwSearchProperties_Impl;
31 class SfxItemSet;
33 namespace com{namespace sun{namespace star{namespace util{
34 struct SearchOptions;
35 }}}}
37 class SwXTextSearch : public cppu::WeakImplHelper
39 ::com::sun::star::util::XPropertyReplace,
40 ::com::sun::star::lang::XServiceInfo,
41 ::com::sun::star::lang::XUnoTunnel
44 friend class SwXTextDocument;
46 OUString sSearchText;
47 OUString sReplaceText;
49 SwSearchProperties_Impl* pSearchProperties;
50 SwSearchProperties_Impl* pReplaceProperties;
52 const SfxItemPropertySet* m_pPropSet;
53 bool bAll : 1;
54 bool bWord : 1;
55 bool bBack : 1;
56 bool bExpr : 1;
57 bool bCase : 1;
58 bool bStyles:1;
59 bool bSimilarity : 1;
60 bool bLevRelax :1;
61 sal_Int16 nLevExchange;
62 sal_Int16 nLevAdd;
63 sal_Int16 nLevRemove;
65 bool bIsValueSearch :1;
66 protected:
67 virtual ~SwXTextSearch();
68 public:
69 SwXTextSearch();
71 static const ::com::sun::star::uno::Sequence< sal_Int8 > & getUnoTunnelId();
73 //XUnoTunnel
74 virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
76 //XSearchDescriptor
77 virtual OUString SAL_CALL getSearchString( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
78 virtual void SAL_CALL setSearchString( const OUString& aString ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
80 //XReplaceDescriptor
81 virtual OUString SAL_CALL getReplaceString() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
82 virtual void SAL_CALL setReplaceString(const OUString& aReplaceString) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
84 //XPropertySet
85 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
86 virtual void SAL_CALL setPropertyValue( const 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, std::exception) SAL_OVERRIDE;
87 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
88 virtual void SAL_CALL addPropertyChangeListener( const 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, std::exception) SAL_OVERRIDE;
89 virtual void SAL_CALL removePropertyChangeListener( const 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, std::exception) SAL_OVERRIDE;
90 virtual void SAL_CALL addVetoableChangeListener( const 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, std::exception) SAL_OVERRIDE;
91 virtual void SAL_CALL removeVetoableChangeListener( const 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, std::exception) SAL_OVERRIDE;
93 //XPropertyReplace
94 virtual sal_Bool SAL_CALL getValueSearch() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
95 virtual void SAL_CALL setValueSearch(sal_Bool ValueSearch_) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
96 virtual ::com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > SAL_CALL getSearchAttributes() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
97 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, std::exception ) SAL_OVERRIDE;
98 virtual ::com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > SAL_CALL getReplaceAttributes() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
99 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, std::exception ) SAL_OVERRIDE;
101 //XServiceInfo
102 virtual OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
103 virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
104 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
106 void FillSearchItemSet(SfxItemSet& rSet) const;
107 void FillReplaceItemSet(SfxItemSet& rSet) const;
109 bool HasSearchAttributes() const;
110 bool HasReplaceAttributes() const;
112 void FillSearchOptions( ::com::sun::star::util::SearchOptions&
113 rSearchOpt ) const;
116 #endif
118 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */