1*38d50f7bSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*38d50f7bSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*38d50f7bSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*38d50f7bSAndrew Rist * distributed with this work for additional information 6*38d50f7bSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*38d50f7bSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*38d50f7bSAndrew Rist * "License"); you may not use this file except in compliance 9*38d50f7bSAndrew Rist * with the License. You may obtain a copy of the License at 10*38d50f7bSAndrew Rist * 11*38d50f7bSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*38d50f7bSAndrew Rist * 13*38d50f7bSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*38d50f7bSAndrew Rist * software distributed under the License is distributed on an 15*38d50f7bSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*38d50f7bSAndrew Rist * KIND, either express or implied. See the License for the 17*38d50f7bSAndrew Rist * specific language governing permissions and limitations 18*38d50f7bSAndrew Rist * under the License. 19*38d50f7bSAndrew Rist * 20*38d50f7bSAndrew Rist *************************************************************/ 21*38d50f7bSAndrew Rist 22*38d50f7bSAndrew Rist 23cdf0e10cSrcweir #ifndef SC_VBA_WINDOW_HXX 24cdf0e10cSrcweir #define SC_VBA_WINDOW_HXX 25cdf0e10cSrcweir 26cdf0e10cSrcweir #include <ooo/vba/excel/XWindow.hpp> 27cdf0e10cSrcweir #include <com/sun/star/uno/XComponentContext.hpp> 28cdf0e10cSrcweir #include <com/sun/star/sheet/XViewPane.hpp> 29cdf0e10cSrcweir #include <com/sun/star/sheet/XViewFreezable.hpp> 30cdf0e10cSrcweir #include <com/sun/star/sheet/XViewSplitable.hpp> 31cdf0e10cSrcweir #include <com/sun/star/frame/XModel.hpp> 32cdf0e10cSrcweir #include <ooo/vba/excel/XPane.hpp> 33cdf0e10cSrcweir #include <com/sun/star/awt/XDevice.hpp> 34cdf0e10cSrcweir 35cdf0e10cSrcweir #include <vbahelper/vbahelperinterface.hxx> 36cdf0e10cSrcweir #include <vbahelper/vbawindowbase.hxx> 37cdf0e10cSrcweir #include "vbaworkbook.hxx" 38cdf0e10cSrcweir 39cdf0e10cSrcweir typedef cppu::ImplInheritanceHelper1< VbaWindowBase, ov::excel::XWindow > WindowImpl_BASE; 40cdf0e10cSrcweir 41cdf0e10cSrcweir class ScVbaWindow : public WindowImpl_BASE 42cdf0e10cSrcweir { 43cdf0e10cSrcweir private: 44cdf0e10cSrcweir css::uno::Reference< ov::excel::XPane > m_xPane; 45cdf0e10cSrcweir 46cdf0e10cSrcweir void init(); 47cdf0e10cSrcweir css::uno::Reference< css::beans::XPropertySet > getControllerProps() throw (css::uno::RuntimeException); 48cdf0e10cSrcweir css::uno::Reference< css::beans::XPropertySet > getFrameProps() throw (css::uno::RuntimeException); 49cdf0e10cSrcweir css::uno::Reference< css::awt::XDevice > getDevice() throw (css::uno::RuntimeException); 50cdf0e10cSrcweir 51cdf0e10cSrcweir protected: 52cdf0e10cSrcweir void SplitAtDefinedPosition(sal_Bool _bUnFreezePane); 53cdf0e10cSrcweir 54cdf0e10cSrcweir public: 55cdf0e10cSrcweir void Scroll( const css::uno::Any& Down, const css::uno::Any& Up, const css::uno::Any& ToRight, const css::uno::Any& ToLeft, bool bLargeScroll = false ) throw (css::uno::RuntimeException); 56cdf0e10cSrcweir 57cdf0e10cSrcweir public: 58cdf0e10cSrcweir ScVbaWindow( 59cdf0e10cSrcweir const css::uno::Reference< ov::XHelperInterface >& xParent, 60cdf0e10cSrcweir const css::uno::Reference< css::uno::XComponentContext >& xContext, 61cdf0e10cSrcweir const css::uno::Reference< css::frame::XModel >& xModel, 62cdf0e10cSrcweir const css::uno::Reference< css::frame::XController >& xController ) 63cdf0e10cSrcweir throw (css::uno::RuntimeException); 64cdf0e10cSrcweir ScVbaWindow( 65cdf0e10cSrcweir const css::uno::Sequence< css::uno::Any >& aArgs, 66cdf0e10cSrcweir const css::uno::Reference< css::uno::XComponentContext >& xContext ) 67cdf0e10cSrcweir throw (css::uno::RuntimeException); 68cdf0e10cSrcweir 69cdf0e10cSrcweir // XWindow 70cdf0e10cSrcweir virtual css::uno::Reference< ov::excel::XRange > SAL_CALL ActiveCell( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); 71cdf0e10cSrcweir virtual css::uno::Reference< ov::excel::XPane > SAL_CALL ActivePane() throw (css::script::BasicErrorException, css::uno::RuntimeException); 72cdf0e10cSrcweir virtual css::uno::Reference< ov::excel::XWorksheet > SAL_CALL ActiveSheet( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); 73cdf0e10cSrcweir virtual void SAL_CALL setCaption( const css::uno::Any& _caption ) throw (css::uno::RuntimeException); 74cdf0e10cSrcweir virtual css::uno::Any SAL_CALL getCaption() throw (css::uno::RuntimeException); 75cdf0e10cSrcweir virtual ::sal_Bool SAL_CALL getDisplayGridlines() throw (css::uno::RuntimeException); 76cdf0e10cSrcweir virtual void SAL_CALL setDisplayGridlines( ::sal_Bool _displaygridlines ) throw (css::uno::RuntimeException); 77cdf0e10cSrcweir virtual ::sal_Bool SAL_CALL getDisplayHeadings() throw (css::uno::RuntimeException); 78cdf0e10cSrcweir virtual void SAL_CALL setDisplayHeadings( ::sal_Bool _bDisplayHeadings ) throw (css::uno::RuntimeException); 79cdf0e10cSrcweir virtual ::sal_Bool SAL_CALL getDisplayHorizontalScrollBar() throw (css::uno::RuntimeException); 80cdf0e10cSrcweir virtual void SAL_CALL setDisplayHorizontalScrollBar( ::sal_Bool _bDisplayHorizontalScrollBar ) throw (css::uno::RuntimeException); 81cdf0e10cSrcweir virtual ::sal_Bool SAL_CALL getDisplayOutline() throw (css::uno::RuntimeException); 82cdf0e10cSrcweir virtual void SAL_CALL setDisplayOutline( ::sal_Bool _bDisplayOutline ) throw (css::uno::RuntimeException); 83cdf0e10cSrcweir virtual ::sal_Bool SAL_CALL getDisplayVerticalScrollBar() throw (css::uno::RuntimeException); 84cdf0e10cSrcweir virtual void SAL_CALL setDisplayVerticalScrollBar( ::sal_Bool _bDisplayVerticalScrollBar ) throw (css::uno::RuntimeException); 85cdf0e10cSrcweir virtual ::sal_Bool SAL_CALL getDisplayWorkbookTabs() throw (css::uno::RuntimeException); 86cdf0e10cSrcweir virtual void SAL_CALL setDisplayWorkbookTabs( ::sal_Bool _bDisplayWorkbookTabs ) throw (css::uno::RuntimeException); 87cdf0e10cSrcweir virtual ::sal_Bool SAL_CALL getFreezePanes() throw (css::uno::RuntimeException); 88cdf0e10cSrcweir virtual void SAL_CALL setFreezePanes( ::sal_Bool _bFreezePanes ) throw (css::uno::RuntimeException); 89cdf0e10cSrcweir virtual ::sal_Bool SAL_CALL getSplit() throw (css::uno::RuntimeException); 90cdf0e10cSrcweir virtual void SAL_CALL setSplit( ::sal_Bool _bSplit ) throw (css::uno::RuntimeException); 91cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getSplitColumn() throw (css::uno::RuntimeException) ; 92cdf0e10cSrcweir virtual void SAL_CALL setSplitColumn( sal_Int32 _splitcolumn ) throw (css::uno::RuntimeException) ; 93cdf0e10cSrcweir virtual double SAL_CALL getSplitHorizontal() throw (css::uno::RuntimeException) ; 94cdf0e10cSrcweir virtual void SAL_CALL setSplitHorizontal( double _splithorizontal ) throw (css::uno::RuntimeException) ; 95cdf0e10cSrcweir virtual sal_Int32 SAL_CALL getSplitRow() throw (css::uno::RuntimeException) ; 96cdf0e10cSrcweir virtual void SAL_CALL setSplitRow( sal_Int32 _splitrow ) throw (css::uno::RuntimeException) ; 97cdf0e10cSrcweir virtual double SAL_CALL getSplitVertical() throw (css::uno::RuntimeException) ; 98cdf0e10cSrcweir virtual void SAL_CALL setSplitVertical( double _splitvertical ) throw (css::uno::RuntimeException) ; 99cdf0e10cSrcweir virtual css::uno::Any SAL_CALL getScrollRow() throw (css::uno::RuntimeException) ; 100cdf0e10cSrcweir virtual void SAL_CALL setScrollRow( const css::uno::Any& _scrollrow ) throw (css::uno::RuntimeException) ; 101cdf0e10cSrcweir virtual css::uno::Any SAL_CALL getScrollColumn() throw (css::uno::RuntimeException) ; 102cdf0e10cSrcweir virtual void SAL_CALL setScrollColumn( const css::uno::Any& _scrollcolumn ) throw (css::uno::RuntimeException) ; 103cdf0e10cSrcweir virtual css::uno::Any SAL_CALL getView() throw (css::uno::RuntimeException); 104cdf0e10cSrcweir virtual void SAL_CALL setView( const css::uno::Any& _view ) throw (css::uno::RuntimeException); 105cdf0e10cSrcweir virtual css::uno::Reference< ov::excel::XRange > SAL_CALL getVisibleRange() throw (css::uno::RuntimeException); 106cdf0e10cSrcweir virtual css::uno::Any SAL_CALL getWindowState() throw (css::uno::RuntimeException); 107cdf0e10cSrcweir virtual void SAL_CALL setWindowState( const css::uno::Any& _windowstate ) throw (css::uno::RuntimeException); 108cdf0e10cSrcweir virtual css::uno::Any SAL_CALL getZoom() throw (css::uno::RuntimeException); 109cdf0e10cSrcweir virtual void SAL_CALL setZoom( const css::uno::Any& _zoom ) throw (css::uno::RuntimeException); 110cdf0e10cSrcweir 111cdf0e10cSrcweir // Methods 112cdf0e10cSrcweir virtual void SAL_CALL SmallScroll( const css::uno::Any& Down, const css::uno::Any& Up, const css::uno::Any& ToRight, const css::uno::Any& ToLeft ) throw (css::uno::RuntimeException); 113cdf0e10cSrcweir virtual void SAL_CALL LargeScroll( const css::uno::Any& Down, const css::uno::Any& Up, const css::uno::Any& ToRight, const css::uno::Any& ToLeft ) throw (css::uno::RuntimeException); 114cdf0e10cSrcweir virtual css::uno::Any SAL_CALL SelectedSheets( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException); 115cdf0e10cSrcweir virtual void SAL_CALL ScrollWorkbookTabs( const css::uno::Any& Sheets, const css::uno::Any& Position ) throw (css::uno::RuntimeException); 116cdf0e10cSrcweir virtual void SAL_CALL Activate( ) throw (css::uno::RuntimeException); 117cdf0e10cSrcweir virtual void SAL_CALL Close( const css::uno::Any& SaveChanges, const css::uno::Any& FileName, const css::uno::Any& RouteWorkBook ) throw (css::uno::RuntimeException); 118cdf0e10cSrcweir virtual css::uno::Any SAL_CALL Selection( ) throw (css::script::BasicErrorException, css::uno::RuntimeException); 119cdf0e10cSrcweir virtual css::uno::Reference< ov::excel::XRange > SAL_CALL RangeSelection() throw (css::script::BasicErrorException, css::uno::RuntimeException); 120cdf0e10cSrcweir virtual sal_Int32 SAL_CALL PointsToScreenPixelsX(sal_Int32 _points) throw (css::script::BasicErrorException, css::uno::RuntimeException); 121cdf0e10cSrcweir virtual sal_Int32 SAL_CALL PointsToScreenPixelsY(sal_Int32 _points) throw (css::script::BasicErrorException, css::uno::RuntimeException); 122cdf0e10cSrcweir virtual void SAL_CALL PrintOut( const css::uno::Any& From, const css::uno::Any&To, const css::uno::Any& Copies, const css::uno::Any& Preview, const css::uno::Any& ActivePrinter, const css::uno::Any& PrintToFile, const css::uno::Any& Collate, const css::uno::Any& PrToFileName ) throw (css::script::BasicErrorException, css::uno::RuntimeException); 123cdf0e10cSrcweir virtual void SAL_CALL PrintPreview( const css::uno::Any& EnableChanges ) throw (css::script::BasicErrorException, css::uno::RuntimeException); 124cdf0e10cSrcweir // XHelperInterface 125cdf0e10cSrcweir virtual rtl::OUString& getServiceImplName(); 126cdf0e10cSrcweir virtual css::uno::Sequence<rtl::OUString> getServiceNames(); 127cdf0e10cSrcweir }; 128cdf0e10cSrcweir 129cdf0e10cSrcweir #endif //SC_VBA_WINDOW_HXX 130