LibreOffice Module sw (master) 1
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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
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 .
18 */
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>
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;
42 sal_Int32 mnReplaceType;
43 sal_Int32 mnWrap;
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();
61 SwVbaFind( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, css::uno::Reference< css::frame::XModel > xModel );
63 static css::uno::Reference< ooo::vba::word::XFind > GetOrCreateFind(const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< com::sun::star::uno::XComponentContext >& rContext, const css::uno::Reference< com::sun::star::frame::XModel >& xModel, const css::uno::Reference< css::text::XTextRange >& xTextRange);
64 virtual ~SwVbaFind() override;
66 // Attributes
67 virtual OUString SAL_CALL getText() override;
68 virtual void SAL_CALL setText( const OUString& _text ) override;
69 virtual css::uno::Any SAL_CALL getReplacement() override;
70 virtual void SAL_CALL setReplacement( const css::uno::Any& _replacement ) override;
71 virtual sal_Bool SAL_CALL getForward() override;
72 virtual void SAL_CALL setForward( sal_Bool _forward ) override;
73 virtual ::sal_Int32 SAL_CALL getWrap() override;
74 virtual void SAL_CALL setWrap( ::sal_Int32 _wrap ) override;
75 virtual sal_Bool SAL_CALL getFormat() override;
76 virtual void SAL_CALL setFormat( sal_Bool _format ) override;
77 virtual sal_Bool SAL_CALL getMatchCase() override;
78 virtual void SAL_CALL setMatchCase( sal_Bool _matchcase ) override;
79 virtual sal_Bool SAL_CALL getMatchWholeWord() override;
80 virtual void SAL_CALL setMatchWholeWord( sal_Bool _matchwholeword ) override;
81 virtual sal_Bool SAL_CALL getMatchWildcards() override;
82 virtual void SAL_CALL setMatchWildcards( sal_Bool _matchwildcards ) override;
83 virtual sal_Bool SAL_CALL getMatchSoundsLike() override;
84 virtual void SAL_CALL setMatchSoundsLike( sal_Bool _matchsoundslike ) override;
85 virtual sal_Bool SAL_CALL getMatchAllWordForms() override;
86 virtual void SAL_CALL setMatchAllWordForms( sal_Bool _matchallwordforms ) override;
87 virtual css::uno::Any SAL_CALL getStyle() override;
88 virtual void SAL_CALL setStyle( const css::uno::Any& _style ) override;
90 // Methods
91 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;
92 virtual void SAL_CALL ClearFormatting( ) override;
94 // XHelperInterface
95 virtual OUString getServiceImplName() override;
96 virtual css::uno::Sequence<OUString> getServiceNames() override;
100/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual sal_Bool SAL_CALL getFormat() override
Definition: vbafind.cxx:243
virtual void SAL_CALL setMatchCase(sal_Bool _matchcase) override
Definition: vbafind.cxx:260
virtual void SAL_CALL setMatchWholeWord(sal_Bool _matchwholeword) override
Definition: vbafind.cxx:272
virtual void SAL_CALL setMatchAllWordForms(sal_Bool _matchallwordforms) override
Definition: vbafind.cxx:311
virtual OUString getServiceImplName() override
Definition: vbafind.cxx:416
virtual sal_Bool SAL_CALL getMatchSoundsLike() override
Definition: vbafind.cxx:289
static css::uno::Reference< ooo::vba::word::XFind > GetOrCreateFind(const css::uno::Reference< ooo::vba::XHelperInterface > &rParent, const css::uno::Reference< com::sun::star::uno::XComponentContext > &rContext, const css::uno::Reference< com::sun::star::frame::XModel > &xModel, const css::uno::Reference< css::text::XTextRange > &xTextRange)
Definition: vbafind.cxx:47
sal_Int32 mnWrap
Definition: vbafind.hxx:43
void SetReplaceWith(const OUString &rText)
Definition: vbafind.cxx:80
bool SearchReplace()
Definition: vbafind.cxx:140
virtual css::uno::Any SAL_CALL getStyle() override
Definition: vbafind.cxx:318
css::uno::Reference< css::text::XTextViewCursor > mxTVC
Definition: vbafind.hxx:39
virtual void SAL_CALL setFormat(sal_Bool _format) override
Definition: vbafind.cxx:248
css::uno::Reference< css::text::XTextRange > mxTextRange
Definition: vbafind.hxx:36
virtual sal_Bool SAL_CALL getMatchAllWordForms() override
Definition: vbafind.cxx:302
virtual void SAL_CALL setText(const OUString &_text) override
Definition: vbafind.cxx:203
SwVbaFind(const css::uno::Reference< ooo::vba::XHelperInterface > &rParent, const css::uno::Reference< css::uno::XComponentContext > &rContext, css::uno::Reference< css::frame::XModel > xModel)
Definition: vbafind.cxx:34
virtual OUString SAL_CALL getText() override
Definition: vbafind.cxx:198
virtual ::sal_Int32 SAL_CALL getWrap() override
Definition: vbafind.cxx:231
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:329
css::uno::Reference< css::frame::XModel > mxModel
Definition: vbafind.hxx:35
virtual css::uno::Sequence< OUString > getServiceNames() override
Definition: vbafind.cxx:422
virtual sal_Bool SAL_CALL getMatchWholeWord() override
Definition: vbafind.cxx:265
css::uno::Reference< css::util::XReplaceable > mxReplaceable
Definition: vbafind.hxx:37
virtual void SAL_CALL setWrap(::sal_Int32 _wrap) override
Definition: vbafind.cxx:237
bool InRange(const css::uno::Reference< css::text::XTextRange > &xCurrentRange)
Definition: vbafind.cxx:68
void SetReplace(sal_Int32 type)
Definition: vbafind.cxx:90
sal_Int32 mnReplaceType
Definition: vbafind.hxx:42
virtual void SAL_CALL setForward(sal_Bool _forward) override
Definition: vbafind.cxx:225
virtual void SAL_CALL setReplacement(const css::uno::Any &_replacement) override
Definition: vbafind.cxx:213
virtual css::uno::Any SAL_CALL getReplacement() override
Definition: vbafind.cxx:208
virtual sal_Bool SAL_CALL getMatchWildcards() override
Definition: vbafind.cxx:277
css::uno::Reference< css::text::XTextRange > FindOneElement()
Definition: vbafind.cxx:95
virtual ~SwVbaFind() override
Definition: vbafind.cxx:43
bool mbReplace
Definition: vbafind.hxx:41
virtual void SAL_CALL setStyle(const css::uno::Any &_style) override
Definition: vbafind.cxx:323
virtual sal_Bool SAL_CALL getForward() override
Definition: vbafind.cxx:218
virtual void SAL_CALL setMatchWildcards(sal_Bool _matchwildcards) override
Definition: vbafind.cxx:284
virtual void SAL_CALL ClearFormatting() override
Definition: vbafind.cxx:409
virtual void SAL_CALL setMatchSoundsLike(sal_Bool _matchsoundslike) override
Definition: vbafind.cxx:296
css::uno::Reference< css::util::XPropertyReplace > mxPropertyReplace
Definition: vbafind.hxx:38
bool InEqualRange(const css::uno::Reference< css::text::XTextRange > &xCurrentRange)
Definition: vbafind.cxx:74
virtual sal_Bool SAL_CALL getMatchCase() override
Definition: vbafind.cxx:253
css::uno::Reference< css::view::XSelectionSupplier > mxSelSupp
Definition: vbafind.hxx:40
OUString GetReplaceWith()
Definition: vbafind.cxx:86
unsigned char sal_Bool
InheritedHelperInterfaceWeakImpl< ooo::vba::word::XFind > SwVbaFind_BASE
Definition: vbafind.hxx:30