1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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_VBASELECTION_HXX
20 #define INCLUDED_SW_SOURCE_UI_VBA_VBASELECTION_HXX
22 #include <ooo/vba/word/XSelection.hpp>
23 #include <ooo/vba/word/XRange.hpp>
24 #include <vbahelper/vbahelperinterface.hxx>
25 #include <com/sun/star/text/XTextViewCursor.hpp>
26 #include <com/sun/star/text/XTextTable.hpp>
27 #include <ooo/vba/word/XParagraphFormat.hpp>
28 #include <ooo/vba/word/XFind.hpp>
29 #include <ooo/vba/word/XFont.hpp>
30 #include <ooo/vba/word/XHeaderFooter.hpp>
31 #include "wordvbahelper.hxx"
33 typedef InheritedHelperInterfaceWeakImpl
< ooo::vba::word::XSelection
> SwVbaSelection_BASE
;
35 class SwVbaSelection
: public SwVbaSelection_BASE
38 css::uno::Reference
< css::frame::XModel
> mxModel
;
39 css::uno::Reference
< css::text::XTextViewCursor
> mxTextViewCursor
;
42 /// @throws css::script::BasicErrorException
43 /// @throws css::uno::RuntimeException
44 void Move( const css::uno::Any
& _unit
, const css::uno::Any
& _count
, const css::uno::Any
& _extend
, ooo::vba::word::E_DIRECTION eDirection
);
45 /// @throws css::script::BasicErrorException
46 /// @throws css::uno::RuntimeException
47 void NextCell( sal_Int32 nCount
, ooo::vba::word::E_DIRECTION eDirection
);
48 /// @throws css::uno::RuntimeException
49 css::uno::Reference
< css::text::XTextRange
> GetSelectedRange();
50 /// @throws css::uno::RuntimeException
51 void GetSelectedCellRange( OUString
& sTLName
, OUString
& sBRName
);
52 /// @throws css::uno::RuntimeException
53 css::uno::Reference
< css::text::XTextTable
> GetXTextTable() const;
54 /// @throws css::uno::RuntimeException
55 bool IsInTable() const;
56 /// @throws css::uno::RuntimeException
60 /// @throws css::uno::RuntimeException
61 SwVbaSelection( const css::uno::Reference
< ooo::vba::XHelperInterface
>& rParent
, const css::uno::Reference
< css::uno::XComponentContext
>& rContext
, css::uno::Reference
< css::frame::XModel
> xModel
);
62 virtual ~SwVbaSelection() override
;
65 virtual OUString SAL_CALL
getText() override
;
66 virtual void SAL_CALL
setText( const OUString
& rText
) override
;
67 virtual css::uno::Reference
< ooo::vba::word::XRange
> SAL_CALL
getRange() override
;
68 virtual void SAL_CALL
HomeKey( const css::uno::Any
& _unit
, const css::uno::Any
& _extend
) override
;
69 virtual void SAL_CALL
EndKey( const css::uno::Any
& _unit
, const css::uno::Any
& _extend
) override
;
70 virtual void SAL_CALL
TypeText( const OUString
& rText
) override
;
71 virtual void SAL_CALL
Delete( const css::uno::Any
& _unit
, const css::uno::Any
& _count
) override
;
72 virtual void SAL_CALL
MoveRight( const css::uno::Any
& _unit
, const css::uno::Any
& _count
, const css::uno::Any
& _extend
) override
;
73 virtual void SAL_CALL
MoveLeft( const css::uno::Any
& _unit
, const css::uno::Any
& _count
, const css::uno::Any
& _extend
) override
;
74 virtual void SAL_CALL
MoveDown( const css::uno::Any
& _unit
, const css::uno::Any
& _count
, const css::uno::Any
& _extend
) override
;
75 virtual void SAL_CALL
MoveUp( const css::uno::Any
& _unit
, const css::uno::Any
& _count
, const css::uno::Any
& _extend
) override
;
76 virtual void SAL_CALL
TypeParagraph() override
;
77 virtual void SAL_CALL
InsertParagraph() override
;
78 virtual void SAL_CALL
InsertParagraphBefore() override
;
79 virtual void SAL_CALL
InsertParagraphAfter() override
;
80 virtual css::uno::Reference
< ooo::vba::word::XParagraphFormat
> SAL_CALL
getParagraphFormat() override
;
81 virtual void SAL_CALL
setParagraphFormat( const css::uno::Reference
< ooo::vba::word::XParagraphFormat
>& rParagraphFormat
) override
;
82 virtual css::uno::Reference
< ooo::vba::word::XFind
> SAL_CALL
getFind() override
;
83 virtual css::uno::Any SAL_CALL
getStyle() override
;
84 virtual void SAL_CALL
setStyle( const css::uno::Any
& _xStyle
) override
;
85 virtual css::uno::Reference
< ooo::vba::word::XFont
> SAL_CALL
getFont() override
;
86 virtual void SAL_CALL
TypeBackspace() override
;
87 virtual css::uno::Reference
< ooo::vba::word::XRange
> SAL_CALL
GoTo( const css::uno::Any
& _what
, const css::uno::Any
& _which
, const css::uno::Any
& _count
, const css::uno::Any
& _name
) override
;
88 virtual ::sal_Int32 SAL_CALL
getLanguageID( ) override
;
89 virtual void SAL_CALL
setLanguageID( ::sal_Int32 _languageid
) override
;
90 virtual css::uno::Any SAL_CALL
Information( sal_Int32 _type
) override
;
91 virtual void SAL_CALL
InsertBreak( const css::uno::Any
& _breakType
) override
;
92 virtual css::uno::Any SAL_CALL
Tables( const css::uno::Any
& aIndex
) override
;
93 virtual css::uno::Any SAL_CALL
Fields( const css::uno::Any
& aIndex
) override
;
94 virtual css::uno::Reference
< ooo::vba::word::XHeaderFooter
> SAL_CALL
getHeaderFooter() override
;
95 virtual css::uno::Any SAL_CALL
ShapeRange( ) override
;
96 virtual ::sal_Int32 SAL_CALL
getStart() override
;
97 virtual void SAL_CALL
setStart( ::sal_Int32 _start
) override
;
98 virtual ::sal_Int32 SAL_CALL
getEnd() override
;
99 virtual void SAL_CALL
setEnd( ::sal_Int32 _end
) override
;
100 virtual void SAL_CALL
SelectRow() override
;
101 virtual void SAL_CALL
SelectColumn() override
;
102 virtual css::uno::Any SAL_CALL
Rows( const css::uno::Any
& aIndex
) override
;
103 virtual css::uno::Any SAL_CALL
Columns( const css::uno::Any
& aIndex
) override
;
104 virtual css::uno::Any SAL_CALL
Cells( const css::uno::Any
& aIndex
) override
;
105 virtual void SAL_CALL
Copy( ) override
;
106 virtual void SAL_CALL
CopyAsPicture( ) override
;
107 virtual void SAL_CALL
Paste( ) override
;
108 virtual void SAL_CALL
Collapse( const css::uno::Any
& Direction
) override
;
109 virtual void SAL_CALL
WholeStory( ) override
;
110 virtual sal_Bool SAL_CALL
InRange( const css::uno::Reference
< ::ooo::vba::word::XRange
>& Range
) override
;
111 virtual void SAL_CALL
SplitTable() override
;
112 virtual css::uno::Any SAL_CALL
Paragraphs( const css::uno::Any
& aIndex
) override
;
115 virtual OUString
getServiceImplName() override
;
116 virtual css::uno::Sequence
<OUString
> getServiceNames() override
;
118 #endif // INCLUDED_SW_SOURCE_UI_VBA_VBASELECTION_HXX
120 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */