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