tdf#130857 qt weld: Implement QtInstanceWidget::strip_mnemonic
[LibreOffice.git] / chart2 / source / inc / CachedDataSequence.hxx
blob513907c2429d607a766f3e7e8e941e80a9fd5521
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #pragma once
21 // helper classes
22 #include <comphelper/compbase.hxx>
23 #include <comphelper/uno3.hxx>
24 #include <comphelper/propertycontainer2.hxx>
25 #include <comphelper/proparrhlp.hxx>
27 // interfaces and types
28 #include <com/sun/star/lang/XServiceInfo.hpp>
29 #include <com/sun/star/lang/XInitialization.hpp>
30 #include <com/sun/star/chart2/data/XDataSequence.hpp>
31 #include <com/sun/star/chart2/data/XNumericalDataSequence.hpp>
32 #include <com/sun/star/chart2/data/XTextualDataSequence.hpp>
33 #include <com/sun/star/util/XCloneable.hpp>
34 #include "ModifyListenerHelper.hxx"
36 namespace com::sun::star::uno { class XComponentContext; }
38 namespace chart
41 namespace impl
43 typedef ::comphelper::WeakComponentImplHelper<
44 css::chart2::data::XDataSequence,
45 css::chart2::data::XNumericalDataSequence,
46 css::chart2::data::XTextualDataSequence,
47 css::util::XCloneable,
48 css::util::XModifyBroadcaster,
49 css::lang::XInitialization,
50 css::lang::XServiceInfo >
51 CachedDataSequence_Base;
54 /**
55 * This sequence object does store actual values within, hence "cached".
57 class CachedDataSequence final :
58 public ::comphelper::OPropertyContainer2,
59 public ::comphelper::OPropertyArrayUsageHelper< CachedDataSequence >,
60 public impl::CachedDataSequence_Base
62 public:
63 /** constructs an empty sequence
65 CachedDataSequence();
67 explicit CachedDataSequence( const css::uno::Reference< css::uno::XComponentContext > & xContext );
69 /** creates a sequence and initializes it with the given string. This is
70 especially useful for labels, which only have one element.
72 explicit CachedDataSequence( const OUString & rSingleText );
74 /// Copy CTOR
75 explicit CachedDataSequence( const CachedDataSequence & rSource );
77 virtual ~CachedDataSequence() override;
79 /// declare XServiceInfo methods
80 virtual OUString SAL_CALL getImplementationName() override;
81 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
82 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
84 /// merge XInterface implementations
85 DECLARE_XINTERFACE()
86 /// merge XTypeProvider implementations
87 DECLARE_XTYPEPROVIDER()
89 private:
90 // ____ XPropertySet ____
91 /// @see css::beans::XPropertySet
92 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override;
93 /// @see ::comphelper::OPropertySetHelper
94 virtual ::cppu::IPropertyArrayHelper& getInfoHelper() override;
95 /// @see ::comphelper::OPropertyArrayUsageHelper
96 virtual ::cppu::IPropertyArrayHelper* createArrayHelper() const override;
98 // ____ XDataSequence ____
99 virtual css::uno::Sequence< css::uno::Any > SAL_CALL getData() override;
100 virtual OUString SAL_CALL getSourceRangeRepresentation() override;
101 virtual css::uno::Sequence< OUString > SAL_CALL generateLabel(
102 css::chart2::data::LabelOrigin nLabelOrigin ) override;
103 virtual ::sal_Int32 SAL_CALL getNumberFormatKeyByIndex( ::sal_Int32 nIndex ) override;
105 // ____ XNumericalDataSequence ____
106 /// @see css::chart::data::XNumericalDataSequence
107 virtual css::uno::Sequence< double > SAL_CALL getNumericalData() override;
109 // ____ XTextualDataSequence ____
110 /// @see css::chart::data::XTextualDataSequence
111 virtual css::uno::Sequence< OUString > SAL_CALL getTextualData() override;
113 // ____ XCloneable ____
114 virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone() override;
116 // ____ XModifyBroadcaster ____
117 virtual void SAL_CALL addModifyListener(
118 const css::uno::Reference< css::util::XModifyListener >& aListener ) override;
119 virtual void SAL_CALL removeModifyListener(
120 const css::uno::Reference< css::util::XModifyListener >& aListener ) override;
122 // css::lang::XInitialization:
123 virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > & aArguments) override;
125 // <properties>
126 sal_Int32 m_nNumberFormatKey;
127 OUString m_sRole;
128 // </properties>
130 enum DataType
132 NUMERICAL,
133 TEXTUAL,
134 MIXED
137 /** This method registers all properties. It should be called by all
138 constructors.
140 void registerProperties();
142 /** is used by interface method getNumericalData().
144 css::uno::Sequence< double > Impl_getNumericalData() const;
145 /** is used by interface method getTextualData().
147 css::uno::Sequence< OUString > Impl_getTextualData() const;
148 /** is used by interface method getData().
150 css::uno::Sequence< css::uno::Any > Impl_getMixedData() const;
152 enum DataType m_eCurrentDataType;
154 css::uno::Sequence< double > m_aNumericalSequence;
155 css::uno::Sequence< OUString > m_aTextualSequence;
156 css::uno::Sequence< css::uno::Any > m_aMixedSequence;
157 rtl::Reference<ModifyEventForwarder> m_xModifyEventForwarder;
160 } // namespace chart
162 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */