1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 #ifndef INCLUDED_CHART2_SOURCE_INC_UNCACHEDDATASEQUENCE_HXX
20 #define INCLUDED_CHART2_SOURCE_INC_UNCACHEDDATASEQUENCE_HXX
23 #include <cppuhelper/compbase8.hxx>
24 #include <comphelper/uno3.hxx>
25 #include <comphelper/broadcasthelper.hxx>
26 #include <comphelper/propertycontainer.hxx>
27 #include <comphelper/proparrhlp.hxx>
28 #include "charttoolsdllapi.hxx"
30 // interfaces and types
31 #include <com/sun/star/lang/XServiceInfo.hpp>
32 #include <com/sun/star/beans/XPropertySet.hpp>
33 #include <com/sun/star/uno/XComponentContext.hpp>
34 #include <com/sun/star/chart2/XInternalDataProvider.hpp>
35 #include <com/sun/star/chart2/data/XDataSequence.hpp>
36 #include <com/sun/star/chart2/data/XNumericalDataSequence.hpp>
37 #include <com/sun/star/chart2/data/XTextualDataSequence.hpp>
38 #include <com/sun/star/container/XIndexReplace.hpp>
39 #include <com/sun/star/container/XNamed.hpp>
40 #include <com/sun/star/util/XCloneable.hpp>
41 #include <com/sun/star/util/XModifyBroadcaster.hpp>
42 #include <com/sun/star/util/XModifiable.hpp>
51 typedef ::cppu::WeakComponentImplHelper8
<
52 ::com::sun::star::chart2::data::XDataSequence
,
53 ::com::sun::star::chart2::data::XNumericalDataSequence
,
54 ::com::sun::star::chart2::data::XTextualDataSequence
,
55 ::com::sun::star::util::XCloneable
,
56 ::com::sun::star::util::XModifiable
, // contains util::XModifyBroadcaster
57 ::com::sun::star::container::XIndexReplace
,
58 ::com::sun::star::container::XNamed
, // for setting a new range representation
59 ::com::sun::star::lang::XServiceInfo
>
60 UncachedDataSequence_Base
;
64 * This sequence object does NOT store actual sequence data. Instead, it
65 * references a column inside the internal data table (represented by class
66 * InternalData) via range representation string. The range representation
67 * string ends with a numeric value that indicates the column index within
68 * the internal data table.
70 * <p>A range representation can be either '0', '1', '2', ..., or 'label 1',
73 class UncachedDataSequence
:
74 public ::comphelper::OMutexAndBroadcastHelper
,
75 public ::comphelper::OPropertyContainer
,
76 public ::comphelper::OPropertyArrayUsageHelper
< UncachedDataSequence
>,
77 public impl::UncachedDataSequence_Base
80 /** The referring data provider is held as uno reference to ensure its
81 lifetime is at least as long as the one of this object.
84 const ::com::sun::star::uno::Reference
<
85 ::com::sun::star::chart2::XInternalDataProvider
> & xIntDataProv
,
86 const OUString
& rRangeRepresentation
);
88 const ::com::sun::star::uno::Reference
<
89 ::com::sun::star::chart2::XInternalDataProvider
> & xIntDataProv
,
90 const OUString
& rRangeRepresentation
,
91 const OUString
& rRole
);
92 UncachedDataSequence( const UncachedDataSequence
& rSource
);
93 virtual ~UncachedDataSequence();
95 /// declare XServiceInfo methods
96 virtual OUString SAL_CALL
getImplementationName()
97 throw( css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
98 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
)
99 throw( css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
100 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames()
101 throw( css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
103 static OUString
getImplementationName_Static();
104 static css::uno::Sequence
< OUString
> getSupportedServiceNames_Static();
106 /// merge XInterface implementations
108 /// merge XTypeProvider implementations
109 DECLARE_XTYPEPROVIDER()
112 // ____ XPropertySet ____
113 /// @see ::com::sun::star::beans::XPropertySet
114 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo()
115 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
116 /// @see ::comphelper::OPropertySetHelper
117 virtual ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper() SAL_OVERRIDE
;
118 /// @see ::comphelper::OPropertyArrayUsageHelper
119 virtual ::cppu::IPropertyArrayHelper
* createArrayHelper() const SAL_OVERRIDE
;
121 // ____ XDataSequence ____
122 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
> SAL_CALL
getData()
123 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
124 virtual OUString SAL_CALL
getSourceRangeRepresentation()
125 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
126 virtual ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
generateLabel(
127 ::com::sun::star::chart2::data::LabelOrigin nLabelOrigin
)
128 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
129 virtual ::sal_Int32 SAL_CALL
getNumberFormatKeyByIndex( ::sal_Int32 nIndex
)
130 throw (::com::sun::star::lang::IndexOutOfBoundsException
,
131 ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
133 // ____ XNumericalDataSequence ____
134 /// @see ::com::sun::star::chart::data::XNumericalDataSequence
135 virtual ::com::sun::star::uno::Sequence
< double > SAL_CALL
getNumericalData() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
137 // ____ XTextualDataSequence ____
138 /// @see ::com::sun::star::chart::data::XTextualDataSequence
139 virtual ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
getTextualData() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
141 // ____ XIndexReplace ____
142 virtual void SAL_CALL
replaceByIndex( ::sal_Int32 Index
, const ::com::sun::star::uno::Any
& Element
)
143 throw (::com::sun::star::lang::IllegalArgumentException
,
144 ::com::sun::star::lang::IndexOutOfBoundsException
,
145 ::com::sun::star::lang::WrappedTargetException
,
146 ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
148 // ____ XIndexAccess (base of XIndexReplace) ____
149 virtual ::sal_Int32 SAL_CALL
getCount()
150 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
151 virtual ::com::sun::star::uno::Any SAL_CALL
getByIndex( ::sal_Int32 Index
)
152 throw (::com::sun::star::lang::IndexOutOfBoundsException
,
153 ::com::sun::star::lang::WrappedTargetException
,
154 ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
156 // ____ XElementAccess (base of XIndexAccess) ____
157 virtual ::com::sun::star::uno::Type SAL_CALL
getElementType()
158 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
159 virtual sal_Bool SAL_CALL
hasElements()
160 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
162 // ____ XNamed (for setting a new range representation) ____
163 virtual OUString SAL_CALL
getName()
164 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
165 virtual void SAL_CALL
setName( const OUString
& aName
)
166 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
168 // ____ XCloneable ____
169 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::util::XCloneable
> SAL_CALL
createClone()
170 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
172 // ____ XModifiable ____
173 virtual sal_Bool SAL_CALL
isModified()
174 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
175 virtual void SAL_CALL
setModified( sal_Bool bModified
)
176 throw (::com::sun::star::beans::PropertyVetoException
,
177 ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
179 // ____ XModifyBroadcaster (base of XModifiable) ____
180 virtual void SAL_CALL
addModifyListener(
181 const ::com::sun::star::uno::Reference
< ::com::sun::star::util::XModifyListener
>& aListener
)
182 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
183 virtual void SAL_CALL
removeModifyListener(
184 const ::com::sun::star::uno::Reference
< ::com::sun::star::util::XModifyListener
>& aListener
)
185 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
187 void fireModifyEvent();
189 mutable ::osl::Mutex m_aMutex
;
192 sal_Int32 m_nNumberFormatKey
;
194 OUString m_aXMLRange
;
197 /** This method registers all properties. It should be called by all
200 void registerProperties();
203 ::com::sun::star::uno::Reference
<
204 ::com::sun::star::chart2::XInternalDataProvider
> m_xDataProvider
;
205 OUString m_aSourceRepresentation
;
206 ::com::sun::star::uno::Reference
< ::com::sun::star::util::XModifyListener
>
207 m_xModifyEventForwarder
;
212 // INCLUDED_CHART2_SOURCE_INC_UNCACHEDDATASEQUENCE_HXX
215 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */