xref: /aoo42x/main/sc/source/ui/vba/vbainterior.hxx (revision 38d50f7b)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef SC_VBA_INTERIOR_HXX
24 #define SC_VBA_INTERIOR_HXX
25 
26 #include <ooo/vba/excel/XInterior.hpp>
27 #include <com/sun/star/uno/XComponentContext.hpp>
28 #include <com/sun/star/beans/XPropertySet.hpp>
29 #include <com/sun/star/container/XIndexAccess.hpp>
30 #include <com/sun/star/container/XNameContainer.hpp>
31 
32 #include <com/sun/star/script/XInvocation.hpp>
33 #include <vbahelper/vbahelperinterface.hxx>
34 
35 #include <tools/color.hxx>
36 
37 class ScDocument;
38 
39 typedef InheritedHelperInterfaceImpl1< ov::excel::XInterior > ScVbaInterior_BASE;
40 
41 class ScVbaInterior :  public ScVbaInterior_BASE
42 {
43 	css::uno::Reference< css::beans::XPropertySet > m_xProps;
44 	ScDocument* m_pScDoc;
45     Color m_aPattColor;
46     sal_Int32 m_nPattern;
47 
48         css::uno::Reference< css::container::XIndexAccess > getPalette();
49     css::uno::Reference< css::container::XNameContainer > GetAttributeContainer();
50     css::uno::Any SetAttributeData( sal_Int32 nValue );
51     sal_Int32 GetAttributeData( css::uno::Any aValue );
52     Color GetBackColor();
53 protected:
54     Color GetPatternColor( const Color& rPattColor, const Color& rBackColor, sal_uInt32 nXclPattern );
55     Color GetMixedColor( const Color& rFore, const Color& rBack, sal_uInt8 nTrans );
56     sal_uInt8 GetMixedColorComp( sal_uInt8 nFore, sal_uInt8 nBack, sal_uInt8 nTrans );
57     css::uno::Any GetIndexColor( const sal_Int32& nColorIndex );
58     sal_Int32 GetColorIndex( const sal_Int32 nColor );
59     css::uno::Any GetUserDefinedAttributes( const rtl::OUString& sName );
60     void SetUserDefinedAttributes( const rtl::OUString& sName, const css::uno::Any& aValue );
61     void SetMixedColor();
62 public:
63         ScVbaInterior( const css::uno::Reference< ov::XHelperInterface >& xParent,  const css::uno::Reference< css::uno::XComponentContext >& xContext,
64                  const css::uno::Reference< css::beans::XPropertySet >& xProps, ScDocument* pScDoc = NULL) throw ( css::lang::IllegalArgumentException);
65 
~ScVbaInterior()66         virtual ~ScVbaInterior(){}
67 
68 	virtual css::uno::Any SAL_CALL getColor() throw (css::uno::RuntimeException) ;
69 	virtual void SAL_CALL setColor( const css::uno::Any& _color ) throw (css::uno::RuntimeException) ;
70 
71 	virtual css::uno::Any SAL_CALL getColorIndex() throw ( css::uno::RuntimeException);
72 	virtual void SAL_CALL setColorIndex( const css::uno::Any& _colorindex ) throw ( css::uno::RuntimeException );
73     virtual css::uno::Any SAL_CALL getPattern() throw (css::uno::RuntimeException);
74     virtual void SAL_CALL setPattern( const css::uno::Any& _pattern ) throw (css::uno::RuntimeException);
75     virtual css::uno::Any SAL_CALL getPatternColor() throw (css::uno::RuntimeException);
76     virtual void SAL_CALL setPatternColor( const css::uno::Any& _patterncolor ) throw (css::uno::RuntimeException);
77     virtual css::uno::Any SAL_CALL getPatternColorIndex() throw (css::uno::RuntimeException);
78     virtual void SAL_CALL setPatternColorIndex( const css::uno::Any& _patterncolorindex ) throw (css::uno::RuntimeException);
79 	//XHelperInterface
80 	virtual rtl::OUString& getServiceImplName();
81 	virtual css::uno::Sequence<rtl::OUString> getServiceNames();
82 };
83 #endif
84 
85