android: Update app-specific/MIME type icons
[LibreOffice.git] / sw / source / ui / vba / vbarange.hxx
blobf0dd1563503b58207d5e57c571cd26da6d59efec
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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_VBARANGE_HXX
20 #define INCLUDED_SW_SOURCE_UI_VBA_VBARANGE_HXX
22 #include <ooo/vba/word/XRange.hpp>
23 #include <ooo/vba/word/XParagraphFormat.hpp>
24 #include <ooo/vba/word/XFont.hpp>
25 #include <ooo/vba/word/XFind.hpp>
26 #include <vbahelper/vbahelperinterface.hxx>
27 #include <com/sun/star/text/XTextRange.hpp>
28 #include <com/sun/star/text/XTextDocument.hpp>
29 #include <ooo/vba/word/XListFormat.hpp>
31 typedef InheritedHelperInterfaceWeakImpl< ooo::vba::word::XRange > SwVbaRange_BASE;
33 class SwVbaRange : public SwVbaRange_BASE
35 private:
36 css::uno::Reference< css::text::XTextDocument > mxTextDocument;
37 css::uno::Reference< css::text::XTextCursor > mxTextCursor;
38 css::uno::Reference< css::text::XText > mxText;
40 private:
41 /// @throws css::script::BasicErrorException
42 /// @throws css::uno::RuntimeException
43 void initialize( const css::uno::Reference< css::text::XTextRange >& rStart, const css::uno::Reference< css::text::XTextRange >& rEnd );
44 /// @throws css::uno::RuntimeException
45 void GetStyleInfo(OUString& aStyleName, OUString& aStyleType );
46 public:
47 /// @throws css::script::BasicErrorException
48 /// @throws css::uno::RuntimeException
49 SwVbaRange( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, css::uno::Reference< css::text::XTextDocument > xTextDocument, const css::uno::Reference< css::text::XTextRange >& rStart);
50 /// @throws css::script::BasicErrorException
51 /// @throws css::uno::RuntimeException
52 SwVbaRange( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, css::uno::Reference< css::text::XTextDocument > xTextDocument, const css::uno::Reference< css::text::XTextRange >& rStart, const css::uno::Reference< css::text::XTextRange >& rEnd );
53 /// @throws css::script::BasicErrorException
54 /// @throws css::uno::RuntimeException
55 SwVbaRange( const css::uno::Reference< ooo::vba::XHelperInterface >& rParent, const css::uno::Reference< css::uno::XComponentContext >& rContext, css::uno::Reference< css::text::XTextDocument > xTextDocument, const css::uno::Reference< css::text::XTextRange >& rStart, const css::uno::Reference< css::text::XTextRange >& rEnd, css::uno::Reference< css::text::XText > xText);
56 virtual ~SwVbaRange() override;
57 const css::uno::Reference< css::text::XTextDocument >& getDocument() const { return mxTextDocument; }
59 virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getXTextRange() override;
60 const css::uno::Reference< css::text::XText >& getXText() const { return mxText; }
61 void setXTextCursor( const css::uno::Reference< css::text::XTextCursor >& xTextCursor ) { mxTextCursor = xTextCursor; }
63 // Attribute
64 virtual OUString SAL_CALL getText() override;
65 virtual void SAL_CALL setText( const OUString& rText ) override;
66 virtual css::uno::Reference< ooo::vba::word::XParagraphFormat > SAL_CALL getParagraphFormat() override;
67 virtual void SAL_CALL setParagraphFormat( const css::uno::Reference< ooo::vba::word::XParagraphFormat >& rParagraphFormat ) override;
68 virtual css::uno::Any SAL_CALL getStyle() override;
69 virtual void SAL_CALL setStyle( const css::uno::Any& _xStyle ) override;
70 virtual css::uno::Reference< ooo::vba::word::XFont > SAL_CALL getFont() override;
71 virtual css::uno::Reference< ooo::vba::word::XFind > SAL_CALL getFind() override;
72 virtual css::uno::Reference< ooo::vba::word::XListFormat > SAL_CALL getListFormat() override;
74 //XDefaultProperty
75 virtual OUString SAL_CALL getDefaultPropertyName() override { return "Text"; }
77 // Methods
78 virtual void SAL_CALL InsertBreak(const css::uno::Any& _breakType) override;
79 virtual void SAL_CALL Select() override;
80 virtual void SAL_CALL InsertParagraph() override;
81 virtual void SAL_CALL InsertParagraphBefore() override;
82 virtual void SAL_CALL InsertParagraphAfter() override;
83 virtual ::sal_Int32 SAL_CALL getLanguageID() override;
84 virtual void SAL_CALL setLanguageID( ::sal_Int32 _languageid ) override;
85 virtual css::uno::Any SAL_CALL PageSetup() override;
86 virtual ::sal_Int32 SAL_CALL getStart() override;
87 virtual void SAL_CALL setStart( ::sal_Int32 _start ) override;
88 virtual ::sal_Int32 SAL_CALL getEnd() override;
89 virtual void SAL_CALL setEnd( ::sal_Int32 _end ) override;
90 virtual sal_Bool SAL_CALL InRange( const css::uno::Reference< ::ooo::vba::word::XRange >& Range ) override;
91 virtual css::uno::Any SAL_CALL Revisions( const css::uno::Any& aIndex ) override;
92 virtual css::uno::Any SAL_CALL Sections( const css::uno::Any& aIndex ) override;
93 virtual css::uno::Any SAL_CALL Fields( const css::uno::Any& aIndex ) override;
95 // XHelperInterface
96 virtual OUString getServiceImplName() override;
97 virtual css::uno::Sequence<OUString> getServiceNames() override;
99 #endif // INCLUDED_SW_SOURCE_UI_VBA_VBARANGE_HXX
101 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */