xref: /aoo41x/main/sc/source/ui/vba/vbawindow.hxx (revision cdf0e10c)
1*cdf0e10cSrcweir /*************************************************************************
2*cdf0e10cSrcweir  *
3*cdf0e10cSrcweir  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4*cdf0e10cSrcweir  *
5*cdf0e10cSrcweir  * Copyright 2000, 2010 Oracle and/or its affiliates.
6*cdf0e10cSrcweir  *
7*cdf0e10cSrcweir  * OpenOffice.org - a multi-platform office productivity suite
8*cdf0e10cSrcweir  *
9*cdf0e10cSrcweir  * This file is part of OpenOffice.org.
10*cdf0e10cSrcweir  *
11*cdf0e10cSrcweir  * OpenOffice.org is free software: you can redistribute it and/or modify
12*cdf0e10cSrcweir  * it under the terms of the GNU Lesser General Public License version 3
13*cdf0e10cSrcweir  * only, as published by the Free Software Foundation.
14*cdf0e10cSrcweir  *
15*cdf0e10cSrcweir  * OpenOffice.org is distributed in the hope that it will be useful,
16*cdf0e10cSrcweir  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17*cdf0e10cSrcweir  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18*cdf0e10cSrcweir  * GNU Lesser General Public License version 3 for more details
19*cdf0e10cSrcweir  * (a copy is included in the LICENSE file that accompanied this code).
20*cdf0e10cSrcweir  *
21*cdf0e10cSrcweir  * You should have received a copy of the GNU Lesser General Public License
22*cdf0e10cSrcweir  * version 3 along with OpenOffice.org.  If not, see
23*cdf0e10cSrcweir  * <http://www.openoffice.org/license.html>
24*cdf0e10cSrcweir  * for a copy of the LGPLv3 License.
25*cdf0e10cSrcweir  *
26*cdf0e10cSrcweir  ************************************************************************/
27*cdf0e10cSrcweir #ifndef SC_VBA_WINDOW_HXX
28*cdf0e10cSrcweir #define SC_VBA_WINDOW_HXX
29*cdf0e10cSrcweir 
30*cdf0e10cSrcweir #include <ooo/vba/excel/XWindow.hpp>
31*cdf0e10cSrcweir #include <com/sun/star/uno/XComponentContext.hpp>
32*cdf0e10cSrcweir #include <com/sun/star/sheet/XViewPane.hpp>
33*cdf0e10cSrcweir #include <com/sun/star/sheet/XViewFreezable.hpp>
34*cdf0e10cSrcweir #include <com/sun/star/sheet/XViewSplitable.hpp>
35*cdf0e10cSrcweir #include <com/sun/star/frame/XModel.hpp>
36*cdf0e10cSrcweir #include <ooo/vba/excel/XPane.hpp>
37*cdf0e10cSrcweir #include <com/sun/star/awt/XDevice.hpp>
38*cdf0e10cSrcweir 
39*cdf0e10cSrcweir #include <vbahelper/vbahelperinterface.hxx>
40*cdf0e10cSrcweir #include <vbahelper/vbawindowbase.hxx>
41*cdf0e10cSrcweir #include "vbaworkbook.hxx"
42*cdf0e10cSrcweir 
43*cdf0e10cSrcweir typedef cppu::ImplInheritanceHelper1< VbaWindowBase, ov::excel::XWindow > WindowImpl_BASE;
44*cdf0e10cSrcweir 
45*cdf0e10cSrcweir class ScVbaWindow : public WindowImpl_BASE
46*cdf0e10cSrcweir {
47*cdf0e10cSrcweir private:
48*cdf0e10cSrcweir 	css::uno::Reference< ov::excel::XPane > m_xPane;
49*cdf0e10cSrcweir 
50*cdf0e10cSrcweir     void init();
51*cdf0e10cSrcweir     css::uno::Reference< css::beans::XPropertySet > getControllerProps() throw (css::uno::RuntimeException);
52*cdf0e10cSrcweir     css::uno::Reference< css::beans::XPropertySet > getFrameProps() throw (css::uno::RuntimeException);
53*cdf0e10cSrcweir     css::uno::Reference< css::awt::XDevice > getDevice() throw (css::uno::RuntimeException);
54*cdf0e10cSrcweir 
55*cdf0e10cSrcweir protected:
56*cdf0e10cSrcweir 	void SplitAtDefinedPosition(sal_Bool _bUnFreezePane);
57*cdf0e10cSrcweir 
58*cdf0e10cSrcweir public:
59*cdf0e10cSrcweir 	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);
60*cdf0e10cSrcweir 
61*cdf0e10cSrcweir public:
62*cdf0e10cSrcweir 	ScVbaWindow(
63*cdf0e10cSrcweir         const css::uno::Reference< ov::XHelperInterface >& xParent,
64*cdf0e10cSrcweir         const css::uno::Reference< css::uno::XComponentContext >& xContext,
65*cdf0e10cSrcweir         const css::uno::Reference< css::frame::XModel >& xModel,
66*cdf0e10cSrcweir         const css::uno::Reference< css::frame::XController >& xController )
67*cdf0e10cSrcweir         throw (css::uno::RuntimeException);
68*cdf0e10cSrcweir     ScVbaWindow(
69*cdf0e10cSrcweir         const css::uno::Sequence< css::uno::Any >& aArgs,
70*cdf0e10cSrcweir         const css::uno::Reference< css::uno::XComponentContext >& xContext )
71*cdf0e10cSrcweir         throw (css::uno::RuntimeException);
72*cdf0e10cSrcweir 
73*cdf0e10cSrcweir 	// XWindow
74*cdf0e10cSrcweir 	virtual css::uno::Reference< ov::excel::XRange > SAL_CALL ActiveCell(  ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
75*cdf0e10cSrcweir  	virtual css::uno::Reference< ov::excel::XPane > SAL_CALL ActivePane() throw (css::script::BasicErrorException, css::uno::RuntimeException);
76*cdf0e10cSrcweir 	virtual css::uno::Reference< ov::excel::XWorksheet > SAL_CALL ActiveSheet(  ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
77*cdf0e10cSrcweir 	virtual void SAL_CALL setCaption( const css::uno::Any& _caption ) throw (css::uno::RuntimeException);
78*cdf0e10cSrcweir 	virtual css::uno::Any SAL_CALL getCaption() throw (css::uno::RuntimeException);
79*cdf0e10cSrcweir 	virtual ::sal_Bool SAL_CALL getDisplayGridlines() throw (css::uno::RuntimeException);
80*cdf0e10cSrcweir 	virtual void SAL_CALL setDisplayGridlines( ::sal_Bool _displaygridlines ) throw (css::uno::RuntimeException);
81*cdf0e10cSrcweir 	virtual ::sal_Bool SAL_CALL getDisplayHeadings() throw (css::uno::RuntimeException);
82*cdf0e10cSrcweir 	virtual void SAL_CALL setDisplayHeadings( ::sal_Bool _bDisplayHeadings ) throw (css::uno::RuntimeException);
83*cdf0e10cSrcweir 	virtual ::sal_Bool SAL_CALL getDisplayHorizontalScrollBar() throw (css::uno::RuntimeException);
84*cdf0e10cSrcweir 	virtual void SAL_CALL setDisplayHorizontalScrollBar( ::sal_Bool _bDisplayHorizontalScrollBar ) throw (css::uno::RuntimeException);
85*cdf0e10cSrcweir 	virtual ::sal_Bool SAL_CALL getDisplayOutline() throw (css::uno::RuntimeException);
86*cdf0e10cSrcweir 	virtual void SAL_CALL setDisplayOutline( ::sal_Bool _bDisplayOutline ) throw (css::uno::RuntimeException);
87*cdf0e10cSrcweir 	virtual ::sal_Bool SAL_CALL getDisplayVerticalScrollBar() throw (css::uno::RuntimeException);
88*cdf0e10cSrcweir 	virtual void SAL_CALL setDisplayVerticalScrollBar( ::sal_Bool _bDisplayVerticalScrollBar ) throw (css::uno::RuntimeException);
89*cdf0e10cSrcweir 	virtual ::sal_Bool SAL_CALL getDisplayWorkbookTabs() throw (css::uno::RuntimeException);
90*cdf0e10cSrcweir 	virtual void SAL_CALL setDisplayWorkbookTabs( ::sal_Bool _bDisplayWorkbookTabs ) throw (css::uno::RuntimeException);
91*cdf0e10cSrcweir 	virtual ::sal_Bool SAL_CALL getFreezePanes() throw (css::uno::RuntimeException);
92*cdf0e10cSrcweir 	virtual void SAL_CALL setFreezePanes( ::sal_Bool _bFreezePanes ) throw (css::uno::RuntimeException);
93*cdf0e10cSrcweir 	virtual ::sal_Bool SAL_CALL getSplit() throw (css::uno::RuntimeException);
94*cdf0e10cSrcweir 	virtual void SAL_CALL setSplit( ::sal_Bool _bSplit ) throw (css::uno::RuntimeException);
95*cdf0e10cSrcweir     virtual sal_Int32 SAL_CALL getSplitColumn() throw (css::uno::RuntimeException) ;
96*cdf0e10cSrcweir     virtual void SAL_CALL setSplitColumn( sal_Int32 _splitcolumn ) throw (css::uno::RuntimeException) ;
97*cdf0e10cSrcweir     virtual double SAL_CALL getSplitHorizontal() throw (css::uno::RuntimeException) ;
98*cdf0e10cSrcweir     virtual void SAL_CALL setSplitHorizontal( double _splithorizontal ) throw (css::uno::RuntimeException) ;
99*cdf0e10cSrcweir     virtual sal_Int32 SAL_CALL getSplitRow() throw (css::uno::RuntimeException) ;
100*cdf0e10cSrcweir     virtual void SAL_CALL setSplitRow( sal_Int32 _splitrow ) throw (css::uno::RuntimeException) ;
101*cdf0e10cSrcweir     virtual double SAL_CALL getSplitVertical() throw (css::uno::RuntimeException) ;
102*cdf0e10cSrcweir     virtual void SAL_CALL setSplitVertical( double _splitvertical ) throw (css::uno::RuntimeException) ;
103*cdf0e10cSrcweir     virtual css::uno::Any SAL_CALL getScrollRow() throw (css::uno::RuntimeException) ;
104*cdf0e10cSrcweir     virtual void SAL_CALL setScrollRow( const css::uno::Any& _scrollrow ) throw (css::uno::RuntimeException) ;
105*cdf0e10cSrcweir     virtual css::uno::Any SAL_CALL getScrollColumn() throw (css::uno::RuntimeException) ;
106*cdf0e10cSrcweir     virtual void SAL_CALL setScrollColumn( const css::uno::Any& _scrollcolumn ) throw (css::uno::RuntimeException) ;
107*cdf0e10cSrcweir     virtual css::uno::Any SAL_CALL getView() throw (css::uno::RuntimeException);
108*cdf0e10cSrcweir     virtual void SAL_CALL setView( const css::uno::Any& _view ) throw (css::uno::RuntimeException);
109*cdf0e10cSrcweir 	virtual css::uno::Reference< ov::excel::XRange > SAL_CALL getVisibleRange() throw (css::uno::RuntimeException);
110*cdf0e10cSrcweir     virtual css::uno::Any SAL_CALL getWindowState() throw (css::uno::RuntimeException);
111*cdf0e10cSrcweir     virtual void SAL_CALL setWindowState( const css::uno::Any& _windowstate ) throw (css::uno::RuntimeException);
112*cdf0e10cSrcweir     virtual css::uno::Any SAL_CALL getZoom() throw (css::uno::RuntimeException);
113*cdf0e10cSrcweir     virtual void SAL_CALL setZoom( const css::uno::Any& _zoom ) throw (css::uno::RuntimeException);
114*cdf0e10cSrcweir 
115*cdf0e10cSrcweir 	// Methods
116*cdf0e10cSrcweir 	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);
117*cdf0e10cSrcweir 	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);
118*cdf0e10cSrcweir 	virtual css::uno::Any SAL_CALL SelectedSheets( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
119*cdf0e10cSrcweir 	virtual void SAL_CALL ScrollWorkbookTabs( const css::uno::Any& Sheets, const css::uno::Any& Position ) throw (css::uno::RuntimeException);
120*cdf0e10cSrcweir 	virtual void SAL_CALL Activate(  ) throw (css::uno::RuntimeException);
121*cdf0e10cSrcweir 	virtual void SAL_CALL Close( const css::uno::Any& SaveChanges, const css::uno::Any& FileName, const css::uno::Any& RouteWorkBook ) throw (css::uno::RuntimeException);
122*cdf0e10cSrcweir 	virtual css::uno::Any SAL_CALL Selection(  ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
123*cdf0e10cSrcweir     virtual css::uno::Reference< ov::excel::XRange > SAL_CALL RangeSelection() throw (css::script::BasicErrorException, css::uno::RuntimeException);
124*cdf0e10cSrcweir 	virtual sal_Int32 SAL_CALL PointsToScreenPixelsX(sal_Int32 _points) throw (css::script::BasicErrorException, css::uno::RuntimeException);
125*cdf0e10cSrcweir 	virtual sal_Int32 SAL_CALL PointsToScreenPixelsY(sal_Int32 _points) throw (css::script::BasicErrorException, css::uno::RuntimeException);
126*cdf0e10cSrcweir 	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);
127*cdf0e10cSrcweir 	virtual void SAL_CALL PrintPreview( const css::uno::Any& EnableChanges ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
128*cdf0e10cSrcweir 	// XHelperInterface
129*cdf0e10cSrcweir 	virtual rtl::OUString& getServiceImplName();
130*cdf0e10cSrcweir 	virtual css::uno::Sequence<rtl::OUString> getServiceNames();
131*cdf0e10cSrcweir };
132*cdf0e10cSrcweir 
133*cdf0e10cSrcweir #endif //SC_VBA_WINDOW_HXX
134