Line data Source code
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 : #ifndef INCLUDED_CHART2_SOURCE_TOOLS_REGRESSIONEQUATION_HXX
20 : #define INCLUDED_CHART2_SOURCE_TOOLS_REGRESSIONEQUATION_HXX
21 :
22 : #include <com/sun/star/lang/XServiceInfo.hpp>
23 : #include <com/sun/star/uno/XComponentContext.hpp>
24 : #include <com/sun/star/util/XCloneable.hpp>
25 : #include <com/sun/star/util/XModifyBroadcaster.hpp>
26 : #include <com/sun/star/util/XModifyListener.hpp>
27 : #include <com/sun/star/chart2/XTitle.hpp>
28 :
29 : #include "MutexContainer.hxx"
30 : #include "OPropertySet.hxx"
31 : #include "ServiceMacros.hxx"
32 : #include "ModifyListenerHelper.hxx"
33 :
34 : #include <cppuhelper/implbase5.hxx>
35 : #include <comphelper/uno3.hxx>
36 :
37 : namespace chart
38 : {
39 :
40 : namespace impl
41 : {
42 : typedef ::cppu::WeakImplHelper5<
43 : css::lang::XServiceInfo,
44 : ::com::sun::star::util::XCloneable,
45 : ::com::sun::star::util::XModifyBroadcaster,
46 : ::com::sun::star::util::XModifyListener,
47 : ::com::sun::star::chart2::XTitle >
48 : RegressionEquation_Base;
49 : }
50 :
51 : class RegressionEquation :
52 : public MutexContainer,
53 : public impl::RegressionEquation_Base,
54 : public ::property::OPropertySet
55 : {
56 : public:
57 : explicit RegressionEquation(
58 : const ::com::sun::star::uno::Reference<
59 : ::com::sun::star::uno::XComponentContext > & xContext );
60 : virtual ~RegressionEquation();
61 :
62 : virtual OUString SAL_CALL
63 : getImplementationName()
64 : throw( ::com::sun::star::uno::RuntimeException, std::exception )
65 : SAL_OVERRIDE;
66 : virtual sal_Bool SAL_CALL
67 : supportsService( const OUString& ServiceName )
68 : throw( ::com::sun::star::uno::RuntimeException, std::exception )
69 : SAL_OVERRIDE;
70 : virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL
71 : getSupportedServiceNames()
72 : throw( ::com::sun::star::uno::RuntimeException, std::exception )
73 : SAL_OVERRIDE;
74 : static OUString getImplementationName_Static();
75 : static ::com::sun::star::uno::Sequence< OUString >
76 : getSupportedServiceNames_Static();
77 :
78 : /// merge XInterface implementations
79 : DECLARE_XINTERFACE()
80 : /// establish methods for factory instatiation
81 18 : APPHELPER_SERVICE_FACTORY_HELPER( RegressionEquation )
82 :
83 : protected:
84 : explicit RegressionEquation( const RegressionEquation & rOther );
85 :
86 : // ____ OPropertySet ____
87 : virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const
88 : throw (css::beans::UnknownPropertyException,
89 : css::uno::RuntimeException) SAL_OVERRIDE;
90 :
91 : virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() SAL_OVERRIDE;
92 :
93 : // ____ XPropertySet ____
94 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL
95 : getPropertySetInfo()
96 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
97 :
98 : // ____ XCloneable ____
99 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone()
100 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
101 :
102 : // ____ XModifyBroadcaster ____
103 : virtual void SAL_CALL addModifyListener(
104 : const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
105 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
106 : virtual void SAL_CALL removeModifyListener(
107 : const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
108 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
109 :
110 : // ____ XModifyListener ____
111 : virtual void SAL_CALL modified(
112 : const ::com::sun::star::lang::EventObject& aEvent )
113 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
114 :
115 : // ____ XEventListener (base of XModifyListener) ____
116 : virtual void SAL_CALL disposing(
117 : const ::com::sun::star::lang::EventObject& Source )
118 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
119 :
120 : // ____ XTitle ____
121 : virtual ::com::sun::star::uno::Sequence<
122 : ::com::sun::star::uno::Reference<
123 : ::com::sun::star::chart2::XFormattedString > > SAL_CALL getText()
124 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
125 : virtual void SAL_CALL setText( const ::com::sun::star::uno::Sequence<
126 : ::com::sun::star::uno::Reference<
127 : ::com::sun::star::chart2::XFormattedString > >& Strings )
128 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
129 :
130 : using ::cppu::OPropertySetHelper::disposing;
131 :
132 : // ____ OPropertySet ____
133 : virtual void firePropertyChangeEvent() SAL_OVERRIDE;
134 :
135 : void fireModifyEvent();
136 :
137 : private:
138 : ::com::sun::star::uno::Sequence<
139 : ::com::sun::star::uno::Reference<
140 : ::com::sun::star::chart2::XFormattedString > > m_aStrings;
141 :
142 : ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > m_xModifyEventForwarder;
143 : ::com::sun::star::uno::Reference<
144 : ::com::sun::star::uno::XComponentContext >
145 : m_xContext;
146 : };
147 :
148 : } // namespace chart
149 :
150 : // INCLUDED_CHART2_SOURCE_TOOLS_REGRESSIONEQUATION_HXX
151 : #endif
152 :
153 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|