Line data Source code
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 SC_VBA_WINDOW_HXX
20 : #define SC_VBA_WINDOW_HXX
21 :
22 : #include <ooo/vba/excel/XWindow.hpp>
23 : #include <com/sun/star/uno/XComponentContext.hpp>
24 : #include <com/sun/star/sheet/XViewPane.hpp>
25 : #include <com/sun/star/sheet/XViewFreezable.hpp>
26 : #include <com/sun/star/sheet/XViewSplitable.hpp>
27 : #include <com/sun/star/frame/XModel.hpp>
28 : #include <ooo/vba/excel/XPane.hpp>
29 : #include <com/sun/star/awt/XDevice.hpp>
30 :
31 : #include <vbahelper/vbahelperinterface.hxx>
32 : #include <vbahelper/vbawindowbase.hxx>
33 : #include "vbaworkbook.hxx"
34 :
35 : typedef cppu::ImplInheritanceHelper1< VbaWindowBase, ov::excel::XWindow > WindowImpl_BASE;
36 :
37 0 : class ScVbaWindow : public WindowImpl_BASE
38 : {
39 : private:
40 : css::uno::Reference< ov::excel::XPane > m_xPane;
41 :
42 : void init();
43 : css::uno::Reference< css::beans::XPropertySet > getControllerProps() throw (css::uno::RuntimeException);
44 : css::uno::Reference< css::beans::XPropertySet > getFrameProps() throw (css::uno::RuntimeException);
45 : css::uno::Reference< css::awt::XDevice > getDevice() throw (css::uno::RuntimeException);
46 :
47 : protected:
48 : void SplitAtDefinedPosition( sal_Int32 nColumns, sal_Int32 nRows );
49 :
50 : public:
51 : 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);
52 :
53 : public:
54 : ScVbaWindow(
55 : const css::uno::Reference< ov::XHelperInterface >& xParent,
56 : const css::uno::Reference< css::uno::XComponentContext >& xContext,
57 : const css::uno::Reference< css::frame::XModel >& xModel,
58 : const css::uno::Reference< css::frame::XController >& xController )
59 : throw (css::uno::RuntimeException);
60 : ScVbaWindow(
61 : const css::uno::Sequence< css::uno::Any >& aArgs,
62 : const css::uno::Reference< css::uno::XComponentContext >& xContext )
63 : throw (css::uno::RuntimeException);
64 :
65 : // XWindow
66 : virtual css::uno::Reference< ov::excel::XRange > SAL_CALL ActiveCell( ) throw (css::script::BasicErrorException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
67 : virtual css::uno::Reference< ov::excel::XPane > SAL_CALL ActivePane() throw (css::script::BasicErrorException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
68 : virtual css::uno::Reference< ov::excel::XWorksheet > SAL_CALL ActiveSheet( ) throw (css::script::BasicErrorException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
69 : virtual void SAL_CALL setCaption( const css::uno::Any& _caption ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
70 : virtual css::uno::Any SAL_CALL getCaption() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
71 : virtual sal_Bool SAL_CALL getDisplayGridlines() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
72 : virtual void SAL_CALL setDisplayGridlines( sal_Bool _displaygridlines ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
73 : virtual sal_Bool SAL_CALL getDisplayHeadings() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
74 : virtual void SAL_CALL setDisplayHeadings( sal_Bool _bDisplayHeadings ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
75 : virtual sal_Bool SAL_CALL getDisplayHorizontalScrollBar() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
76 : virtual void SAL_CALL setDisplayHorizontalScrollBar( sal_Bool _bDisplayHorizontalScrollBar ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
77 : virtual sal_Bool SAL_CALL getDisplayOutline() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
78 : virtual void SAL_CALL setDisplayOutline( sal_Bool _bDisplayOutline ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
79 : virtual sal_Bool SAL_CALL getDisplayVerticalScrollBar() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
80 : virtual void SAL_CALL setDisplayVerticalScrollBar( sal_Bool _bDisplayVerticalScrollBar ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
81 : virtual sal_Bool SAL_CALL getDisplayWorkbookTabs() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
82 : virtual void SAL_CALL setDisplayWorkbookTabs( sal_Bool _bDisplayWorkbookTabs ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
83 : virtual sal_Bool SAL_CALL getFreezePanes() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
84 : virtual void SAL_CALL setFreezePanes( sal_Bool _bFreezePanes ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
85 : virtual sal_Bool SAL_CALL getSplit() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
86 : virtual void SAL_CALL setSplit( sal_Bool _bSplit ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
87 : virtual sal_Int32 SAL_CALL getSplitColumn() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE ;
88 : virtual void SAL_CALL setSplitColumn( sal_Int32 _splitcolumn ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE ;
89 : virtual double SAL_CALL getSplitHorizontal() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE ;
90 : virtual void SAL_CALL setSplitHorizontal( double _splithorizontal ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE ;
91 : virtual sal_Int32 SAL_CALL getSplitRow() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE ;
92 : virtual void SAL_CALL setSplitRow( sal_Int32 _splitrow ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE ;
93 : virtual double SAL_CALL getSplitVertical() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE ;
94 : virtual void SAL_CALL setSplitVertical( double _splitvertical ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE ;
95 : virtual css::uno::Any SAL_CALL getScrollRow() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE ;
96 : virtual void SAL_CALL setScrollRow( const css::uno::Any& _scrollrow ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE ;
97 : virtual css::uno::Any SAL_CALL getScrollColumn() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE ;
98 : virtual void SAL_CALL setScrollColumn( const css::uno::Any& _scrollcolumn ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE ;
99 : virtual css::uno::Any SAL_CALL getView() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
100 : virtual void SAL_CALL setView( const css::uno::Any& _view ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
101 : virtual css::uno::Reference< ov::excel::XRange > SAL_CALL getVisibleRange() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
102 : virtual css::uno::Any SAL_CALL getWindowState() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
103 : virtual void SAL_CALL setWindowState( const css::uno::Any& _windowstate ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
104 : virtual css::uno::Any SAL_CALL getZoom() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
105 : virtual void SAL_CALL setZoom(const css::uno::Any& _zoom) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
106 : virtual double SAL_CALL getTabRatio() throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE ;
107 : virtual void SAL_CALL setTabRatio( double _tabratio ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE ;
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 ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
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 ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
112 : virtual css::uno::Any SAL_CALL SelectedSheets( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
113 : virtual void SAL_CALL ScrollWorkbookTabs( const css::uno::Any& Sheets, const css::uno::Any& Position ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
114 : virtual void SAL_CALL Activate( ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
115 : virtual void SAL_CALL Close( const css::uno::Any& SaveChanges, const css::uno::Any& FileName, const css::uno::Any& RouteWorkBook ) throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
116 : virtual css::uno::Any SAL_CALL Selection( ) throw (css::script::BasicErrorException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
117 : virtual css::uno::Reference< ov::excel::XRange > SAL_CALL RangeSelection() throw (css::script::BasicErrorException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
118 : virtual sal_Int32 SAL_CALL PointsToScreenPixelsX(sal_Int32 _points) throw (css::script::BasicErrorException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
119 : virtual sal_Int32 SAL_CALL PointsToScreenPixelsY(sal_Int32 _points) throw (css::script::BasicErrorException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
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 ) throw (css::script::BasicErrorException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
121 : virtual void SAL_CALL PrintPreview( const css::uno::Any& EnableChanges ) throw (css::script::BasicErrorException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
122 : // XHelperInterface
123 : virtual OUString getServiceImplName() SAL_OVERRIDE;
124 : virtual css::uno::Sequence<OUString> getServiceNames() SAL_OVERRIDE;
125 : };
126 :
127 : #endif //SC_VBA_WINDOW_HXX
128 :
129 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|