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_VBAHELPER_SOURCE_VBAHELPER_VBAFILLFORMAT_HXX
20 #define INCLUDED_VBAHELPER_SOURCE_VBAHELPER_VBAFILLFORMAT_HXX
21 
22 #include <com/sun/star/drawing/XShape.hpp>
23 #include <com/sun/star/drawing/FillStyle.hpp>
24 #include <ooo/vba/msforms/XFillFormat.hpp>
25 #include <vbahelper/vbahelperinterface.hxx>
26 
27 typedef InheritedHelperInterfaceWeakImpl< ov::msforms::XFillFormat > ScVbaFillFormat_BASE;
28 
29 class ScVbaFillFormat : public ScVbaFillFormat_BASE
30 {
31 private:
32     css::uno::Reference< css::drawing::XShape > m_xShape;
33     css::uno::Reference< css::beans::XPropertySet > m_xPropertySet;
34     css::uno::Reference< ov::msforms::XColorFormat > m_xColorFormat;
35     css::drawing::FillStyle m_nFillStyle;
36     sal_Int32 m_nForeColor;
37     sal_Int16 m_nGradientAngle;
38 private:
39     /// @throws css::uno::RuntimeException
40     void setFillStyle( css::drawing::FillStyle nFillStyle );
41 protected:
42     virtual OUString getServiceImplName() override;
43     virtual css::uno::Sequence<OUString> getServiceNames() override;
44 
45 public:
46     ScVbaFillFormat( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::drawing::XShape >& xShape );
47 
48     /// @throws css::uno::RuntimeException
49     void setForeColorAndInternalStyle( sal_Int32 nForeColor );
50     // Attributes
51     virtual sal_Bool SAL_CALL getVisible() override;
52     virtual void SAL_CALL setVisible( sal_Bool _visible ) override;
53     virtual double SAL_CALL getTransparency() override;
54     virtual void SAL_CALL setTransparency( double _transparency ) override;
55 
56     // Methods
57     virtual void SAL_CALL Solid() override;
58     virtual void SAL_CALL TwoColorGradient( sal_Int32 style, sal_Int32 variant ) override;
59     virtual css::uno::Reference< ov::msforms::XColorFormat > SAL_CALL BackColor() override;
60     virtual css::uno::Reference< ov::msforms::XColorFormat > SAL_CALL ForeColor() override;
61 
62 };
63 
64 #endif // INCLUDED_VBAHELPER_SOURCE_VBAHELPER_VBAFILLFORMAT_HXX
65 
66 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
67