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 SW_VBA_RANGE_HXX
20 : #define SW_VBA_RANGE_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 : sal_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::uno::RuntimeException);
45 : void GetStyleInfo(rtl::OUString& aStyleName, rtl::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, sal_Bool _bMaySpanEndOfDocument = sal_False ) throw (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, sal_Bool _bMaySpanEndOfDocument = sal_False ) throw (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, sal_Bool _bMaySpanEndOfDocument = sal_False ) throw (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);
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 rtl::OUString SAL_CALL getText() throw (css::uno::RuntimeException);
60 : virtual void SAL_CALL setText( const rtl::OUString& rText ) throw (css::uno::RuntimeException);
61 : virtual css::uno::Reference< ooo::vba::word::XParagraphFormat > SAL_CALL getParagraphFormat() throw (css::uno::RuntimeException);
62 : virtual void SAL_CALL setParagraphFormat( const css::uno::Reference< ooo::vba::word::XParagraphFormat >& rParagraphFormat ) throw (css::uno::RuntimeException);
63 : virtual css::uno::Any SAL_CALL getStyle() throw (css::uno::RuntimeException);
64 : virtual void SAL_CALL setStyle( const css::uno::Any& _xStyle ) throw (css::uno::RuntimeException);
65 :
66 : virtual css::uno::Reference< ooo::vba::word::XFont > SAL_CALL getFont() throw (css::uno::RuntimeException);
67 : virtual css::uno::Reference< ooo::vba::word::XListFormat > SAL_CALL getListFormat() throw (css::uno::RuntimeException);
68 : // Methods
69 : virtual void SAL_CALL InsertBreak( const css::uno::Any& _breakType ) throw (css::uno::RuntimeException);
70 : virtual void SAL_CALL Select() throw (css::uno::RuntimeException);
71 : virtual void SAL_CALL InsertParagraph() throw (css::uno::RuntimeException);
72 : virtual void SAL_CALL InsertParagraphBefore() throw (css::uno::RuntimeException);
73 : virtual void SAL_CALL InsertParagraphAfter() throw (css::uno::RuntimeException);
74 : virtual ::sal_Int32 SAL_CALL getLanguageID() throw (css::uno::RuntimeException);
75 : virtual void SAL_CALL setLanguageID( ::sal_Int32 _languageid ) throw (css::uno::RuntimeException);
76 : virtual css::uno::Any SAL_CALL PageSetup() throw (css::uno::RuntimeException);
77 : virtual ::sal_Int32 SAL_CALL getStart() throw (css::uno::RuntimeException);
78 : virtual void SAL_CALL setStart( ::sal_Int32 _start ) throw (css::uno::RuntimeException);
79 : virtual ::sal_Int32 SAL_CALL getEnd() throw (css::uno::RuntimeException);
80 : virtual void SAL_CALL setEnd( ::sal_Int32 _end ) throw (css::uno::RuntimeException);
81 : virtual ::sal_Bool SAL_CALL InRange( const css::uno::Reference< ::ooo::vba::word::XRange >& Range ) throw (css::uno::RuntimeException);
82 : virtual css::uno::Any SAL_CALL Revisions( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
83 : virtual css::uno::Any SAL_CALL Sections( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
84 : virtual css::uno::Any SAL_CALL Fields( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
85 :
86 : // XHelperInterface
87 : virtual rtl::OUString getServiceImplName();
88 : virtual css::uno::Sequence<rtl::OUString> getServiceNames();
89 : };
90 : #endif /* SW_VBA_RANGE_HXX */
91 :
92 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|