1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
21 #include <ooo/vba/excel/XInterior.hpp>
22 #include <com/sun/star/uno/XComponentContext.hpp>
23 #include <com/sun/star/beans/XPropertySet.hpp>
24 #include <com/sun/star/container/XIndexAccess.hpp>
25 #include <com/sun/star/container/XNameContainer.hpp>
27 #include <vbahelper/vbahelperinterface.hxx>
29 #include <tools/color.hxx>
33 typedef InheritedHelperInterfaceWeakImpl
< ov::excel::XInterior
> ScVbaInterior_BASE
;
35 class ScVbaInterior final
: public ScVbaInterior_BASE
37 css::uno::Reference
< css::beans::XPropertySet
> m_xProps
;
42 css::uno::Reference
< css::container::XIndexAccess
> getPalette() const;
43 css::uno::Reference
< css::container::XNameContainer
> GetAttributeContainer();
44 static css::uno::Any
SetAttributeData( sal_Int32 nValue
);
45 static sal_Int32
GetAttributeData( css::uno::Any
const & aValue
);
47 static Color
GetPatternColor( const Color
& rPattColor
, const Color
& rBackColor
, sal_uInt32 nXclPattern
);
48 static Color
GetMixedColor( const Color
& rFore
, const Color
& rBack
, sal_uInt8 nTrans
);
49 static sal_uInt8
GetMixedColorComp( sal_uInt8 nFore
, sal_uInt8 nBack
, sal_uInt8 nTrans
);
50 css::uno::Any
GetIndexColor( sal_Int32 nColorIndex
);
51 sal_Int32
GetColorIndex( const sal_Int32 nColor
);
52 css::uno::Any
GetUserDefinedAttributes( const OUString
& sName
);
53 void SetUserDefinedAttributes( const OUString
& sName
, const css::uno::Any
& aValue
);
57 /// @throws css::lang::IllegalArgumentException
58 ScVbaInterior( const css::uno::Reference
< ov::XHelperInterface
>& xParent
, const css::uno::Reference
< css::uno::XComponentContext
>& xContext
,
59 css::uno::Reference
< css::beans::XPropertySet
> xProps
, ScDocument
* pScDoc
= nullptr);
61 virtual css::uno::Any SAL_CALL
getColor() override
;
62 virtual void SAL_CALL
setColor( const css::uno::Any
& _color
) override
;
64 virtual css::uno::Any SAL_CALL
getColorIndex() override
;
65 virtual void SAL_CALL
setColorIndex( const css::uno::Any
& _colorindex
) override
;
66 virtual css::uno::Any SAL_CALL
getPattern() override
;
67 virtual void SAL_CALL
setPattern( const css::uno::Any
& _pattern
) override
;
68 virtual css::uno::Any SAL_CALL
getPatternColor() override
;
69 virtual void SAL_CALL
setPatternColor( const css::uno::Any
& _patterncolor
) override
;
70 virtual css::uno::Any SAL_CALL
getPatternColorIndex() override
;
71 virtual void SAL_CALL
setPatternColorIndex( const css::uno::Any
& _patterncolorindex
) override
;
72 css::uno::Any SAL_CALL
getThemeColor() override
;
73 void SAL_CALL
setThemeColor(const css::uno::Any
& rAny
) override
;
74 css::uno::Any SAL_CALL
getTintAndShade() override
;
75 void SAL_CALL
setTintAndShade(const css::uno::Any
& rAny
) override
;
76 css::uno::Any SAL_CALL
getPatternTintAndShade() override
;
77 void SAL_CALL
setPatternTintAndShade(const css::uno::Any
& rAny
) override
;
79 virtual OUString
getServiceImplName() override
;
80 virtual css::uno::Sequence
<OUString
> getServiceNames() override
;
83 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */