2010-10-27 12:43:08 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-06-21 14:30:25 +01:00
|
|
|
/*
|
|
|
|
* This file is part of the LibreOffice project.
|
|
|
|
*
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
*
|
|
|
|
* This file incorporates work covered by the following license notice:
|
|
|
|
*
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed
|
|
|
|
* with this work for additional information regarding copyright
|
|
|
|
* ownership. The ASF licenses this file to you under the Apache
|
|
|
|
* License, Version 2.0 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
|
|
|
*/
|
2013-10-23 22:48:59 +02:00
|
|
|
#ifndef INCLUDED_CHART2_SOURCE_INC_CONFIGCOLORSCHEME_HXX
|
|
|
|
#define INCLUDED_CHART2_SOURCE_INC_CONFIGCOLORSCHEME_HXX
|
2007-05-22 17:14:05 +00:00
|
|
|
|
2008-12-30 13:32:01 +00:00
|
|
|
#include "charttoolsdllapi.hxx"
|
2015-07-10 16:29:31 +09:00
|
|
|
#include <cppuhelper/implbase.hxx>
|
2007-05-22 17:14:05 +00:00
|
|
|
#include <comphelper/uno3.hxx>
|
|
|
|
#include <com/sun/star/chart2/XColorScheme.hpp>
|
|
|
|
#include <com/sun/star/lang/XServiceInfo.hpp>
|
|
|
|
#include <com/sun/star/uno/XComponentContext.hpp>
|
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
namespace chart
|
|
|
|
{
|
2009-06-04 09:41:18 +00:00
|
|
|
|
|
|
|
OOO_DLLPUBLIC_CHARTTOOLS ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XColorScheme > createConfigColorScheme(
|
|
|
|
const ::com::sun::star::uno::Reference<
|
|
|
|
::com::sun::star::uno::XComponentContext > & xContext );
|
|
|
|
|
2007-05-22 17:14:05 +00:00
|
|
|
namespace impl
|
|
|
|
{
|
|
|
|
class ChartConfigItem;
|
|
|
|
}
|
|
|
|
|
2009-06-04 09:41:18 +00:00
|
|
|
class ConfigColorScheme :
|
2015-07-10 16:29:31 +09:00
|
|
|
public ::cppu::WeakImplHelper<
|
2007-05-22 17:14:05 +00:00
|
|
|
::com::sun::star::chart2::XColorScheme,
|
|
|
|
::com::sun::star::lang::XServiceInfo >
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
explicit ConfigColorScheme(
|
|
|
|
const ::com::sun::star::uno::Reference<
|
|
|
|
::com::sun::star::uno::XComponentContext > & xContext );
|
2009-06-04 09:41:18 +00:00
|
|
|
SAL_DLLPRIVATE virtual ~ConfigColorScheme();
|
2007-05-22 17:14:05 +00:00
|
|
|
|
|
|
|
/// declare XServiceInfo methods
|
2014-12-09 08:30:11 +02:00
|
|
|
virtual OUString SAL_CALL getImplementationName()
|
2015-10-12 16:04:04 +02:00
|
|
|
throw( css::uno::RuntimeException, std::exception ) override;
|
2014-12-09 08:30:11 +02:00
|
|
|
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName )
|
2015-10-12 16:04:04 +02:00
|
|
|
throw( css::uno::RuntimeException, std::exception ) override;
|
2014-12-09 08:30:11 +02:00
|
|
|
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
|
2015-10-12 16:04:04 +02:00
|
|
|
throw( css::uno::RuntimeException, std::exception ) override;
|
2014-12-09 08:30:11 +02:00
|
|
|
|
|
|
|
static OUString getImplementationName_Static();
|
|
|
|
static css::uno::Sequence< OUString > getSupportedServiceNames_Static();
|
2007-05-22 17:14:05 +00:00
|
|
|
|
2015-10-06 11:48:40 +02:00
|
|
|
// ____ ConfigItemListener ____
|
|
|
|
SAL_DLLPRIVATE void notify( const OUString & rPropertyName );
|
|
|
|
|
2007-05-22 17:14:05 +00:00
|
|
|
protected:
|
|
|
|
// ____ XColorScheme ____
|
2009-06-04 09:41:18 +00:00
|
|
|
SAL_DLLPRIVATE virtual ::sal_Int32 SAL_CALL getColorByIndex( ::sal_Int32 nIndex )
|
2015-10-12 16:04:04 +02:00
|
|
|
throw (::com::sun::star::uno::RuntimeException, std::exception) override;
|
2007-05-22 17:14:05 +00:00
|
|
|
|
|
|
|
private:
|
2009-06-04 09:41:18 +00:00
|
|
|
SAL_DLLPRIVATE void retrieveConfigColors();
|
2007-05-22 17:14:05 +00:00
|
|
|
|
|
|
|
// member variables
|
|
|
|
::com::sun::star::uno::Reference<
|
|
|
|
::com::sun::star::uno::XComponentContext > m_xContext;
|
2014-09-30 08:20:36 +02:00
|
|
|
::std::unique_ptr< impl::ChartConfigItem > m_apChartConfigItem;
|
2007-05-22 17:14:05 +00:00
|
|
|
mutable ::com::sun::star::uno::Sequence< sal_Int64 > m_aColorSequence;
|
|
|
|
mutable sal_Int32 m_nNumberOfColors;
|
|
|
|
bool m_bNeedsUpdate;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace chart
|
|
|
|
|
2013-10-23 22:48:59 +02:00
|
|
|
// INCLUDED_CHART2_SOURCE_INC_CONFIGCOLORSCHEME_HXX
|
2007-05-22 17:14:05 +00:00
|
|
|
#endif
|
2010-10-27 12:43:08 +01:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|