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_VBAHELPER_VBASHAPERANGE_HXX 20 #define INCLUDED_VBAHELPER_VBASHAPERANGE_HXX 21 22 #include <exception> 23 24 #include <com/sun/star/uno/Any.hxx> 25 #include <com/sun/star/uno/Reference.hxx> 26 #include <com/sun/star/uno/RuntimeException.hpp> 27 #include <com/sun/star/uno/Sequence.hxx> 28 #include <com/sun/star/uno/Type.hxx> 29 #include <ooo/vba/msforms/XShapeRange.hpp> 30 #include <rtl/ustring.hxx> 31 #include <sal/types.h> 32 #include <vbahelper/vbacollectionimpl.hxx> 33 #include <vbahelper/vbadllapi.h> 34 #include <vbahelper/vbahelper.hxx> 35 36 namespace com::sun::star { 37 namespace container { class XEnumeration; } 38 namespace container { class XIndexAccess; } 39 namespace drawing { class XDrawPage; } 40 namespace drawing { class XShapes; } 41 namespace frame { class XModel; } 42 namespace uno { class XComponentContext; } 43 } 44 45 namespace ooo::vba { 46 class XHelperInterface; 47 namespace msforms { class XFillFormat; } 48 namespace msforms { class XLineFormat; } 49 namespace msforms { class XShape; } 50 } 51 52 typedef CollTestImplHelper< ov::msforms::XShapeRange > ScVbaShapeRange_BASE; 53 54 class VBAHELPER_DLLPUBLIC ScVbaShapeRange final : public ScVbaShapeRange_BASE 55 { 56 private: 57 css::uno::Reference< css::drawing::XDrawPage > m_xDrawPage; 58 css::uno::Reference< css::drawing::XShapes > m_xShapes; 59 css::uno::Reference< css::frame::XModel > m_xModel; 60 virtual OUString getServiceImplName() override; 61 virtual css::uno::Sequence<OUString> getServiceNames() override; 62 /// @throws css::uno::RuntimeException 63 css::uno::Reference< css::drawing::XShapes > const & getShapes() ; 64 public: 65 ScVbaShapeRange( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::container::XIndexAccess >& xShapes, const css::uno::Reference< css::drawing::XDrawPage>& xDrawShape, const css::uno::Reference< css::frame::XModel >& xModel ); 66 67 // Methods 68 virtual void SAL_CALL Select( ) override; 69 virtual css::uno::Reference< ::ooo::vba::msforms::XShape > SAL_CALL Group() override; 70 virtual void SAL_CALL IncrementRotation( double Increment ) override; 71 virtual void SAL_CALL IncrementLeft( double Increment ) override ; 72 virtual void SAL_CALL IncrementTop( double Increment ) override; 73 virtual OUString SAL_CALL getName() override; 74 virtual void SAL_CALL setName( const OUString& _name ) override; 75 virtual double SAL_CALL getHeight() override; 76 virtual void SAL_CALL setHeight( double _height ) override; 77 virtual double SAL_CALL getWidth() override; 78 virtual void SAL_CALL setWidth( double _width ) override; 79 virtual double SAL_CALL getLeft() override; 80 virtual void SAL_CALL setLeft( double _left ) override; 81 virtual double SAL_CALL getTop() override; 82 virtual void SAL_CALL setTop( double _top ) override; 83 virtual css::uno::Reference< ov::msforms::XLineFormat > SAL_CALL getLine() override; 84 virtual css::uno::Reference< ov::msforms::XFillFormat > SAL_CALL getFill() override; 85 virtual sal_Bool SAL_CALL getLockAspectRatio() override; 86 virtual void SAL_CALL setLockAspectRatio( sal_Bool _lockaspectratio ) override; 87 virtual sal_Bool SAL_CALL getLockAnchor() override; 88 virtual void SAL_CALL setLockAnchor( sal_Bool _lockanchor ) override; 89 virtual ::sal_Int32 SAL_CALL getRelativeHorizontalPosition() override; 90 virtual void SAL_CALL setRelativeHorizontalPosition( ::sal_Int32 _relativehorizontalposition ) override; 91 virtual ::sal_Int32 SAL_CALL getRelativeVerticalPosition() override; 92 virtual void SAL_CALL setRelativeVerticalPosition( ::sal_Int32 _relativeverticalposition ) override; 93 virtual css::uno::Any SAL_CALL TextFrame( ) override; 94 virtual css::uno::Any SAL_CALL WrapFormat( ) override; 95 virtual void SAL_CALL ZOrder( sal_Int32 ZOrderCmd ) override; 96 //XEnumerationAccess 97 virtual css::uno::Type SAL_CALL getElementType() override; 98 virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override; 99 // ScVbaCollectionBaseImpl 100 virtual css::uno::Any createCollectionObject( const css::uno::Any& aSource ) override; 101 }; 102 103 #endif // INCLUDED_VBAHELPER_VBASHAPERANGE_HXX 104 105 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 106