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_LABELEDDATASEQUENCE_HXX
20 #define INCLUDED_CHART2_SOURCE_INC_LABELEDDATASEQUENCE_HXX
22 #include "MutexContainer.hxx"
23 #include <comphelper/uno3.hxx>
24 #include <cppuhelper/implbase2.hxx>
26 #include <com/sun/star/chart2/data/XLabeledDataSequence2.hpp>
27 #include <com/sun/star/lang/XServiceInfo.hpp>
28 #include <com/sun/star/util/XCloneable.hpp>
29 #include <com/sun/star/uno/XComponentContext.hpp>
30 #include <com/sun/star/util/XModifyBroadcaster.hpp>
37 typedef cppu::WeakImplHelper2
<
38 ::com::sun::star::chart2::data::XLabeledDataSequence2
,
39 ::com::sun::star::lang::XServiceInfo
>
40 LabeledDataSequence_Base
;
43 class LabeledDataSequence
:
44 public MutexContainer
,
45 public impl::LabeledDataSequence_Base
48 explicit LabeledDataSequence(
49 const ::com::sun::star::uno::Reference
<
50 ::com::sun::star::uno::XComponentContext
> & xContext
);
51 explicit LabeledDataSequence(
52 const ::com::sun::star::uno::Reference
<
53 ::com::sun::star::chart2::data::XDataSequence
> & rValues
);
54 explicit LabeledDataSequence(
55 const ::com::sun::star::uno::Reference
<
56 ::com::sun::star::chart2::data::XDataSequence
> & rValues
,
57 const ::com::sun::star::uno::Reference
<
58 ::com::sun::star::chart2::data::XDataSequence
> & rLabels
);
60 virtual ~LabeledDataSequence();
62 /// establish methods for factory instatiation
63 static css::uno::Reference
< css::uno::XInterface
> SAL_CALL
create( css::uno::Reference
< css::uno::XComponentContext
> const & xContext
)
64 throw(css::uno::Exception
)
66 return (::cppu::OWeakObject
*)new LabeledDataSequence( xContext
);
68 /// declare XServiceInfo methods
69 virtual OUString SAL_CALL
getImplementationName()
70 throw( css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
71 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
)
72 throw( css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
73 virtual css::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames()
74 throw( css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
76 static OUString
getImplementationName_Static();
77 static css::uno::Sequence
< OUString
> getSupportedServiceNames_Static();
80 // ____ XLabeledDataSequence ____
81 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::chart2::data::XDataSequence
> SAL_CALL
getValues()
82 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
83 virtual void SAL_CALL
setValues(
84 const ::com::sun::star::uno::Reference
< ::com::sun::star::chart2::data::XDataSequence
>& xSequence
)
85 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
86 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::chart2::data::XDataSequence
> SAL_CALL
getLabel()
87 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
88 virtual void SAL_CALL
setLabel(
89 const ::com::sun::star::uno::Reference
< ::com::sun::star::chart2::data::XDataSequence
>& xSequence
)
90 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
92 // ____ XCloneable ____
93 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::util::XCloneable
> SAL_CALL
createClone()
94 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
96 // ____ XModifyBroadcaster ____
97 virtual void SAL_CALL
addModifyListener(
98 const ::com::sun::star::uno::Reference
< ::com::sun::star::util::XModifyListener
>& aListener
)
99 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
100 virtual void SAL_CALL
removeModifyListener(
101 const ::com::sun::star::uno::Reference
< ::com::sun::star::util::XModifyListener
>& aListener
)
102 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
105 ::com::sun::star::uno::Reference
< ::com::sun::star::chart2::data::XDataSequence
> m_xData
;
106 ::com::sun::star::uno::Reference
< ::com::sun::star::chart2::data::XDataSequence
> m_xLabel
;
108 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> m_xContext
;
109 ::com::sun::star::uno::Reference
< ::com::sun::star::util::XModifyListener
> m_xModifyEventForwarder
;
114 // INCLUDED_CHART2_SOURCE_INC_LABELEDDATASEQUENCE_HXX
117 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */