xref: /aoo42x/main/sc/source/ui/vba/vbaformat.hxx (revision 38d50f7b)
1*38d50f7bSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*38d50f7bSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*38d50f7bSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*38d50f7bSAndrew Rist  * distributed with this work for additional information
6*38d50f7bSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*38d50f7bSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*38d50f7bSAndrew Rist  * "License"); you may not use this file except in compliance
9*38d50f7bSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*38d50f7bSAndrew Rist  *
11*38d50f7bSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*38d50f7bSAndrew Rist  *
13*38d50f7bSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*38d50f7bSAndrew Rist  * software distributed under the License is distributed on an
15*38d50f7bSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*38d50f7bSAndrew Rist  * KIND, either express or implied.  See the License for the
17*38d50f7bSAndrew Rist  * specific language governing permissions and limitations
18*38d50f7bSAndrew Rist  * under the License.
19*38d50f7bSAndrew Rist  *
20*38d50f7bSAndrew Rist  *************************************************************/
21*38d50f7bSAndrew Rist 
22*38d50f7bSAndrew Rist 
23cdf0e10cSrcweir #ifndef SC_VBA_FORMAT_HXX
24cdf0e10cSrcweir #define SC_VBA_FORMAT_HXX
25cdf0e10cSrcweir #include <ooo/vba/excel/XFormat.hpp>
26cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp>
27cdf0e10cSrcweir #include <com/sun/star/util/XNumberFormatsSupplier.hpp>
28cdf0e10cSrcweir #include <com/sun/star/util/XNumberFormats.hpp>
29cdf0e10cSrcweir #include <com/sun/star/util/XNumberFormatTypes.hpp>
30cdf0e10cSrcweir #include <com/sun/star/frame/XModel.hpp>
31cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp>
32cdf0e10cSrcweir #include <com/sun/star/lang/XMultiServiceFactory.hpp>
33cdf0e10cSrcweir #include <com/sun/star/lang/Locale.hpp>
34cdf0e10cSrcweir #include <com/sun/star/beans/XPropertyState.hpp>
35cdf0e10cSrcweir #include <vbahelper/vbahelperinterface.hxx>
36cdf0e10cSrcweir 
37cdf0e10cSrcweir class ScCellRangesBase;
38cdf0e10cSrcweir 
39cdf0e10cSrcweir template< typename Ifc1 >
40cdf0e10cSrcweir class ScVbaFormat : public InheritedHelperInterfaceImpl1< Ifc1 >
41cdf0e10cSrcweir {
42cdf0e10cSrcweir typedef InheritedHelperInterfaceImpl1< Ifc1 > ScVbaFormat_BASE;
43cdf0e10cSrcweir 	css::lang::Locale m_aDefaultLocale;
44cdf0e10cSrcweir protected:
getDefaultLocale()45cdf0e10cSrcweir 	css::lang::Locale getDefaultLocale() { return m_aDefaultLocale; }
46cdf0e10cSrcweir 	css::uno::Reference< css::beans::XPropertySet > mxPropertySet;
47cdf0e10cSrcweir 	css::uno::Reference< css::util::XNumberFormatsSupplier > mxNumberFormatsSupplier;
48cdf0e10cSrcweir 	css::uno::Reference< css::util::XNumberFormats > xNumberFormats;
49cdf0e10cSrcweir 	css::uno::Reference< css::util::XNumberFormatTypes > xNumberFormatTypes;
50cdf0e10cSrcweir 	css::uno::Reference< css::frame::XModel > mxModel;
51cdf0e10cSrcweir 	css::uno::Reference< css::beans::XPropertyState > xPropertyState;
52cdf0e10cSrcweir 	sal_Bool mbCheckAmbiguoity;
53cdf0e10cSrcweir 	sal_Bool mbAddIndent;
54cdf0e10cSrcweir 	//NumberFormatter oNumberFormatter = null;
55cdf0e10cSrcweir 	css::uno::Reference< css::lang::XMultiServiceFactory > xMultiServiceFactory;
56cdf0e10cSrcweir 	bool isAmbiguous(const rtl::OUString& _sPropertyName) throw ( css::script::BasicErrorException );
57cdf0e10cSrcweir 	css::uno::Reference< css::beans::XPropertyState > getXPropertyState() throw ( css::uno::RuntimeException );
58cdf0e10cSrcweir 	void initializeNumberFormats() throw ( css::script::BasicErrorException );
59cdf0e10cSrcweir 	void setNumberFormat( css::lang::Locale _aLocale, const rtl::OUString& _sFormatString) throw( css::script::BasicErrorException );
60cdf0e10cSrcweir 	SfxItemSet*  getCurrentDataSet( ) throw ( css::uno::RuntimeException );
61cdf0e10cSrcweir protected:
62cdf0e10cSrcweir 	virtual ScCellRangesBase* getCellRangesBase() throw ( css::uno::RuntimeException );
63cdf0e10cSrcweir public:
64cdf0e10cSrcweir 	ScVbaFormat( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext > & xContext, const css::uno::Reference< css::beans::XPropertySet >& _xPropertySet, const css::uno::Reference< css::frame::XModel >& xModel, bool bCheckAmbiguoity ) throw ( css::script::BasicErrorException );
~ScVbaFormat()65cdf0e10cSrcweir 	virtual ~ScVbaFormat() {}
66cdf0e10cSrcweir 	virtual css::uno::Reference< ov::XHelperInterface > thisHelperIface() = 0;
setAddIndent(const css::uno::Any & _BAddIndent)67cdf0e10cSrcweir 	 void SAL_CALL setAddIndent( const css::uno::Any& _BAddIndent) throw( css::uno::RuntimeException ) { _BAddIndent >>= mbAddIndent; }
getAddIndent()68cdf0e10cSrcweir 	 css::uno::Any SAL_CALL getAddIndent() throw( css::uno::RuntimeException ) { return css::uno::makeAny( mbAddIndent ); }
69cdf0e10cSrcweir     	// Interface Methods
70cdf0e10cSrcweir 	virtual css::uno::Any SAL_CALL Borders( const css::uno::Any& Index ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
71cdf0e10cSrcweir 	virtual css::uno::Reference< ::ooo::vba::excel::XFont > SAL_CALL Font(  ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
72cdf0e10cSrcweir 	virtual css::uno::Reference< ::ooo::vba::excel::XInterior > SAL_CALL Interior(  ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
73cdf0e10cSrcweir 	virtual void SAL_CALL setNumberFormat( const css::uno::Any& NumberFormat ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
74cdf0e10cSrcweir 	virtual css::uno::Any SAL_CALL getNumberFormat(  ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
75cdf0e10cSrcweir 	virtual void SAL_CALL setNumberFormatLocal( const css::uno::Any& NumberFormatLocal ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
76cdf0e10cSrcweir 	virtual css::uno::Any SAL_CALL getNumberFormatLocal(  ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
77cdf0e10cSrcweir 	virtual void SAL_CALL setIndentLevel( const css::uno::Any& IndentLevel ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
78cdf0e10cSrcweir 	virtual css::uno::Any SAL_CALL getIndentLevel(  ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
79cdf0e10cSrcweir 	virtual void SAL_CALL setHorizontalAlignment( const css::uno::Any& HorizontalAlignment ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
80cdf0e10cSrcweir 	virtual css::uno::Any SAL_CALL getHorizontalAlignment(  ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
81cdf0e10cSrcweir 	virtual void SAL_CALL setVerticalAlignment( const css::uno::Any& VerticalAlignment ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
82cdf0e10cSrcweir 	virtual css::uno::Any SAL_CALL getVerticalAlignment(  ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
83cdf0e10cSrcweir 	virtual void SAL_CALL setOrientation( const css::uno::Any& Orientation ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
84cdf0e10cSrcweir 	virtual css::uno::Any SAL_CALL getOrientation(  ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
85cdf0e10cSrcweir 	virtual void SAL_CALL setShrinkToFit( const css::uno::Any& ShrinkToFit ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
86cdf0e10cSrcweir 	virtual css::uno::Any SAL_CALL getShrinkToFit(  ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
87cdf0e10cSrcweir 	virtual void SAL_CALL setWrapText( const css::uno::Any& WrapText ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
88cdf0e10cSrcweir 	virtual css::uno::Any SAL_CALL getWrapText(  ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
89cdf0e10cSrcweir 	virtual void SAL_CALL setLocked( const css::uno::Any& Locked ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
90cdf0e10cSrcweir 	virtual css::uno::Any SAL_CALL getLocked(  ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
91cdf0e10cSrcweir 	virtual void SAL_CALL setFormulaHidden( const css::uno::Any& FormulaHidden ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
92cdf0e10cSrcweir 	virtual css::uno::Any SAL_CALL getFormulaHidden(  ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
93cdf0e10cSrcweir 	virtual void SAL_CALL setMergeCells( const css::uno::Any& MergeCells ) throw (css::script::BasicErrorException, css::uno::RuntimeException) = 0;
94cdf0e10cSrcweir 	virtual css::uno::Any SAL_CALL getMergeCells(  ) throw (css::script::BasicErrorException, css::uno::RuntimeException) = 0;
95cdf0e10cSrcweir 	virtual void SAL_CALL setReadingOrder( const css::uno::Any& ReadingOrder ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
96cdf0e10cSrcweir 	virtual css::uno::Any SAL_CALL getReadingOrder(  ) throw (css::script::BasicErrorException, css::uno::RuntimeException);
97cdf0e10cSrcweir 	// XHelperInterface
98cdf0e10cSrcweir 	virtual rtl::OUString& getServiceImplName();
99cdf0e10cSrcweir 	virtual css::uno::Sequence<rtl::OUString> getServiceNames();
100cdf0e10cSrcweir };
101cdf0e10cSrcweir 
102cdf0e10cSrcweir #endif
103