Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : : #ifndef SC_VBA_WORKSHEET_HXX
29 : : #define SC_VBA_WORKSHEET_HXX
30 : :
31 : : #include <cppuhelper/implbase2.hxx>
32 : : #include <comphelper/unwrapargs.hxx>
33 : :
34 : : #include <com/sun/star/sheet/XSpreadsheet.hpp>
35 : : #include <com/sun/star/script/XInvocation.hpp>
36 : : #include <ooo/vba/excel/XWorksheet.hpp>
37 : : #include <ooo/vba/excel/XComments.hpp>
38 : : #include <ooo/vba/excel/XRange.hpp>
39 : : #include <com/sun/star/lang/XEventListener.hpp>
40 : : #include <com/sun/star/uno/XComponentContext.hpp>
41 : : #include <com/sun/star/frame/XModel.hpp>
42 : : #include <ooo/vba/excel/XOutline.hpp>
43 : : #include <ooo/vba/excel/XPageSetup.hpp>
44 : : #include <ooo/vba/excel/XHPageBreaks.hpp>
45 : : #include <ooo/vba/excel/XVPageBreaks.hpp>
46 : : #include <com/sun/star/container/XNamed.hpp>
47 : :
48 : : #include <vbahelper/vbahelperinterface.hxx>
49 : : #include "address.hxx"
50 : :
51 : : namespace ooo { namespace vba { namespace excel {
52 : : class XChartObjects;
53 : : class XHyperlinks;
54 : : } } }
55 : :
56 : : class ScVbaSheetObjectsBase;
57 : :
58 : : typedef InheritedHelperInterfaceImpl1< ov::excel::XWorksheet > WorksheetImpl_BASE;
59 : :
60 : : class ScVbaWorksheet : public WorksheetImpl_BASE
61 : : {
62 : : css::uno::Reference< css::sheet::XSpreadsheet > mxSheet;
63 : : css::uno::Reference< css::frame::XModel > mxModel;
64 : : css::uno::Reference< ov::excel::XChartObjects > mxCharts;
65 : : css::uno::Reference< ov::excel::XHyperlinks > mxHlinks;
66 : : ::rtl::Reference< ScVbaSheetObjectsBase > mxButtons;
67 : : bool mbVeryHidden;
68 : :
69 : : css::uno::Reference< ov::excel::XWorksheet > getSheetAtOffset(SCTAB offset) throw (css::uno::RuntimeException);
70 : : css::uno::Reference< ov::excel::XRange > getSheetRange() throw (css::uno::RuntimeException);
71 : :
72 : : css::uno::Reference< css::container::XNameAccess > getFormControls();
73 : : css::uno::Any getControlShape( const rtl::OUString& sName );
74 : :
75 : : public:
76 : : ScVbaWorksheet( const css::uno::Reference< ov::XHelperInterface >& xParent,
77 : : const css::uno::Reference< css::uno::XComponentContext >& xContext,
78 : : const css::uno::Reference< css::sheet::XSpreadsheet >& xSheet,
79 : : const css::uno::Reference< css::frame::XModel >& xModel )throw (css::uno::RuntimeException) ;
80 : : ScVbaWorksheet( css::uno::Sequence< css::uno::Any > const& aArgs, css::uno::Reference< css::uno::XComponentContext >const& xContext ) throw ( css::lang::IllegalArgumentException );
81 : :
82 : : virtual ~ScVbaWorksheet();
83 : :
84 : 0 : virtual css::uno::Reference< css::frame::XModel > getModel()
85 : 0 : { return mxModel; }
86 : 40 : virtual css::uno::Reference< css::sheet::XSpreadsheet > getSheet()
87 : 40 : { return mxSheet; }
88 : : static const com::sun::star::uno::Sequence<sal_Int8>& getUnoTunnelId();
89 : : css::uno::Reference< ov::excel::XWorksheet > createSheetCopyInNewDoc( rtl::OUString);
90 : : css::uno::Reference< ov::excel::XWorksheet > createSheetCopy(css::uno::Reference< ov::excel::XWorksheet> xSheet, bool bAfter);
91 : :
92 : : // Attributes
93 : : virtual ::rtl::OUString SAL_CALL getName() throw (css::uno::RuntimeException);
94 : : virtual void SAL_CALL setName( const ::rtl::OUString &rName ) throw (css::uno::RuntimeException);
95 : : virtual ::sal_Int32 SAL_CALL getVisible() throw (css::uno::RuntimeException);
96 : : virtual void SAL_CALL setVisible( ::sal_Int32 _Visible ) throw (css::uno::RuntimeException);
97 : : virtual ::sal_Int32 SAL_CALL getStandardWidth() throw (css::uno::RuntimeException);
98 : : virtual ::sal_Int32 SAL_CALL getStandardHeight() throw (css::uno::RuntimeException);
99 : : virtual ::sal_Bool SAL_CALL getProtectionMode() throw (css::uno::RuntimeException);
100 : : virtual ::sal_Bool SAL_CALL getProtectContents() throw (css::uno::RuntimeException);
101 : : virtual ::sal_Bool SAL_CALL getProtectDrawingObjects() throw (css::uno::RuntimeException);
102 : : virtual ::sal_Bool SAL_CALL getProtectScenarios() throw (css::uno::RuntimeException);
103 : : virtual css::uno::Reference< ov::excel::XRange > SAL_CALL getUsedRange() throw (css::uno::RuntimeException) ;
104 : : virtual css::uno::Any SAL_CALL ChartObjects( const css::uno::Any& Index ) throw (css::uno::RuntimeException);
105 : : virtual css::uno::Reference< ov::excel::XOutline > SAL_CALL Outline( ) throw (css::uno::RuntimeException);
106 : : virtual css::uno::Reference< ov::excel::XPageSetup > SAL_CALL PageSetup( ) throw (css::uno::RuntimeException);
107 : : virtual css::uno::Any SAL_CALL HPageBreaks( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
108 : : virtual css::uno::Any SAL_CALL VPageBreaks( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
109 : : virtual css::uno::Reference< ov::excel::XWorksheet > SAL_CALL getNext() throw (css::uno::RuntimeException);
110 : : virtual css::uno::Reference< ov::excel::XWorksheet > SAL_CALL getPrevious() throw (css::uno::RuntimeException);
111 : : virtual sal_Int16 SAL_CALL getIndex() throw (css::uno::RuntimeException);
112 : : virtual sal_Int32 SAL_CALL getEnableSelection() throw (css::uno::RuntimeException);
113 : : virtual void SAL_CALL setEnableSelection( sal_Int32 nSelection ) throw (css::uno::RuntimeException);
114 : : virtual sal_Bool SAL_CALL getAutoFilterMode() throw (css::uno::RuntimeException);
115 : : virtual void SAL_CALL setAutoFilterMode( sal_Bool bAutoFilterMode ) throw (css::uno::RuntimeException);
116 : :
117 : : // Methods
118 : : virtual void SAL_CALL Activate() throw (css::uno::RuntimeException);
119 : : virtual void SAL_CALL Select(const css::uno::Any& aReplace) throw (css::uno::RuntimeException); // add the input parameter to support expand selection
120 : : virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Range( const css::uno::Any& Cell1, const css::uno::Any& Cell2 ) throw (css::uno::RuntimeException);
121 : : virtual void SAL_CALL Move( const css::uno::Any& Before, const css::uno::Any& After ) throw (css::uno::RuntimeException) ;
122 : : virtual void SAL_CALL Copy( const css::uno::Any& Before, const css::uno::Any& After ) throw (css::uno::RuntimeException);
123 : : virtual void SAL_CALL Paste( const css::uno::Any& Destination, const css::uno::Any& Link ) throw (css::uno::RuntimeException);
124 : : virtual void SAL_CALL Delete( ) throw (css::uno::RuntimeException);
125 : : virtual void SAL_CALL Protect( const css::uno::Any& Password, const css::uno::Any& DrawingObjects, const css::uno::Any& Contents, const css::uno::Any& Scenarios, const css::uno::Any& UserInterfaceOnly ) throw (css::uno::RuntimeException);
126 : : virtual void SAL_CALL Unprotect( const css::uno::Any& Password ) throw (css::uno::RuntimeException);
127 : :
128 : : virtual void SAL_CALL Calculate( ) throw (css::uno::RuntimeException);
129 : : virtual void SAL_CALL CheckSpelling( const css::uno::Any& CustomDictionary,const css::uno::Any& IgnoreUppercase,const css::uno::Any& AlwaysSuggest, const css::uno::Any& SpellingLang ) throw (css::uno::RuntimeException);
130 : : // Hacks (?)
131 : : virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Cells( const css::uno::Any &nRow, const css::uno::Any &nCol ) throw (css::uno::RuntimeException);
132 : : virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Rows(const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
133 : : virtual css::uno::Reference< ov::excel::XRange > SAL_CALL Columns(const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
134 : :
135 : : virtual css::uno::Any SAL_CALL Evaluate( const ::rtl::OUString& Name ) throw (css::uno::RuntimeException);
136 : : virtual css::uno::Any SAL_CALL PivotTables( const css::uno::Any& Index ) throw (css::uno::RuntimeException);
137 : : virtual css::uno::Any SAL_CALL Comments( const css::uno::Any& Index ) throw (css::uno::RuntimeException);
138 : : virtual css::uno::Any SAL_CALL Hyperlinks( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
139 : : virtual css::uno::Any SAL_CALL Names( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
140 : :
141 : : virtual css::uno::Any SAL_CALL OLEObjects( const css::uno::Any& Index ) throw (css::uno::RuntimeException);
142 : : virtual css::uno::Any SAL_CALL Shapes( const css::uno::Any& aIndex ) throw (css::uno::RuntimeException);
143 : :
144 : : virtual css::uno::Any SAL_CALL Buttons( const css::uno::Any& rIndex ) throw (css::uno::RuntimeException);
145 : : virtual css::uno::Any SAL_CALL CheckBoxes( const css::uno::Any& rIndex ) throw (css::uno::RuntimeException);
146 : : virtual css::uno::Any SAL_CALL DropDowns( const css::uno::Any& rIndex ) throw (css::uno::RuntimeException);
147 : : virtual css::uno::Any SAL_CALL GroupBoxes( const css::uno::Any& rIndex ) throw (css::uno::RuntimeException);
148 : : virtual css::uno::Any SAL_CALL Labels( const css::uno::Any& rIndex ) throw (css::uno::RuntimeException);
149 : : virtual css::uno::Any SAL_CALL ListBoxes( const css::uno::Any& rIndex ) throw (css::uno::RuntimeException);
150 : : virtual css::uno::Any SAL_CALL OptionButtons( const css::uno::Any& rIndex ) throw (css::uno::RuntimeException);
151 : : virtual css::uno::Any SAL_CALL ScrollBars( const css::uno::Any& rIndex ) throw (css::uno::RuntimeException);
152 : : virtual css::uno::Any SAL_CALL Spinners( const css::uno::Any& rIndex ) throw (css::uno::RuntimeException);
153 : :
154 : : virtual void SAL_CALL setEnableCalculation( ::sal_Bool EnableCalculation ) throw ( css::script::BasicErrorException, css::uno::RuntimeException);
155 : : virtual ::sal_Bool SAL_CALL getEnableCalculation( ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
156 : : virtual void SAL_CALL ShowDataForm( ) throw (css::uno::RuntimeException);
157 : : // XInvocation
158 : : virtual css::uno::Reference< css::beans::XIntrospectionAccess > SAL_CALL getIntrospection( ) throw (css::uno::RuntimeException);
159 : : virtual css::uno::Any SAL_CALL invoke( const ::rtl::OUString& aFunctionName, const css::uno::Sequence< css::uno::Any >& aParams, css::uno::Sequence< ::sal_Int16 >& aOutParamIndex, css::uno::Sequence< css::uno::Any >& aOutParam ) throw (css::lang::IllegalArgumentException, css::script::CannotConvertException, css::reflection::InvocationTargetException, css::uno::RuntimeException);
160 : : virtual void SAL_CALL setValue( const ::rtl::OUString& aPropertyName, const css::uno::Any& aValue ) throw (css::beans::UnknownPropertyException, css::script::CannotConvertException, css::reflection::InvocationTargetException, css::uno::RuntimeException);
161 : : virtual css::uno::Any SAL_CALL getValue( const ::rtl::OUString& aPropertyName ) throw (css::beans::UnknownPropertyException, css::uno::RuntimeException);
162 : : virtual ::sal_Bool SAL_CALL hasMethod( const ::rtl::OUString& aName ) throw (css::uno::RuntimeException);
163 : : virtual ::sal_Bool SAL_CALL hasProperty( const ::rtl::OUString& aName ) throw (css::uno::RuntimeException);
164 : : // CodeName
165 : : virtual rtl::OUString SAL_CALL getCodeName() throw (css::uno::RuntimeException);
166 : : sal_Int16 getSheetID() throw (css::uno::RuntimeException);
167 : :
168 : : 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, const css::uno::Any& IgnorePrintAreas ) throw (css::uno::RuntimeException);
169 : : // XHelperInterface
170 : : virtual rtl::OUString getServiceImplName();
171 : : virtual css::uno::Sequence<rtl::OUString> getServiceNames();
172 : : // XUnoTunnel
173 : : virtual ::sal_Int64 SAL_CALL getSomething(const css::uno::Sequence<sal_Int8 >& rId ) throw(css::uno::RuntimeException);
174 : : };
175 : :
176 : : #endif /* SC_VBA_WORKSHEET_HXX */
177 : :
178 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|