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