Line data Source code
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_VBARANGE_HXX
20 : #define INCLUDED_SW_SOURCE_UI_VBA_VBARANGE_HXX
21 :
22 : #include <ooo/vba/word/XRange.hpp>
23 : #include <ooo/vba/word/XParagraphFormat.hpp>
24 : #include <ooo/vba/word/XFont.hpp>
25 : #include <vbahelper/vbahelperinterface.hxx>
26 : #include <cppuhelper/implbase1.hxx>
27 : #include <com/sun/star/text/XTextRange.hpp>
28 : #include <com/sun/star/text/XTextDocument.hpp>
29 : #include <ooo/vba/word/XStyle.hpp>
30 : #include <ooo/vba/word/XListFormat.hpp>
31 : #include "wordvbahelper.hxx"
32 :
33 : typedef InheritedHelperInterfaceImpl1< ooo::vba::word::XRange > SwVbaRange_BASE;
34 :
35 : class SwVbaRange : public SwVbaRange_BASE
36 : {
37 : private:
38 : css::uno::Reference< css::text::XTextDocument > mxTextDocument;
39 : css::uno::Reference< css::text::XTextCursor > mxTextCursor;
40 : css::uno::Reference< css::text::XText > mxText;
41 : bool mbMaySpanEndOfDocument;
42 :
43 : private:
44 : void initialize( const css::uno::Reference< css::text::XTextRange >& rStart, const css::uno::Reference< css::text::XTextRange >& rEnd ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
45 : void GetStyleInfo(OUString& aStyleName, OUString& aStyleType ) throw ( css::uno::RuntimeException );
46 : public:
47 : SwVbaRange( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, const css::uno::Reference< css::text::XTextDocument >& rTextDocument, const css::uno::Reference< css::text::XTextRange >& rStart, bool _bMaySpanEndOfDocument = false ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
48 : SwVbaRange( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, const css::uno::Reference< css::text::XTextDocument >& rTextDocument, const css::uno::Reference< css::text::XTextRange >& rStart, const css::uno::Reference< css::text::XTextRange >& rEnd, bool _bMaySpanEndOfDocument = false ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
49 : SwVbaRange( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, const css::uno::Reference< css::text::XTextDocument >& rTextDocument, const css::uno::Reference< css::text::XTextRange >& rStart, const css::uno::Reference< css::text::XTextRange >& rEnd, const css::uno::Reference< css::text::XText >& rText, bool _bMaySpanEndOfDocument = false ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
50 : virtual ~SwVbaRange();
51 0 : css::uno::Reference< css::text::XTextDocument > getDocument() const { return mxTextDocument; }
52 :
53 : virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getXTextRange() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
54 0 : css::uno::Reference< css::text::XText > getXText() const { return mxText; }
55 0 : void setXTextCursor( const css::uno::Reference< css::text::XTextCursor >& xTextCursor ) { mxTextCursor = xTextCursor; }
56 : void Move( const css::uno::Any& _unit, const css::uno::Any& _count, const css::uno::Any& _extend, ooo::vba::word::E_DIRECTION eDirection ) throw (css::uno::RuntimeException);
57 :
58 : // Attribute
59 : virtual OUString SAL_CALL getText() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
60 : virtual void SAL_CALL setText( const OUString& rText ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
61 : virtual css::uno::Reference< ooo::vba::word::XParagraphFormat > SAL_CALL getParagraphFormat() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
62 : virtual void SAL_CALL setParagraphFormat( const css::uno::Reference< ooo::vba::word::XParagraphFormat >& rParagraphFormat ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
63 : virtual css::uno::Any SAL_CALL getStyle() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
64 : virtual void SAL_CALL setStyle( const css::uno::Any& _xStyle ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
65 :
66 : virtual css::uno::Reference< ooo::vba::word::XFont > SAL_CALL getFont() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
67 : virtual css::uno::Reference< ooo::vba::word::XListFormat > SAL_CALL getListFormat() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
68 : // Methods
69 : virtual void SAL_CALL InsertBreak(const css::uno::Any& _breakType)
70 : throw (css::script::BasicErrorException,
71 : css::uno::RuntimeException,
72 : std::exception) SAL_OVERRIDE;
73 : virtual void SAL_CALL Select() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
74 : virtual void SAL_CALL InsertParagraph() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
75 : virtual void SAL_CALL InsertParagraphBefore() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
76 : virtual void SAL_CALL InsertParagraphAfter() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
77 : virtual ::sal_Int32 SAL_CALL getLanguageID() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
78 : virtual void SAL_CALL setLanguageID( ::sal_Int32 _languageid ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
79 : virtual css::uno::Any SAL_CALL PageSetup() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
80 : virtual ::sal_Int32 SAL_CALL getStart() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
81 : virtual void SAL_CALL setStart( ::sal_Int32 _start ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
82 : virtual ::sal_Int32 SAL_CALL getEnd() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
83 : virtual void SAL_CALL setEnd( ::sal_Int32 _end ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
84 : virtual sal_Bool SAL_CALL InRange( const css::uno::Reference< ::ooo::vba::word::XRange >& Range ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
85 : virtual css::uno::Any SAL_CALL Revisions( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
86 : virtual css::uno::Any SAL_CALL Sections( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
87 : virtual css::uno::Any SAL_CALL Fields( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
88 :
89 : // XHelperInterface
90 : virtual OUString getServiceImplName() SAL_OVERRIDE;
91 : virtual css::uno::Sequence<OUString> getServiceNames() SAL_OVERRIDE;
92 : };
93 : #endif // INCLUDED_SW_SOURCE_UI_VBA_VBARANGE_HXX
94 :
95 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|