merged tag ooo/OOO330_m14
[LibreOffice.git] / chart2 / source / inc / ConfigColorScheme.hxx
blob56d13f8971c1dbeacc684111041c43e16b2bd0b1
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
27 #ifndef CHART2_CONFIG_COLOR_SCHEME_HXX
28 #define CHART2_CONFIG_COLOR_SCHEME_HXX
30 #include "ServiceMacros.hxx"
31 #include "ConfigItemListener.hxx"
32 #include "charttoolsdllapi.hxx"
33 #include <cppuhelper/implbase2.hxx>
34 #include <comphelper/uno3.hxx>
35 #include <com/sun/star/chart2/XColorScheme.hpp>
36 #include <com/sun/star/lang/XServiceInfo.hpp>
37 #include <com/sun/star/uno/XComponentContext.hpp>
39 #include <memory>
42 namespace chart
45 OOO_DLLPUBLIC_CHARTTOOLS ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XColorScheme > createConfigColorScheme(
46 const ::com::sun::star::uno::Reference<
47 ::com::sun::star::uno::XComponentContext > & xContext );
49 namespace impl
51 class ChartConfigItem;
54 class ConfigColorScheme :
55 public ConfigItemListener,
56 public ::cppu::WeakImplHelper2<
57 ::com::sun::star::chart2::XColorScheme,
58 ::com::sun::star::lang::XServiceInfo >
60 public:
61 explicit ConfigColorScheme(
62 const ::com::sun::star::uno::Reference<
63 ::com::sun::star::uno::XComponentContext > & xContext );
64 SAL_DLLPRIVATE virtual ~ConfigColorScheme();
66 /// establish methods for factory instatiation
67 APPHELPER_SERVICE_FACTORY_HELPER( ConfigColorScheme )
68 /// declare XServiceInfo methods
69 APPHELPER_XSERVICEINFO_DECL()
71 protected:
72 // ____ XColorScheme ____
73 SAL_DLLPRIVATE virtual ::sal_Int32 SAL_CALL getColorByIndex( ::sal_Int32 nIndex )
74 throw (::com::sun::star::uno::RuntimeException);
76 // ____ ConfigItemListener ____
77 SAL_DLLPRIVATE virtual void notify( const ::rtl::OUString & rPropertyName );
79 private:
80 SAL_DLLPRIVATE void retrieveConfigColors();
82 // member variables
83 ::com::sun::star::uno::Reference<
84 ::com::sun::star::uno::XComponentContext > m_xContext;
85 ::std::auto_ptr< impl::ChartConfigItem > m_apChartConfigItem;
86 mutable ::com::sun::star::uno::Sequence< sal_Int64 > m_aColorSequence;
87 mutable sal_Int32 m_nNumberOfColors;
88 bool m_bNeedsUpdate;
91 } // namespace chart
93 // CHART2_CONFIG_COLOR_SCHEME_HXX
94 #endif