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