Update git submodules
[LibreOffice.git] / sw / inc / unosrch.hxx
blob169903764377f73564d8e00c658b7fa349ea8b19
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 <cppuhelper/implbase.hxx>
25 #include <rtl/ustring.hxx>
26 #include <memory>
28 class SfxItemPropertySet;
29 class SwSearchProperties_Impl;
30 class SfxItemSet;
32 namespace i18nutil {
33 struct SearchOptions2;
36 class SwXTextSearch final : public cppu::WeakImplHelper
38 css::util::XPropertyReplace,
39 css::lang::XServiceInfo
42 friend class SwXTextDocument;
44 OUString m_sSearchText;
45 OUString m_sReplaceText;
47 std::unique_ptr<SwSearchProperties_Impl> m_pSearchProperties;
48 std::unique_ptr<SwSearchProperties_Impl> m_pReplaceProperties;
50 const SfxItemPropertySet* m_pPropSet;
51 bool m_bAll : 1;
52 bool m_bWord : 1;
53 bool m_bBack : 1;
54 bool m_bExpr : 1;
55 bool m_bCase : 1;
56 bool m_bStyles:1;
57 bool m_bSimilarity : 1;
58 bool m_bLevRelax :1;
59 sal_Int16 m_nLevExchange;
60 sal_Int16 m_nLevAdd;
61 sal_Int16 m_nLevRemove;
63 bool m_bIsValueSearch :1;
65 virtual ~SwXTextSearch() override;
66 public:
67 SwXTextSearch();
69 //XSearchDescriptor
70 virtual OUString SAL_CALL getSearchString( ) override;
71 virtual void SAL_CALL setSearchString( const OUString& aString ) override;
73 //XReplaceDescriptor
74 virtual OUString SAL_CALL getReplaceString() override;
75 virtual void SAL_CALL setReplaceString(const OUString& aReplaceString) override;
77 //XPropertySet
78 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
79 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
80 virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
81 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
82 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
83 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
84 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
86 //XPropertyReplace
87 virtual sal_Bool SAL_CALL getValueSearch() override;
88 virtual void SAL_CALL setValueSearch(sal_Bool ValueSearch_) override;
89 virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getSearchAttributes() override;
90 virtual void SAL_CALL setSearchAttributes(const css::uno::Sequence< css::beans::PropertyValue >& aSearchAttribs) override;
91 virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getReplaceAttributes() override;
92 virtual void SAL_CALL setReplaceAttributes(const css::uno::Sequence< css::beans::PropertyValue >& aSearchAttribs) override;
94 //XServiceInfo
95 virtual OUString SAL_CALL getImplementationName() override;
96 virtual sal_Bool SAL_CALL supportsService(const OUString& ServiceName) override;
97 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
99 void FillSearchItemSet(SfxItemSet& rSet) const;
100 void FillReplaceItemSet(SfxItemSet& rSet) const;
102 bool HasSearchAttributes() const;
103 bool HasReplaceAttributes() const;
105 void FillSearchOptions( i18nutil::SearchOptions2& rSearchOpt ) const;
108 #endif
110 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */