LibreOffice Module sw (master) 1
vbarange.hxx
Go to the documentation of this file.
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 <ooo/vba/word/XFind.hpp>
27#include <com/sun/star/text/XTextRange.hpp>
28#include <com/sun/star/text/XTextDocument.hpp>
29#include <ooo/vba/word/XListFormat.hpp>
30
32
34{
35private:
36 css::uno::Reference< css::text::XTextDocument > mxTextDocument;
37 css::uno::Reference< css::text::XTextCursor > mxTextCursor;
38 css::uno::Reference< css::text::XText > mxText;
39
40private:
43 void initialize( const css::uno::Reference< css::text::XTextRange >& rStart, const css::uno::Reference< css::text::XTextRange >& rEnd );
45 void GetStyleInfo(OUString& aStyleName, OUString& aStyleType );
46public:
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);
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 );
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; }
58
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; }
62
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;
73
74 //XDefaultProperty
75 virtual OUString SAL_CALL getDefaultPropertyName() override { return "Text"; }
76
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;
94
95 // XHelperInterface
96 virtual OUString getServiceImplName() override;
97 virtual css::uno::Sequence<OUString> getServiceNames() override;
98};
99#endif // INCLUDED_SW_SOURCE_UI_VBA_VBARANGE_HXX
100
101/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual ::sal_Int32 SAL_CALL getStart() override
Definition: vbarange.cxx:342
void initialize(const css::uno::Reference< css::text::XTextRange > &rStart, const css::uno::Reference< css::text::XTextRange > &rEnd)
Definition: vbarange.cxx:66
virtual void SAL_CALL setText(const OUString &rText) override
Definition: vbarange.cxx:126
virtual css::uno::Any SAL_CALL Revisions(const css::uno::Any &aIndex) override
Definition: vbarange.cxx:386
css::uno::Reference< css::text::XTextDocument > mxTextDocument
Definition: vbarange.hxx:36
virtual css::uno::Any SAL_CALL getStyle() override
Definition: vbarange.cxx:276
void setXTextCursor(const css::uno::Reference< css::text::XTextCursor > &xTextCursor)
Definition: vbarange.hxx:61
virtual OUString SAL_CALL getText() override
The complexity in this method is because we need to workaround an issue that the last paragraph in a ...
Definition: vbarange.cxx:97
virtual void SAL_CALL InsertParagraph() override
Definition: vbarange.cxx:224
virtual void SAL_CALL setParagraphFormat(const css::uno::Reference< ooo::vba::word::XParagraphFormat > &rParagraphFormat) override
Definition: vbarange.cxx:253
virtual css::uno::Reference< ooo::vba::word::XFont > SAL_CALL getFont() override
Definition: vbarange.cxx:296
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getXTextRange() override
Definition: vbarange.cxx:85
virtual void SAL_CALL Select() override
Definition: vbarange.cxx:215
virtual void SAL_CALL setStart(::sal_Int32 _start) override
Definition: vbarange.cxx:348
virtual css::uno::Sequence< OUString > getServiceNames() override
Definition: vbarange.cxx:425
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)
virtual void SAL_CALL setEnd(::sal_Int32 _end) override
Definition: vbarange.cxx:364
virtual css::uno::Any SAL_CALL PageSetup() override
Definition: vbarange.cxx:329
virtual ::sal_Int32 SAL_CALL getEnd() override
Definition: vbarange.cxx:358
virtual css::uno::Reference< ooo::vba::word::XListFormat > SAL_CALL getListFormat() override
Definition: vbarange.cxx:311
virtual OUString SAL_CALL getDefaultPropertyName() override
Definition: vbarange.hxx:75
virtual css::uno::Reference< ooo::vba::word::XFind > SAL_CALL getFind() override
Definition: vbarange.cxx:303
virtual css::uno::Any SAL_CALL Fields(const css::uno::Any &aIndex) override
Definition: vbarange.cxx:408
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)
virtual css::uno::Reference< ooo::vba::word::XParagraphFormat > SAL_CALL getParagraphFormat() override
Definition: vbarange.cxx:246
const css::uno::Reference< css::text::XTextDocument > & getDocument() const
Definition: vbarange.hxx:57
void GetStyleInfo(OUString &aStyleName, OUString &aStyleType)
Definition: vbarange.cxx:258
virtual void SAL_CALL setLanguageID(::sal_Int32 _languageid) override
Definition: vbarange.cxx:322
virtual OUString getServiceImplName() override
Definition: vbarange.cxx:419
virtual void SAL_CALL InsertParagraphBefore() override
Definition: vbarange.cxx:231
virtual sal_Bool SAL_CALL InRange(const css::uno::Reference< ::ooo::vba::word::XRange > &Range) override
Definition: vbarange.cxx:373
const css::uno::Reference< css::text::XText > & getXText() const
Definition: vbarange.hxx:60
css::uno::Reference< css::text::XText > mxText
Definition: vbarange.hxx:38
virtual css::uno::Any SAL_CALL Sections(const css::uno::Any &aIndex) override
Definition: vbarange.cxx:397
virtual void SAL_CALL InsertParagraphAfter() override
Definition: vbarange.cxx:239
virtual ::sal_Int32 SAL_CALL getLanguageID() override
Definition: vbarange.cxx:316
css::uno::Reference< css::text::XTextCursor > mxTextCursor
Definition: vbarange.hxx:37
virtual void SAL_CALL setStyle(const css::uno::Any &_xStyle) override
Definition: vbarange.cxx:289
virtual ~SwVbaRange() override
Definition: vbarange.cxx:62
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)
virtual void SAL_CALL InsertBreak(const css::uno::Any &_breakType) override
Definition: vbarange.cxx:171
unsigned char sal_Bool
InheritedHelperInterfaceWeakImpl< ooo::vba::word::XRange > SwVbaRange_BASE
Definition: vbarange.hxx:31