xref: /aoo42x/main/sc/source/ui/vba/vbainterior.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_INTERIOR_HXX
24cdf0e10cSrcweir #define SC_VBA_INTERIOR_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include <ooo/vba/excel/XInterior.hpp>
27cdf0e10cSrcweir #include <com/sun/star/uno/XComponentContext.hpp>
28cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp>
29cdf0e10cSrcweir #include <com/sun/star/container/XIndexAccess.hpp>
30cdf0e10cSrcweir #include <com/sun/star/container/XNameContainer.hpp>
31cdf0e10cSrcweir 
32cdf0e10cSrcweir #include <com/sun/star/script/XInvocation.hpp>
33cdf0e10cSrcweir #include <vbahelper/vbahelperinterface.hxx>
34cdf0e10cSrcweir 
35cdf0e10cSrcweir #include <tools/color.hxx>
36cdf0e10cSrcweir 
37cdf0e10cSrcweir class ScDocument;
38cdf0e10cSrcweir 
39cdf0e10cSrcweir typedef InheritedHelperInterfaceImpl1< ov::excel::XInterior > ScVbaInterior_BASE;
40cdf0e10cSrcweir 
41cdf0e10cSrcweir class ScVbaInterior :  public ScVbaInterior_BASE
42cdf0e10cSrcweir {
43cdf0e10cSrcweir 	css::uno::Reference< css::beans::XPropertySet > m_xProps;
44cdf0e10cSrcweir 	ScDocument* m_pScDoc;
45cdf0e10cSrcweir     Color m_aPattColor;
46cdf0e10cSrcweir     sal_Int32 m_nPattern;
47cdf0e10cSrcweir 
48cdf0e10cSrcweir         css::uno::Reference< css::container::XIndexAccess > getPalette();
49cdf0e10cSrcweir     css::uno::Reference< css::container::XNameContainer > GetAttributeContainer();
50cdf0e10cSrcweir     css::uno::Any SetAttributeData( sal_Int32 nValue );
51cdf0e10cSrcweir     sal_Int32 GetAttributeData( css::uno::Any aValue );
52cdf0e10cSrcweir     Color GetBackColor();
53cdf0e10cSrcweir protected:
54cdf0e10cSrcweir     Color GetPatternColor( const Color& rPattColor, const Color& rBackColor, sal_uInt32 nXclPattern );
55cdf0e10cSrcweir     Color GetMixedColor( const Color& rFore, const Color& rBack, sal_uInt8 nTrans );
56cdf0e10cSrcweir     sal_uInt8 GetMixedColorComp( sal_uInt8 nFore, sal_uInt8 nBack, sal_uInt8 nTrans );
57cdf0e10cSrcweir     css::uno::Any GetIndexColor( const sal_Int32& nColorIndex );
58cdf0e10cSrcweir     sal_Int32 GetColorIndex( const sal_Int32 nColor );
59cdf0e10cSrcweir     css::uno::Any GetUserDefinedAttributes( const rtl::OUString& sName );
60cdf0e10cSrcweir     void SetUserDefinedAttributes( const rtl::OUString& sName, const css::uno::Any& aValue );
61cdf0e10cSrcweir     void SetMixedColor();
62cdf0e10cSrcweir public:
63cdf0e10cSrcweir         ScVbaInterior( const css::uno::Reference< ov::XHelperInterface >& xParent,  const css::uno::Reference< css::uno::XComponentContext >& xContext,
64cdf0e10cSrcweir                  const css::uno::Reference< css::beans::XPropertySet >& xProps, ScDocument* pScDoc = NULL) throw ( css::lang::IllegalArgumentException);
65cdf0e10cSrcweir 
~ScVbaInterior()66cdf0e10cSrcweir         virtual ~ScVbaInterior(){}
67cdf0e10cSrcweir 
68cdf0e10cSrcweir 	virtual css::uno::Any SAL_CALL getColor() throw (css::uno::RuntimeException) ;
69cdf0e10cSrcweir 	virtual void SAL_CALL setColor( const css::uno::Any& _color ) throw (css::uno::RuntimeException) ;
70cdf0e10cSrcweir 
71cdf0e10cSrcweir 	virtual css::uno::Any SAL_CALL getColorIndex() throw ( css::uno::RuntimeException);
72cdf0e10cSrcweir 	virtual void SAL_CALL setColorIndex( const css::uno::Any& _colorindex ) throw ( css::uno::RuntimeException );
73cdf0e10cSrcweir     virtual css::uno::Any SAL_CALL getPattern() throw (css::uno::RuntimeException);
74cdf0e10cSrcweir     virtual void SAL_CALL setPattern( const css::uno::Any& _pattern ) throw (css::uno::RuntimeException);
75cdf0e10cSrcweir     virtual css::uno::Any SAL_CALL getPatternColor() throw (css::uno::RuntimeException);
76cdf0e10cSrcweir     virtual void SAL_CALL setPatternColor( const css::uno::Any& _patterncolor ) throw (css::uno::RuntimeException);
77cdf0e10cSrcweir     virtual css::uno::Any SAL_CALL getPatternColorIndex() throw (css::uno::RuntimeException);
78cdf0e10cSrcweir     virtual void SAL_CALL setPatternColorIndex( const css::uno::Any& _patterncolorindex ) throw (css::uno::RuntimeException);
79cdf0e10cSrcweir 	//XHelperInterface
80cdf0e10cSrcweir 	virtual rtl::OUString& getServiceImplName();
81cdf0e10cSrcweir 	virtual css::uno::Sequence<rtl::OUString> getServiceNames();
82cdf0e10cSrcweir };
83cdf0e10cSrcweir #endif
84cdf0e10cSrcweir 
85