1*1d2dbeb0SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*1d2dbeb0SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*1d2dbeb0SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*1d2dbeb0SAndrew Rist * distributed with this work for additional information 6*1d2dbeb0SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*1d2dbeb0SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*1d2dbeb0SAndrew Rist * "License"); you may not use this file except in compliance 9*1d2dbeb0SAndrew Rist * with the License. You may obtain a copy of the License at 10*1d2dbeb0SAndrew Rist * 11*1d2dbeb0SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*1d2dbeb0SAndrew Rist * 13*1d2dbeb0SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*1d2dbeb0SAndrew Rist * software distributed under the License is distributed on an 15*1d2dbeb0SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*1d2dbeb0SAndrew Rist * KIND, either express or implied. See the License for the 17*1d2dbeb0SAndrew Rist * specific language governing permissions and limitations 18*1d2dbeb0SAndrew Rist * under the License. 19*1d2dbeb0SAndrew Rist * 20*1d2dbeb0SAndrew Rist *************************************************************/ 21*1d2dbeb0SAndrew Rist 22*1d2dbeb0SAndrew Rist 23cdf0e10cSrcweir #ifndef SW_VBA_FIND_HXX 24cdf0e10cSrcweir #define SW_VBA_FIND_HXX 25cdf0e10cSrcweir 26cdf0e10cSrcweir #include <ooo/vba/word/XFind.hpp> 27cdf0e10cSrcweir #include <vbahelper/vbahelperinterface.hxx> 28cdf0e10cSrcweir #include <cppuhelper/implbase1.hxx> 29cdf0e10cSrcweir #include <com/sun/star/text/XTextRange.hpp> 30cdf0e10cSrcweir #include <com/sun/star/util/XReplaceable.hpp> 31cdf0e10cSrcweir #include <com/sun/star/util/XPropertyReplace.hpp> 32cdf0e10cSrcweir #include <com/sun/star/text/XTextViewCursor.hpp> 33cdf0e10cSrcweir #include <com/sun/star/text/XTextCursor.hpp> 34cdf0e10cSrcweir #include <com/sun/star/view/XSelectionSupplier.hpp> 35cdf0e10cSrcweir 36cdf0e10cSrcweir typedef InheritedHelperInterfaceImpl1< ooo::vba::word::XFind > SwVbaFind_BASE; 37cdf0e10cSrcweir 38cdf0e10cSrcweir class SwVbaFind : public SwVbaFind_BASE 39cdf0e10cSrcweir { 40cdf0e10cSrcweir private: 41cdf0e10cSrcweir css::uno::Reference< css::frame::XModel > mxModel; 42cdf0e10cSrcweir css::uno::Reference< css::text::XTextRange > mxTextRange; 43cdf0e10cSrcweir css::uno::Reference< css::util::XReplaceable > mxReplaceable; 44cdf0e10cSrcweir css::uno::Reference< css::util::XPropertyReplace> mxPropertyReplace; 45cdf0e10cSrcweir css::uno::Reference< css::text::XTextViewCursor> mxTVC; 46cdf0e10cSrcweir css::uno::Reference< css::view::XSelectionSupplier> mxSelSupp; 47cdf0e10cSrcweir sal_Bool mbReplace; 48cdf0e10cSrcweir sal_Int32 mnReplaceType; 49cdf0e10cSrcweir sal_Int32 mnWrap; 50cdf0e10cSrcweir 51cdf0e10cSrcweir private: 52cdf0e10cSrcweir sal_Bool InRange( const css::uno::Reference< css::text::XTextRange >& xCurrentRange ) throw ( css::uno::RuntimeException ); 53cdf0e10cSrcweir sal_Bool InEqualRange( const css::uno::Reference< css::text::XTextRange >& xCurrentRange ) throw ( css::uno::RuntimeException ); 54cdf0e10cSrcweir void SetReplace( sal_Int32 type ); 55cdf0e10cSrcweir void SetReplaceWith( const rtl::OUString& rText ) throw ( css::uno::RuntimeException ); 56cdf0e10cSrcweir rtl::OUString GetReplaceWith() throw ( css::uno::RuntimeException ); 57cdf0e10cSrcweir #ifdef TOMORROW 58cdf0e10cSrcweir rtl::OUString ReplaceWildcards( const rtl::OUString& rText ) throw ( css::uno::RuntimeException ); 59cdf0e10cSrcweir #endif 60cdf0e10cSrcweir css::uno::Reference< css::text::XTextRange > FindOneElement() throw ( css::uno::RuntimeException ); 61cdf0e10cSrcweir sal_Bool SearchReplace() throw ( css::uno::RuntimeException ); 62cdf0e10cSrcweir 63cdf0e10cSrcweir public: 64cdf0e10cSrcweir 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 ) throw ( css::uno::RuntimeException ); 65cdf0e10cSrcweir virtual ~SwVbaFind(); 66cdf0e10cSrcweir 67cdf0e10cSrcweir // Attributes 68cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getText() throw (css::uno::RuntimeException); 69cdf0e10cSrcweir virtual void SAL_CALL setText( const ::rtl::OUString& _text ) throw (css::uno::RuntimeException); 70cdf0e10cSrcweir virtual css::uno::Any SAL_CALL getReplacement() throw (css::uno::RuntimeException); 71cdf0e10cSrcweir virtual void SAL_CALL setReplacement( const css::uno::Any& _replacement ) throw (css::uno::RuntimeException); 72cdf0e10cSrcweir virtual ::sal_Bool SAL_CALL getForward() throw (css::uno::RuntimeException); 73cdf0e10cSrcweir virtual void SAL_CALL setForward( ::sal_Bool _forward ) throw (css::uno::RuntimeException); 74cdf0e10cSrcweir virtual ::sal_Int32 SAL_CALL getWrap() throw (css::uno::RuntimeException); 75cdf0e10cSrcweir virtual void SAL_CALL setWrap( ::sal_Int32 _wrap ) throw (css::uno::RuntimeException); 76cdf0e10cSrcweir virtual ::sal_Bool SAL_CALL getFormat() throw (css::uno::RuntimeException); 77cdf0e10cSrcweir virtual void SAL_CALL setFormat( ::sal_Bool _format ) throw (css::uno::RuntimeException); 78cdf0e10cSrcweir virtual ::sal_Bool SAL_CALL getMatchCase() throw (css::uno::RuntimeException); 79cdf0e10cSrcweir virtual void SAL_CALL setMatchCase( ::sal_Bool _matchcase ) throw (css::uno::RuntimeException); 80cdf0e10cSrcweir virtual ::sal_Bool SAL_CALL getMatchWholeWord() throw (css::uno::RuntimeException); 81cdf0e10cSrcweir virtual void SAL_CALL setMatchWholeWord( ::sal_Bool _matchwholeword ) throw (css::uno::RuntimeException); 82cdf0e10cSrcweir virtual ::sal_Bool SAL_CALL getMatchWildcards() throw (css::uno::RuntimeException); 83cdf0e10cSrcweir virtual void SAL_CALL setMatchWildcards( ::sal_Bool _matchwildcards ) throw (css::uno::RuntimeException); 84cdf0e10cSrcweir virtual ::sal_Bool SAL_CALL getMatchSoundsLike() throw (css::uno::RuntimeException); 85cdf0e10cSrcweir virtual void SAL_CALL setMatchSoundsLike( ::sal_Bool _matchsoundslike ) throw (css::uno::RuntimeException); 86cdf0e10cSrcweir virtual ::sal_Bool SAL_CALL getMatchAllWordForms() throw (css::uno::RuntimeException); 87cdf0e10cSrcweir virtual void SAL_CALL setMatchAllWordForms( ::sal_Bool _matchallwordforms ) throw (css::uno::RuntimeException); 88cdf0e10cSrcweir virtual css::uno::Any SAL_CALL getStyle() throw (css::uno::RuntimeException); 89cdf0e10cSrcweir virtual void SAL_CALL setStyle( const css::uno::Any& _style ) throw (css::uno::RuntimeException); 90cdf0e10cSrcweir 91cdf0e10cSrcweir // Methods 92cdf0e10cSrcweir 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 ) throw (css::uno::RuntimeException); 93cdf0e10cSrcweir virtual void SAL_CALL ClearFormatting( ) throw (css::uno::RuntimeException); 94cdf0e10cSrcweir 95cdf0e10cSrcweir // XHelperInterface 96cdf0e10cSrcweir virtual rtl::OUString& getServiceImplName(); 97cdf0e10cSrcweir virtual css::uno::Sequence<rtl::OUString> getServiceNames(); 98cdf0e10cSrcweir }; 99cdf0e10cSrcweir #endif /* SW_VBA_FIND_HXX */ 100