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>
26 #include <com/sun/star/text/XTextRange.hpp>
27 #include <com/sun/star/text/XTextDocument.hpp>
28 #include <ooo/vba/word/XListFormat.hpp>
29 
31 
33 {
34 private:
35  css::uno::Reference< css::text::XTextDocument > mxTextDocument;
36  css::uno::Reference< css::text::XTextCursor > mxTextCursor;
37  css::uno::Reference< css::text::XText > mxText;
38 
39 private:
42  void initialize( const css::uno::Reference< css::text::XTextRange >& rStart, const css::uno::Reference< css::text::XTextRange >& rEnd );
44  void GetStyleInfo(OUString& aStyleName, OUString& aStyleType );
45 public:
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);
51  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 );
54  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);
55  virtual ~SwVbaRange() override;
56  const css::uno::Reference< css::text::XTextDocument >& getDocument() const { return mxTextDocument; }
57 
58  virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getXTextRange() override;
59  const css::uno::Reference< css::text::XText >& getXText() const { return mxText; }
60  void setXTextCursor( const css::uno::Reference< css::text::XTextCursor >& xTextCursor ) { mxTextCursor = xTextCursor; }
61 
62  // Attribute
63  virtual OUString SAL_CALL getText() override;
64  virtual void SAL_CALL setText( const OUString& rText ) override;
65  virtual css::uno::Reference< ooo::vba::word::XParagraphFormat > SAL_CALL getParagraphFormat() override;
66  virtual void SAL_CALL setParagraphFormat( const css::uno::Reference< ooo::vba::word::XParagraphFormat >& rParagraphFormat ) override;
67  virtual css::uno::Any SAL_CALL getStyle() override;
68  virtual void SAL_CALL setStyle( const css::uno::Any& _xStyle ) override;
69 
70  virtual css::uno::Reference< ooo::vba::word::XFont > SAL_CALL getFont() override;
71  virtual css::uno::Reference< ooo::vba::word::XListFormat > SAL_CALL getListFormat() override;
72  // Methods
73  virtual void SAL_CALL InsertBreak(const css::uno::Any& _breakType) override;
74  virtual void SAL_CALL Select() override;
75  virtual void SAL_CALL InsertParagraph() override;
76  virtual void SAL_CALL InsertParagraphBefore() override;
77  virtual void SAL_CALL InsertParagraphAfter() override;
78  virtual ::sal_Int32 SAL_CALL getLanguageID() override;
79  virtual void SAL_CALL setLanguageID( ::sal_Int32 _languageid ) override;
80  virtual css::uno::Any SAL_CALL PageSetup() override;
81  virtual ::sal_Int32 SAL_CALL getStart() override;
82  virtual void SAL_CALL setStart( ::sal_Int32 _start ) override;
83  virtual ::sal_Int32 SAL_CALL getEnd() override;
84  virtual void SAL_CALL setEnd( ::sal_Int32 _end ) override;
85  virtual sal_Bool SAL_CALL InRange( const css::uno::Reference< ::ooo::vba::word::XRange >& Range ) override;
86  virtual css::uno::Any SAL_CALL Revisions( const css::uno::Any& aIndex ) override;
87  virtual css::uno::Any SAL_CALL Sections( const css::uno::Any& aIndex ) override;
88  virtual css::uno::Any SAL_CALL Fields( const css::uno::Any& aIndex ) override;
89 
90  // XHelperInterface
91  virtual OUString getServiceImplName() override;
92  virtual css::uno::Sequence<OUString> getServiceNames() override;
93 };
94 #endif // INCLUDED_SW_SOURCE_UI_VBA_VBARANGE_HXX
95 
96 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual sal_Bool SAL_CALL InRange(const css::uno::Reference< ::ooo::vba::word::XRange > &Range) override
Definition: vbarange.cxx:369
virtual void SAL_CALL setText(const OUString &rText) override
Definition: vbarange.cxx:130
virtual css::uno::Any SAL_CALL Revisions(const css::uno::Any &aIndex) override
Definition: vbarange.cxx:382
virtual css::uno::Any SAL_CALL getStyle() override
Definition: vbarange.cxx:280
virtual void SAL_CALL setLanguageID(::sal_Int32 _languageid) override
Definition: vbarange.cxx:318
virtual ::sal_Int32 SAL_CALL getStart() override
Definition: vbarange.cxx:338
css::uno::Reference< css::text::XTextDocument > mxTextDocument
Definition: vbarange.hxx:35
const css::uno::Reference< css::text::XText > & getXText() const
Definition: vbarange.hxx:59
virtual css::uno::Reference< ooo::vba::word::XParagraphFormat > SAL_CALL getParagraphFormat() override
Definition: vbarange.cxx:250
virtual css::uno::Reference< css::text::XTextRange > SAL_CALL getXTextRange() override
Definition: vbarange.cxx:89
virtual ~SwVbaRange() override
Definition: vbarange.cxx:66
virtual css::uno::Reference< ooo::vba::word::XListFormat > SAL_CALL getListFormat() override
Definition: vbarange.cxx:307
virtual ::sal_Int32 SAL_CALL getEnd() override
Definition: vbarange.cxx:354
virtual css::uno::Reference< ooo::vba::word::XFont > SAL_CALL getFont() override
Definition: vbarange.cxx:300
void setXTextCursor(const css::uno::Reference< css::text::XTextCursor > &xTextCursor)
Definition: vbarange.hxx:60
virtual void SAL_CALL Select() override
Definition: vbarange.cxx:219
void GetStyleInfo(OUString &aStyleName, OUString &aStyleType)
Definition: vbarange.cxx:262
virtual css::uno::Any SAL_CALL PageSetup() override
Definition: vbarange.cxx:325
virtual void SAL_CALL InsertParagraphAfter() override
Definition: vbarange.cxx:243
virtual css::uno::Any SAL_CALL Fields(const css::uno::Any &aIndex) override
Definition: vbarange.cxx:404
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:101
virtual ::sal_Int32 SAL_CALL getLanguageID() override
Definition: vbarange.cxx:312
unsigned char sal_Bool
virtual void SAL_CALL setStart(::sal_Int32 _start) override
Definition: vbarange.cxx:344
virtual void SAL_CALL InsertParagraph() override
Definition: vbarange.cxx:228
css::uno::Reference< css::text::XTextCursor > mxTextCursor
Definition: vbarange.hxx:36
virtual OUString getServiceImplName() override
Definition: vbarange.cxx:415
const css::uno::Reference< css::text::XTextDocument > & getDocument() const
Definition: vbarange.hxx:56
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)
InheritedHelperInterfaceWeakImpl< ooo::vba::word::XRange > SwVbaRange_BASE
Definition: vbarange.hxx:30
virtual css::uno::Any SAL_CALL Sections(const css::uno::Any &aIndex) override
Definition: vbarange.cxx:393
void initialize(const css::uno::Reference< css::text::XTextRange > &rStart, const css::uno::Reference< css::text::XTextRange > &rEnd)
Definition: vbarange.cxx:70
virtual css::uno::Sequence< OUString > getServiceNames() override
Definition: vbarange.cxx:421
virtual void SAL_CALL setEnd(::sal_Int32 _end) override
Definition: vbarange.cxx:360
css::uno::Reference< css::text::XText > mxText
Definition: vbarange.hxx:37
virtual void SAL_CALL setParagraphFormat(const css::uno::Reference< ooo::vba::word::XParagraphFormat > &rParagraphFormat) override
Definition: vbarange.cxx:257
virtual void SAL_CALL setStyle(const css::uno::Any &_xStyle) override
Definition: vbarange.cxx:293
virtual void SAL_CALL InsertBreak(const css::uno::Any &_breakType) override
Definition: vbarange.cxx:175
virtual void SAL_CALL InsertParagraphBefore() override
Definition: vbarange.cxx:235