1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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_SOURCE_UI_VBA_VBAFIND_HXX
20 #define INCLUDED_SW_SOURCE_UI_VBA_VBAFIND_HXX
22 #include <ooo/vba/word/XFind.hpp>
23 #include <vbahelper/vbahelperinterface.hxx>
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>
30 typedef InheritedHelperInterfaceWeakImpl
< ooo::vba::word::XFind
> SwVbaFind_BASE
;
32 class SwVbaFind
: public SwVbaFind_BASE
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
;
46 /// @throws css::uno::RuntimeException
47 bool InRange( const css::uno::Reference
< css::text::XTextRange
>& xCurrentRange
);
48 /// @throws css::uno::RuntimeException
49 bool InEqualRange( const css::uno::Reference
< css::text::XTextRange
>& xCurrentRange
);
50 void SetReplace( sal_Int32 type
);
51 /// @throws css::uno::RuntimeException
52 void SetReplaceWith( const OUString
& rText
);
53 /// @throws css::uno::RuntimeException
54 OUString
GetReplaceWith();
55 /// @throws css::uno::RuntimeException
56 css::uno::Reference
< css::text::XTextRange
> FindOneElement();
57 /// @throws css::uno::RuntimeException
60 /// @throws css::uno::RuntimeException
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
;
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
;
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
;
95 virtual OUString
getServiceImplName() override
;
96 virtual css::uno::Sequence
<OUString
> getServiceNames() override
;
98 #endif // INCLUDED_SW_SOURCE_UI_VBA_VBAFIND_HXX
100 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */