LibreOffice Module chart2 (master) 1
CachedDataSequence.hxx
Go to the documentation of this file.
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#pragma once
20
21// helper classes
23#include <comphelper/uno3.hxx>
27
28// interfaces and types
29#include <com/sun/star/lang/XServiceInfo.hpp>
30#include <com/sun/star/lang/XInitialization.hpp>
31#include <com/sun/star/chart2/data/XDataSequence.hpp>
32#include <com/sun/star/chart2/data/XNumericalDataSequence.hpp>
33#include <com/sun/star/chart2/data/XTextualDataSequence.hpp>
34#include <com/sun/star/util/XCloneable.hpp>
36
37namespace com::sun::star::uno { class XComponentContext; }
38
39namespace chart
40{
41
42namespace impl
43{
44typedef ::cppu::WeakComponentImplHelper<
45 css::chart2::data::XDataSequence,
46 css::chart2::data::XNumericalDataSequence,
47 css::chart2::data::XTextualDataSequence,
48 css::util::XCloneable,
49 css::util::XModifyBroadcaster,
50 css::lang::XInitialization,
51 css::lang::XServiceInfo >
53}
54
58class CachedDataSequence final :
61 public ::comphelper::OPropertyArrayUsageHelper< CachedDataSequence >,
63{
64public:
68
69 explicit CachedDataSequence( const css::uno::Reference< css::uno::XComponentContext > & xContext );
70
74 explicit CachedDataSequence( const OUString & rSingleText );
75
77 explicit CachedDataSequence( const CachedDataSequence & rSource );
78
79 virtual ~CachedDataSequence() override;
80
82 virtual OUString SAL_CALL getImplementationName() override;
83 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
84 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
85
89 DECLARE_XTYPEPROVIDER()
90
91private:
92 // ____ XPropertySet ____
94 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override;
96 virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper() override;
98 virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const override;
99
100 // ____ XDataSequence ____
101 virtual css::uno::Sequence< css::uno::Any > SAL_CALL getData() override;
102 virtual OUString SAL_CALL getSourceRangeRepresentation() override;
103 virtual css::uno::Sequence< OUString > SAL_CALL generateLabel(
104 css::chart2::data::LabelOrigin nLabelOrigin ) override;
105 virtual ::sal_Int32 SAL_CALL getNumberFormatKeyByIndex( ::sal_Int32 nIndex ) override;
106
107 // ____ XNumericalDataSequence ____
109 virtual css::uno::Sequence< double > SAL_CALL getNumericalData() override;
110
111 // ____ XTextualDataSequence ____
113 virtual css::uno::Sequence< OUString > SAL_CALL getTextualData() override;
114
115 // ____ XCloneable ____
116 virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() override;
117
118 // ____ XModifyBroadcaster ____
119 virtual void SAL_CALL addModifyListener(
120 const css::uno::Reference< css::util::XModifyListener >& aListener ) override;
121 virtual void SAL_CALL removeModifyListener(
122 const css::uno::Reference< css::util::XModifyListener >& aListener ) override;
123
124 // css::lang::XInitialization:
125 virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > & aArguments) override;
126
127 // <properties>
129 OUString m_sRole;
130 // </properties>
131
133 {
136 MIXED
137 };
138
142 void registerProperties();
143
146 css::uno::Sequence< double > Impl_getNumericalData() const;
149 css::uno::Sequence< OUString > Impl_getTextualData() const;
152 css::uno::Sequence< css::uno::Any > Impl_getMixedData() const;
153
155
156 css::uno::Sequence< double > m_aNumericalSequence;
157 css::uno::Sequence< OUString > m_aTextualSequence;
158 css::uno::Sequence< css::uno::Any > m_aMixedSequence;
160};
161
162} // namespace chart
163
164/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This sequence object does store actual values within, hence "cached".
virtual void SAL_CALL addModifyListener(const css::uno::Reference< css::util::XModifyListener > &aListener) override
rtl::Reference< ModifyEventForwarder > m_xModifyEventForwarder
css::uno::Sequence< css::uno::Any > m_aMixedSequence
virtual OUString SAL_CALL getSourceRangeRepresentation() override
virtual ::cppu::IPropertyArrayHelper * createArrayHelper() const override
virtual css::uno::Sequence< OUString > SAL_CALL getTextualData() override
virtual css::uno::Sequence< double > SAL_CALL getNumericalData() override
CachedDataSequence(const css::uno::Reference< css::uno::XComponentContext > &xContext)
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &aArguments) override
virtual ::cppu::IPropertyArrayHelper &SAL_CALL getInfoHelper() override
css::uno::Sequence< double > m_aNumericalSequence
css::uno::Sequence< css::uno::Any > Impl_getMixedData() const
is used by interface method getData().
CachedDataSequence()
constructs an empty sequence
virtual void SAL_CALL removeModifyListener(const css::uno::Reference< css::util::XModifyListener > &aListener) override
void registerProperties()
This method registers all properties.
virtual ~CachedDataSequence() override
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
merge XInterface implementations
virtual css::uno::Sequence< OUString > SAL_CALL generateLabel(css::chart2::data::LabelOrigin nLabelOrigin) override
css::uno::Sequence< OUString > Impl_getTextualData() const
is used by interface method getTextualData().
virtual css::uno::Sequence< css::uno::Any > SAL_CALL getData() override
virtual ::sal_Int32 SAL_CALL getNumberFormatKeyByIndex(::sal_Int32 nIndex) override
virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() override
virtual OUString SAL_CALL getImplementationName() override
declare XServiceInfo methods
css::uno::Sequence< double > Impl_getNumericalData() const
is used by interface method getNumericalData().
css::uno::Sequence< OUString > m_aTextualSequence
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
::cppu::WeakComponentImplHelper< css::chart2::data::XDataSequence, css::chart2::data::XNumericalDataSequence, css::chart2::data::XTextualDataSequence, css::util::XCloneable, css::util::XModifyBroadcaster, css::lang::XInitialization, css::lang::XServiceInfo > CachedDataSequence_Base
unsigned char sal_Bool
#define DECLARE_XINTERFACE()