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 _CHART_UNCACHEDDATASEQUENCE_HXX
20 #define _CHART_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 "ServiceMacros.hxx"
29 #include "charttoolsdllapi.hxx"
31 // interfaces and types
32 #include <com/sun/star/lang/XServiceInfo.hpp>
33 #include <com/sun/star/beans/XPropertySet.hpp>
34 #include <com/sun/star/uno/XComponentContext.hpp>
35 #include <com/sun/star/chart2/XInternalDataProvider.hpp>
36 #include <com/sun/star/chart2/data/XDataSequence.hpp>
37 #include <com/sun/star/chart2/data/XNumericalDataSequence.hpp>
38 #include <com/sun/star/chart2/data/XTextualDataSequence.hpp>
39 #include <com/sun/star/container/XIndexReplace.hpp>
40 #include <com/sun/star/container/XNamed.hpp>
41 #include <com/sun/star/util/XCloneable.hpp>
42 #include <com/sun/star/util/XModifyBroadcaster.hpp>
43 #include <com/sun/star/util/XModifiable.hpp>
47 // ____________________
53 typedef ::cppu::WeakComponentImplHelper8
<
54 ::com::sun::star::chart2::data::XDataSequence
,
55 ::com::sun::star::chart2::data::XNumericalDataSequence
,
56 ::com::sun::star::chart2::data::XTextualDataSequence
,
57 ::com::sun::star::util::XCloneable
,
58 ::com::sun::star::util::XModifiable
, // contains util::XModifyBroadcaster
59 ::com::sun::star::container::XIndexReplace
,
60 ::com::sun::star::container::XNamed
, // for setting a new range representation
61 ::com::sun::star::lang::XServiceInfo
>
62 UncachedDataSequence_Base
;
65 class UncachedDataSequence
:
66 public ::comphelper::OMutexAndBroadcastHelper
,
67 public ::comphelper::OPropertyContainer
,
68 public ::comphelper::OPropertyArrayUsageHelper
< UncachedDataSequence
>,
69 public impl::UncachedDataSequence_Base
72 /** The referring data provider is held as uno reference to ensure its
73 lifetime is at least as long as the one of this object.
76 const ::com::sun::star::uno::Reference
<
77 ::com::sun::star::chart2::XInternalDataProvider
> & xIntDataProv
,
78 const OUString
& rRangeRepresentation
);
80 const ::com::sun::star::uno::Reference
<
81 ::com::sun::star::chart2::XInternalDataProvider
> & xIntDataProv
,
82 const OUString
& rRangeRepresentation
,
83 const OUString
& rRole
);
84 UncachedDataSequence( const UncachedDataSequence
& rSource
);
85 virtual ~UncachedDataSequence();
87 /// declare XServiceInfo methods
88 APPHELPER_XSERVICEINFO_DECL()
90 /// merge XInterface implementations
92 /// merge XTypeProvider implementations
93 DECLARE_XTYPEPROVIDER()
96 // ____ XPropertySet ____
97 /// @see ::com::sun::star::beans::XPropertySet
98 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo()
99 throw (::com::sun::star::uno::RuntimeException
);
100 /// @see ::comphelper::OPropertySetHelper
101 virtual ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper();
102 /// @see ::comphelper::OPropertyArrayUsageHelper
103 virtual ::cppu::IPropertyArrayHelper
* createArrayHelper() const;
105 // ____ XDataSequence ____
106 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
> SAL_CALL
getData()
107 throw (::com::sun::star::uno::RuntimeException
);
108 virtual OUString SAL_CALL
getSourceRangeRepresentation()
109 throw (::com::sun::star::uno::RuntimeException
);
110 virtual ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
generateLabel(
111 ::com::sun::star::chart2::data::LabelOrigin nLabelOrigin
)
112 throw (::com::sun::star::uno::RuntimeException
);
113 virtual ::sal_Int32 SAL_CALL
getNumberFormatKeyByIndex( ::sal_Int32 nIndex
)
114 throw (::com::sun::star::lang::IndexOutOfBoundsException
,
115 ::com::sun::star::uno::RuntimeException
);
117 // ____ XNumericalDataSequence ____
118 /// @see ::com::sun::star::chart::data::XNumericalDataSequence
119 virtual ::com::sun::star::uno::Sequence
< double > SAL_CALL
getNumericalData() throw (::com::sun::star::uno::RuntimeException
);
121 // ____ XTextualDataSequence ____
122 /// @see ::com::sun::star::chart::data::XTextualDataSequence
123 virtual ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
getTextualData() throw (::com::sun::star::uno::RuntimeException
);
125 // ____ XIndexReplace ____
126 virtual void SAL_CALL
replaceByIndex( ::sal_Int32 Index
, const ::com::sun::star::uno::Any
& Element
)
127 throw (::com::sun::star::lang::IllegalArgumentException
,
128 ::com::sun::star::lang::IndexOutOfBoundsException
,
129 ::com::sun::star::lang::WrappedTargetException
,
130 ::com::sun::star::uno::RuntimeException
);
132 // ____ XIndexAccess (base of XIndexReplace) ____
133 virtual ::sal_Int32 SAL_CALL
getCount()
134 throw (::com::sun::star::uno::RuntimeException
);
135 virtual ::com::sun::star::uno::Any SAL_CALL
getByIndex( ::sal_Int32 Index
)
136 throw (::com::sun::star::lang::IndexOutOfBoundsException
,
137 ::com::sun::star::lang::WrappedTargetException
,
138 ::com::sun::star::uno::RuntimeException
);
140 // ____ XElementAccess (base of XIndexAccess) ____
141 virtual ::com::sun::star::uno::Type SAL_CALL
getElementType()
142 throw (::com::sun::star::uno::RuntimeException
);
143 virtual ::sal_Bool SAL_CALL
hasElements()
144 throw (::com::sun::star::uno::RuntimeException
);
146 // ____ XNamed (for setting a new range representation) ____
147 virtual OUString SAL_CALL
getName()
148 throw (::com::sun::star::uno::RuntimeException
);
149 virtual void SAL_CALL
setName( const OUString
& aName
)
150 throw (::com::sun::star::uno::RuntimeException
);
152 // ____ XCloneable ____
153 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::util::XCloneable
> SAL_CALL
createClone()
154 throw (::com::sun::star::uno::RuntimeException
);
156 // ____ XModifiable ____
157 virtual ::sal_Bool SAL_CALL
isModified()
158 throw (::com::sun::star::uno::RuntimeException
);
159 virtual void SAL_CALL
setModified( ::sal_Bool bModified
)
160 throw (::com::sun::star::beans::PropertyVetoException
,
161 ::com::sun::star::uno::RuntimeException
);
163 // ____ XModifyBroadcaster (base of XModifiable) ____
164 virtual void SAL_CALL
addModifyListener(
165 const ::com::sun::star::uno::Reference
< ::com::sun::star::util::XModifyListener
>& aListener
)
166 throw (::com::sun::star::uno::RuntimeException
);
167 virtual void SAL_CALL
removeModifyListener(
168 const ::com::sun::star::uno::Reference
< ::com::sun::star::util::XModifyListener
>& aListener
)
169 throw (::com::sun::star::uno::RuntimeException
);
171 void fireModifyEvent();
173 mutable ::osl::Mutex m_aMutex
;
176 sal_Int32 m_nNumberFormatKey
;
178 OUString m_aXMLRange
;
181 /** This method registers all properties. It should be called by all
184 void registerProperties();
187 ::com::sun::star::uno::Reference
<
188 ::com::sun::star::chart2::XInternalDataProvider
> m_xDataProvider
;
189 OUString m_aSourceRepresentation
;
190 ::com::sun::star::uno::Reference
< ::com::sun::star::util::XModifyListener
>
191 m_xModifyEventForwarder
;
197 // _CHART_UNCACHEDDATASEQUENCE_HXX
200 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */