LibreOffice Module sc (master)  1
vbainterior.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 #ifndef INCLUDED_SC_SOURCE_UI_VBA_VBAINTERIOR_HXX
20 #define INCLUDED_SC_SOURCE_UI_VBA_VBAINTERIOR_HXX
21 
22 #include <ooo/vba/excel/XInterior.hpp>
23 #include <com/sun/star/uno/XComponentContext.hpp>
24 #include <com/sun/star/beans/XPropertySet.hpp>
25 #include <com/sun/star/container/XIndexAccess.hpp>
26 #include <com/sun/star/container/XNameContainer.hpp>
27 
29 
30 #include <tools/color.hxx>
31 
32 class ScDocument;
33 
35 
36 class ScVbaInterior final : public ScVbaInterior_BASE
37 {
38  css::uno::Reference< css::beans::XPropertySet > m_xProps;
41  sal_Int32 m_nPattern;
42 
43  css::uno::Reference< css::container::XIndexAccess > getPalette() const;
44  css::uno::Reference< css::container::XNameContainer > GetAttributeContainer();
45  static css::uno::Any SetAttributeData( sal_Int32 nValue );
46  static sal_Int32 GetAttributeData( css::uno::Any const & aValue );
48  static Color GetPatternColor( const Color& rPattColor, const Color& rBackColor, sal_uInt32 nXclPattern );
49  static Color GetMixedColor( const Color& rFore, const Color& rBack, sal_uInt8 nTrans );
50  static sal_uInt8 GetMixedColorComp( sal_uInt8 nFore, sal_uInt8 nBack, sal_uInt8 nTrans );
51  css::uno::Any GetIndexColor( sal_Int32 nColorIndex );
52  sal_Int32 GetColorIndex( const sal_Int32 nColor );
53  css::uno::Any GetUserDefinedAttributes( const OUString& sName );
54  void SetUserDefinedAttributes( const OUString& sName, const css::uno::Any& aValue );
55  void SetMixedColor();
56 
57 public:
59  ScVbaInterior( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext,
60  const css::uno::Reference< css::beans::XPropertySet >& xProps, ScDocument* pScDoc = nullptr);
61 
62  virtual css::uno::Any SAL_CALL getColor() override ;
63  virtual void SAL_CALL setColor( const css::uno::Any& _color ) override ;
64 
65  virtual css::uno::Any SAL_CALL getColorIndex() override;
66  virtual void SAL_CALL setColorIndex( const css::uno::Any& _colorindex ) override;
67  virtual css::uno::Any SAL_CALL getPattern() override;
68  virtual void SAL_CALL setPattern( const css::uno::Any& _pattern ) override;
69  virtual css::uno::Any SAL_CALL getPatternColor() override;
70  virtual void SAL_CALL setPatternColor( const css::uno::Any& _patterncolor ) override;
71  virtual css::uno::Any SAL_CALL getPatternColorIndex() override;
72  virtual void SAL_CALL setPatternColorIndex( const css::uno::Any& _patterncolorindex ) override;
73  css::uno::Any SAL_CALL getThemeColor() override;
74  void SAL_CALL setThemeColor(const css::uno::Any& rAny) override;
75  css::uno::Any SAL_CALL getTintAndShade() override;
76  void SAL_CALL setTintAndShade(const css::uno::Any& rAny) override;
77  css::uno::Any SAL_CALL getPatternTintAndShade() override;
78  void SAL_CALL setPatternTintAndShade(const css::uno::Any& rAny) override;
79  //XHelperInterface
80  virtual OUString getServiceImplName() override;
81  virtual css::uno::Sequence<OUString> getServiceNames() override;
82 };
83 #endif
84 
85 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static sal_Int32 GetAttributeData(css::uno::Any const &aValue)
css::uno::Any GetUserDefinedAttributes(const OUString &sName)
virtual css::uno::Any SAL_CALL getColorIndex() override
static Color GetMixedColor(const Color &rFore, const Color &rBack, sal_uInt8 nTrans)
virtual OUString getServiceImplName() override
ScDocument * m_pScDoc
Definition: vbainterior.hxx:39
virtual void SAL_CALL setPatternColorIndex(const css::uno::Any &_patterncolorindex) override
css::uno::Reference< css::beans::XPropertySet > m_xProps
Definition: vbainterior.hxx:38
virtual css::uno::Sequence< OUString > getServiceNames() override
css::uno::Any SAL_CALL getTintAndShade() override
virtual void SAL_CALL setPatternColor(const css::uno::Any &_patterncolor) override
css::uno::Any SAL_CALL getPatternTintAndShade() override
void SAL_CALL setTintAndShade(const css::uno::Any &rAny) override
void SAL_CALL setPatternTintAndShade(const css::uno::Any &rAny) override
virtual void SAL_CALL setColorIndex(const css::uno::Any &_colorindex) override
css::uno::Reference< css::container::XIndexAccess > getPalette() const
static css::uno::Any SetAttributeData(sal_Int32 nValue)
void SetUserDefinedAttributes(const OUString &sName, const css::uno::Any &aValue)
void SAL_CALL setThemeColor(const css::uno::Any &rAny) override
css::uno::Any GetIndexColor(sal_Int32 nColorIndex)
Color m_aPattColor
Definition: vbainterior.hxx:40
virtual css::uno::Any SAL_CALL getPatternColorIndex() override
virtual css::uno::Any SAL_CALL getColor() override
Definition: vbainterior.cxx:74
css::uno::Reference< css::container::XNameContainer > GetAttributeContainer()
virtual css::uno::Any SAL_CALL getPattern() override
ScVbaInterior(const css::uno::Reference< ov::XHelperInterface > &xParent, const css::uno::Reference< css::uno::XComponentContext > &xContext, const css::uno::Reference< css::beans::XPropertySet > &xProps, ScDocument *pScDoc=nullptr)
Definition: vbainterior.cxx:64
unsigned char sal_uInt8
static Color GetPatternColor(const Color &rPattColor, const Color &rBackColor, sal_uInt32 nXclPattern)
virtual void SAL_CALL setColor(const css::uno::Any &_color) override
Definition: vbainterior.cxx:80
virtual void SAL_CALL setPattern(const css::uno::Any &_pattern) override
virtual css::uno::Any SAL_CALL getPatternColor() override
Color GetBackColor()
static sal_uInt8 GetMixedColorComp(sal_uInt8 nFore, sal_uInt8 nBack, sal_uInt8 nTrans)
sal_Int32 GetColorIndex(const sal_Int32 nColor)
sal_Int32 m_nPattern
Definition: vbainterior.hxx:41
css::uno::Any SAL_CALL getThemeColor() override
InheritedHelperInterfaceWeakImpl< ov::excel::XInterior > ScVbaInterior_BASE
Definition: vbainterior.hxx:32
void SetMixedColor()
Definition: vbainterior.cxx:91