LibreOffice Module sw (master)  1
vbafind.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
19 #ifndef INCLUDED_SW_SOURCE_UI_VBA_VBAFIND_HXX
20 #define INCLUDED_SW_SOURCE_UI_VBA_VBAFIND_HXX
21 
22 #include <ooo/vba/word/XFind.hpp>
24 #include <com/sun/star/text/XTextRange.hpp>
25 #include <com/sun/star/util/XReplaceable.hpp>
26 #include <com/sun/star/util/XPropertyReplace.hpp>
27 #include <com/sun/star/text/XTextViewCursor.hpp>
28 #include <com/sun/star/view/XSelectionSupplier.hpp>
29 
31 
32 class SwVbaFind : public SwVbaFind_BASE
33 {
34 private:
35  css::uno::Reference< css::frame::XModel > mxModel;
36  css::uno::Reference< css::text::XTextRange > mxTextRange;
37  css::uno::Reference< css::util::XReplaceable > mxReplaceable;
38  css::uno::Reference< css::util::XPropertyReplace> mxPropertyReplace;
39  css::uno::Reference< css::text::XTextViewCursor> mxTVC;
40  css::uno::Reference< css::view::XSelectionSupplier> mxSelSupp;
41  bool mbReplace;
42  sal_Int32 mnReplaceType;
43  sal_Int32 mnWrap;
44 
45 private:
47  bool InRange( const css::uno::Reference< css::text::XTextRange >& xCurrentRange );
49  bool InEqualRange( const css::uno::Reference< css::text::XTextRange >& xCurrentRange );
50  void SetReplace( sal_Int32 type );
52  void SetReplaceWith( const OUString& rText );
54  OUString GetReplaceWith();
56  css::uno::Reference< css::text::XTextRange > FindOneElement();
58  bool SearchReplace();
59 
60 public:
62  SwVbaFind( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, const css::uno::Reference< css::frame::XModel >& xModel, const css::uno::Reference< css::text::XTextRange >& xTextRange );
63  virtual ~SwVbaFind() override;
64 
65  // Attributes
66  virtual OUString SAL_CALL getText() override;
67  virtual void SAL_CALL setText( const OUString& _text ) override;
68  virtual css::uno::Any SAL_CALL getReplacement() override;
69  virtual void SAL_CALL setReplacement( const css::uno::Any& _replacement ) override;
70  virtual sal_Bool SAL_CALL getForward() override;
71  virtual void SAL_CALL setForward( sal_Bool _forward ) override;
72  virtual ::sal_Int32 SAL_CALL getWrap() override;
73  virtual void SAL_CALL setWrap( ::sal_Int32 _wrap ) override;
74  virtual sal_Bool SAL_CALL getFormat() override;
75  virtual void SAL_CALL setFormat( sal_Bool _format ) override;
76  virtual sal_Bool SAL_CALL getMatchCase() override;
77  virtual void SAL_CALL setMatchCase( sal_Bool _matchcase ) override;
78  virtual sal_Bool SAL_CALL getMatchWholeWord() override;
79  virtual void SAL_CALL setMatchWholeWord( sal_Bool _matchwholeword ) override;
80  virtual sal_Bool SAL_CALL getMatchWildcards() override;
81  virtual void SAL_CALL setMatchWildcards( sal_Bool _matchwildcards ) override;
82  virtual sal_Bool SAL_CALL getMatchSoundsLike() override;
83  virtual void SAL_CALL setMatchSoundsLike( sal_Bool _matchsoundslike ) override;
84  virtual sal_Bool SAL_CALL getMatchAllWordForms() override;
85  virtual void SAL_CALL setMatchAllWordForms( sal_Bool _matchallwordforms ) override;
86  virtual css::uno::Any SAL_CALL getStyle() override;
87  virtual void SAL_CALL setStyle( const css::uno::Any& _style ) override;
88 
89  // Methods
90  virtual sal_Bool SAL_CALL Execute( const css::uno::Any& FindText, const css::uno::Any& MatchCase, const css::uno::Any& MatchWholeWord, const css::uno::Any& MatchWildcards, const css::uno::Any& MatchSoundsLike, const css::uno::Any& MatchAllWordForms, const css::uno::Any& Forward, const css::uno::Any& Wrap, const css::uno::Any& Format, const css::uno::Any& ReplaceWith, const css::uno::Any& Replace, const css::uno::Any& MatchKashida, const css::uno::Any& MatchDiacritics, const css::uno::Any& MatchAlefHamza, const css::uno::Any& MatchControl, const css::uno::Any& MatchPrefix, const css::uno::Any& MatchSuffix, const css::uno::Any& MatchPhrase, const css::uno::Any& IgnoreSpace, const css::uno::Any& IgnorePunct ) override;
91  virtual void SAL_CALL ClearFormatting( ) override;
92 
93  // XHelperInterface
94  virtual OUString getServiceImplName() override;
95  virtual css::uno::Sequence<OUString> getServiceNames() override;
96 };
97 #endif // INCLUDED_SW_SOURCE_UI_VBA_VBAFIND_HXX
98 
99 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool SearchReplace()
Definition: vbafind.cxx:117
virtual sal_Bool SAL_CALL Execute(const css::uno::Any &FindText, const css::uno::Any &MatchCase, const css::uno::Any &MatchWholeWord, const css::uno::Any &MatchWildcards, const css::uno::Any &MatchSoundsLike, const css::uno::Any &MatchAllWordForms, const css::uno::Any &Forward, const css::uno::Any &Wrap, const css::uno::Any &Format, const css::uno::Any &ReplaceWith, const css::uno::Any &Replace, const css::uno::Any &MatchKashida, const css::uno::Any &MatchDiacritics, const css::uno::Any &MatchAlefHamza, const css::uno::Any &MatchControl, const css::uno::Any &MatchPrefix, const css::uno::Any &MatchSuffix, const css::uno::Any &MatchPhrase, const css::uno::Any &IgnoreSpace, const css::uno::Any &IgnorePunct) override
Definition: vbafind.cxx:306
virtual sal_Bool SAL_CALL getMatchWholeWord() override
Definition: vbafind.cxx:242
css::uno::Reference< css::text::XTextViewCursor > mxTVC
Definition: vbafind.hxx:39
virtual sal_Bool SAL_CALL getMatchWildcards() override
Definition: vbafind.cxx:254
virtual OUString getServiceImplName() override
Definition: vbafind.cxx:393
bool InEqualRange(const css::uno::Reference< css::text::XTextRange > &xCurrentRange)
Definition: vbafind.cxx:51
virtual sal_Bool SAL_CALL getForward() override
Definition: vbafind.cxx:195
virtual void SAL_CALL setReplacement(const css::uno::Any &_replacement) override
Definition: vbafind.cxx:190
css::uno::Reference< css::frame::XModel > mxModel
Definition: vbafind.hxx:35
virtual void SAL_CALL ClearFormatting() override
Definition: vbafind.cxx:386
virtual ::sal_Int32 SAL_CALL getWrap() override
Definition: vbafind.cxx:208
css::uno::Reference< css::util::XReplaceable > mxReplaceable
Definition: vbafind.hxx:37
OUString GetReplaceWith()
Definition: vbafind.cxx:63
virtual void SAL_CALL setMatchWholeWord(sal_Bool _matchwholeword) override
Definition: vbafind.cxx:249
virtual sal_Bool SAL_CALL getMatchCase() override
Definition: vbafind.cxx:230
virtual void SAL_CALL setWrap(::sal_Int32 _wrap) override
Definition: vbafind.cxx:214
sal_Int32 mnReplaceType
Definition: vbafind.hxx:42
css::uno::Reference< css::text::XTextRange > mxTextRange
Definition: vbafind.hxx:36
css::uno::Reference< css::util::XPropertyReplace > mxPropertyReplace
Definition: vbafind.hxx:38
virtual void SAL_CALL setMatchAllWordForms(sal_Bool _matchallwordforms) override
Definition: vbafind.cxx:288
virtual void SAL_CALL setMatchWildcards(sal_Bool _matchwildcards) override
Definition: vbafind.cxx:261
unsigned char sal_Bool
css::uno::Reference< css::text::XTextRange > FindOneElement()
Definition: vbafind.cxx:72
virtual ~SwVbaFind() override
Definition: vbafind.cxx:41
virtual css::uno::Any SAL_CALL getStyle() override
Definition: vbafind.cxx:295
virtual sal_Bool SAL_CALL getMatchSoundsLike() override
Definition: vbafind.cxx:266
css::uno::Reference< css::view::XSelectionSupplier > mxSelSupp
Definition: vbafind.hxx:40
virtual void SAL_CALL setFormat(sal_Bool _format) override
Definition: vbafind.cxx:225
virtual css::uno::Sequence< OUString > getServiceNames() override
Definition: vbafind.cxx:399
SwVbaFind(const css::uno::Reference< ooo::vba::XHelperInterface > &rParent, const css::uno::Reference< css::uno::XComponentContext > &rContext, const css::uno::Reference< css::frame::XModel > &xModel, const css::uno::Reference< css::text::XTextRange > &xTextRange)
Definition: vbafind.cxx:32
virtual void SAL_CALL setStyle(const css::uno::Any &_style) override
Definition: vbafind.cxx:300
virtual OUString SAL_CALL getText() override
Definition: vbafind.cxx:175
bool mbReplace
Definition: vbafind.hxx:41
virtual sal_Bool SAL_CALL getFormat() override
Definition: vbafind.cxx:220
InheritedHelperInterfaceWeakImpl< ooo::vba::word::XFind > SwVbaFind_BASE
Definition: vbafind.hxx:30
virtual void SAL_CALL setForward(sal_Bool _forward) override
Definition: vbafind.cxx:202
virtual void SAL_CALL setText(const OUString &_text) override
Definition: vbafind.cxx:180
virtual css::uno::Any SAL_CALL getReplacement() override
Definition: vbafind.cxx:185
virtual sal_Bool SAL_CALL getMatchAllWordForms() override
Definition: vbafind.cxx:279
void SetReplaceWith(const OUString &rText)
Definition: vbafind.cxx:57
void SetReplace(sal_Int32 type)
Definition: vbafind.cxx:67
bool InRange(const css::uno::Reference< css::text::XTextRange > &xCurrentRange)
Definition: vbafind.cxx:45
virtual void SAL_CALL setMatchSoundsLike(sal_Bool _matchsoundslike) override
Definition: vbafind.cxx:273
virtual void SAL_CALL setMatchCase(sal_Bool _matchcase) override
Definition: vbafind.cxx:237
sal_Int32 mnWrap
Definition: vbafind.hxx:43