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 .
|
|
|
|
*/
|
2003-12-18 12:50:56 +00:00
|
|
|
#ifndef CHART_CHARTDATAWRAPPER_HXX
|
|
|
|
#define CHART_CHARTDATAWRAPPER_HXX
|
|
|
|
|
|
|
|
#include "ServiceMacros.hxx"
|
2007-05-22 16:17:06 +00:00
|
|
|
#include "MutexContainer.hxx"
|
2010-11-30 01:45:03 +01:00
|
|
|
#include <cppuhelper/implbase5.hxx>
|
2003-12-18 12:50:56 +00:00
|
|
|
#include <cppuhelper/interfacecontainer.hxx>
|
2010-11-30 01:45:03 +01:00
|
|
|
#include <com/sun/star/chart2/XAnyDescriptionAccess.hpp>
|
|
|
|
#include <com/sun/star/chart/XDateCategories.hpp>
|
2003-12-18 12:50:56 +00:00
|
|
|
#include <com/sun/star/lang/XComponent.hpp>
|
|
|
|
#include <com/sun/star/lang/XServiceInfo.hpp>
|
2004-01-26 08:13:31 +00:00
|
|
|
#include <com/sun/star/chart2/XChartDocument.hpp>
|
2003-12-18 12:50:56 +00:00
|
|
|
#include <com/sun/star/uno/XComponentContext.hpp>
|
|
|
|
|
2007-05-22 16:17:06 +00:00
|
|
|
#include <boost/shared_ptr.hpp>
|
|
|
|
|
2003-12-18 12:50:56 +00:00
|
|
|
namespace chart
|
|
|
|
{
|
|
|
|
namespace wrapper
|
|
|
|
{
|
|
|
|
|
2007-05-22 16:17:06 +00:00
|
|
|
class Chart2ModelContact;
|
2010-01-13 17:06:34 +01:00
|
|
|
struct lcl_Operator;
|
2007-05-22 16:17:06 +00:00
|
|
|
|
|
|
|
class ChartDataWrapper : public MutexContainer, public
|
2010-11-30 01:45:03 +01:00
|
|
|
::cppu::WeakImplHelper5<
|
|
|
|
com::sun::star::chart2::XAnyDescriptionAccess,
|
|
|
|
com::sun::star::chart::XDateCategories,
|
2003-12-18 12:50:56 +00:00
|
|
|
com::sun::star::lang::XServiceInfo,
|
2007-05-22 16:17:06 +00:00
|
|
|
com::sun::star::lang::XEventListener,
|
|
|
|
com::sun::star::lang::XComponent >
|
2003-12-18 12:50:56 +00:00
|
|
|
{
|
|
|
|
public:
|
2007-05-22 16:17:06 +00:00
|
|
|
ChartDataWrapper( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact );
|
2010-01-13 17:06:34 +01:00
|
|
|
ChartDataWrapper( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact
|
|
|
|
, const ::com::sun::star::uno::Reference< ::com::sun::star::chart::XChartData >& xNewData );
|
2003-12-18 12:50:56 +00:00
|
|
|
virtual ~ChartDataWrapper();
|
|
|
|
|
|
|
|
/// XServiceInfo declarations
|
|
|
|
APPHELPER_XSERVICEINFO_DECL()
|
|
|
|
|
|
|
|
protected:
|
2010-11-30 01:45:03 +01:00
|
|
|
// ____ XDateCategories ____
|
|
|
|
virtual ::com::sun::star::uno::Sequence< double > SAL_CALL getDateCategories() throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual void SAL_CALL setDateCategories( const ::com::sun::star::uno::Sequence< double >& rDates ) throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
|
|
|
|
// ____ XAnyDescriptionAccess ____
|
|
|
|
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > > SAL_CALL
|
|
|
|
getAnyRowDescriptions() throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual void SAL_CALL setAnyRowDescriptions(
|
|
|
|
const ::com::sun::star::uno::Sequence<
|
|
|
|
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >& aRowDescriptions )
|
|
|
|
throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > > SAL_CALL
|
|
|
|
getAnyColumnDescriptions() throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual void SAL_CALL setAnyColumnDescriptions(
|
|
|
|
const ::com::sun::star::uno::Sequence<
|
|
|
|
::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > >& aColumnDescriptions )
|
|
|
|
throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
|
|
|
|
// ____ XComplexDescriptionAccess (base of XAnyDescriptionAccess) ____
|
2010-01-13 17:06:34 +01:00
|
|
|
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::rtl::OUString > > SAL_CALL
|
|
|
|
getComplexRowDescriptions() throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual void SAL_CALL setComplexRowDescriptions(
|
|
|
|
const ::com::sun::star::uno::Sequence<
|
|
|
|
::com::sun::star::uno::Sequence< ::rtl::OUString > >& aRowDescriptions )
|
|
|
|
throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Sequence< ::rtl::OUString > > SAL_CALL
|
|
|
|
getComplexColumnDescriptions() throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual void SAL_CALL setComplexColumnDescriptions(
|
|
|
|
const ::com::sun::star::uno::Sequence<
|
|
|
|
::com::sun::star::uno::Sequence< ::rtl::OUString > >& aColumnDescriptions )
|
|
|
|
throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
|
|
|
|
// ____ XChartDataArray (base of XComplexDescriptionAccess) ____
|
2003-12-18 12:50:56 +00:00
|
|
|
virtual ::com::sun::star::uno::Sequence<
|
|
|
|
::com::sun::star::uno::Sequence<
|
|
|
|
double > > SAL_CALL getData()
|
|
|
|
throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual void SAL_CALL setData( const ::com::sun::star::uno::Sequence<
|
|
|
|
::com::sun::star::uno::Sequence<
|
|
|
|
double > >& aData )
|
|
|
|
throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual ::com::sun::star::uno::Sequence<
|
|
|
|
::rtl::OUString > SAL_CALL getRowDescriptions()
|
|
|
|
throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual void SAL_CALL setRowDescriptions( const ::com::sun::star::uno::Sequence<
|
|
|
|
::rtl::OUString >& aRowDescriptions )
|
|
|
|
throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual ::com::sun::star::uno::Sequence<
|
|
|
|
::rtl::OUString > SAL_CALL getColumnDescriptions()
|
|
|
|
throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual void SAL_CALL setColumnDescriptions( const ::com::sun::star::uno::Sequence<
|
|
|
|
::rtl::OUString >& aColumnDescriptions )
|
|
|
|
throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
|
|
|
|
// ____ XChartData (base of XChartDataArray) ____
|
|
|
|
virtual void SAL_CALL addChartDataChangeEventListener( const ::com::sun::star::uno::Reference<
|
|
|
|
::com::sun::star::chart::XChartDataChangeEventListener >& aListener )
|
|
|
|
throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual void SAL_CALL removeChartDataChangeEventListener( const ::com::sun::star::uno::Reference<
|
|
|
|
::com::sun::star::chart::XChartDataChangeEventListener >& aListener )
|
|
|
|
throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual double SAL_CALL getNotANumber()
|
|
|
|
throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual sal_Bool SAL_CALL isNotANumber( double nNumber )
|
|
|
|
throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
|
2007-05-22 16:17:06 +00:00
|
|
|
// ____ XComponent ____
|
|
|
|
virtual void SAL_CALL dispose()
|
|
|
|
throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference<
|
|
|
|
::com::sun::star::lang::XEventListener >& xListener )
|
|
|
|
throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference<
|
|
|
|
::com::sun::star::lang::XEventListener >& aListener )
|
|
|
|
throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
|
2003-12-18 12:50:56 +00:00
|
|
|
// ____ XEventListener ____
|
|
|
|
virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source )
|
|
|
|
throw (::com::sun::star::uno::RuntimeException);
|
|
|
|
|
|
|
|
|
|
|
|
void fireChartDataChangeEvent( ::com::sun::star::chart::ChartDataChangeEvent& aEvent );
|
|
|
|
|
2010-01-13 17:06:34 +01:00
|
|
|
private: //methods
|
|
|
|
void switchToInternalDataProvider();
|
|
|
|
void initDataAccess();
|
|
|
|
void applyData( lcl_Operator& rDataOperator );
|
2003-12-18 12:50:56 +00:00
|
|
|
|
2010-01-13 17:06:34 +01:00
|
|
|
private: //member
|
|
|
|
::com::sun::star::uno::Reference<
|
2010-11-30 01:45:03 +01:00
|
|
|
::com::sun::star::chart2::XAnyDescriptionAccess > m_xDataAccess;
|
2003-12-18 12:50:56 +00:00
|
|
|
|
2010-01-13 17:06:34 +01:00
|
|
|
::boost::shared_ptr< Chart2ModelContact > m_spChart2ModelContact;
|
|
|
|
::cppu::OInterfaceContainerHelper m_aEventListenerContainer;
|
2003-12-18 12:50:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace wrapper
|
|
|
|
} // namespace chart
|
|
|
|
|
|
|
|
// CHART_CHARTDATAWRAPPER_HXX
|
|
|
|
#endif
|
2010-10-27 12:43:08 +01:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|