1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef CHART2_REGRESSIONEQUATION_HXX
24 #define CHART2_REGRESSIONEQUATION_HXX
25 
26 #include <com/sun/star/uno/XComponentContext.hpp>
27 #include <com/sun/star/util/XCloneable.hpp>
28 #include <com/sun/star/util/XModifyBroadcaster.hpp>
29 #include <com/sun/star/util/XModifyListener.hpp>
30 #include <com/sun/star/chart2/XTitle.hpp>
31 
32 #include "MutexContainer.hxx"
33 #include "OPropertySet.hxx"
34 #include "ServiceMacros.hxx"
35 #include "ModifyListenerHelper.hxx"
36 
37 #include <cppuhelper/implbase4.hxx>
38 #include <comphelper/uno3.hxx>
39 
40 namespace chart
41 {
42 
43 namespace impl
44 {
45 typedef ::cppu::WeakImplHelper4<
46         ::com::sun::star::util::XCloneable,
47         ::com::sun::star::util::XModifyBroadcaster,
48         ::com::sun::star::util::XModifyListener,
49         ::com::sun::star::chart2::XTitle >
50     RegressionEquation_Base;
51 }
52 
53 class RegressionEquation :
54         public MutexContainer,
55         public impl::RegressionEquation_Base,
56         public ::property::OPropertySet
57 {
58 public:
59     explicit RegressionEquation(
60         const ::com::sun::star::uno::Reference<
61             ::com::sun::star::uno::XComponentContext > & xContext );
62 	virtual ~RegressionEquation();
63 
64     /// XServiceInfo declarations
65     APPHELPER_XSERVICEINFO_DECL()
66     /// merge XInterface implementations
67  	DECLARE_XINTERFACE()
68     /// establish methods for factory instatiation
69 	APPHELPER_SERVICE_FACTORY_HELPER( RegressionEquation )
70 
71 protected:
72     explicit RegressionEquation( const RegressionEquation & rOther );
73 
74     // ____ OPropertySet ____
75     virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const
76         throw(::com::sun::star::beans::UnknownPropertyException);
77 
78 	virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
79 
80     // ____ XPropertySet ____
81     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL
82         getPropertySetInfo()
83         throw (::com::sun::star::uno::RuntimeException);
84 
85 
86     // ____ XCloneable ____
87     virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone()
88         throw (::com::sun::star::uno::RuntimeException);
89 
90     // ____ XModifyBroadcaster ____
91     virtual void SAL_CALL addModifyListener(
92         const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
93         throw (::com::sun::star::uno::RuntimeException);
94     virtual void SAL_CALL removeModifyListener(
95         const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
96         throw (::com::sun::star::uno::RuntimeException);
97 
98     // ____ XModifyListener ____
99     virtual void SAL_CALL modified(
100         const ::com::sun::star::lang::EventObject& aEvent )
101         throw (::com::sun::star::uno::RuntimeException);
102 
103     // ____ XEventListener (base of XModifyListener) ____
104     virtual void SAL_CALL disposing(
105         const ::com::sun::star::lang::EventObject& Source )
106         throw (::com::sun::star::uno::RuntimeException);
107 
108     // ____ XTitle ____
109     virtual ::com::sun::star::uno::Sequence<
110         ::com::sun::star::uno::Reference<
111         ::com::sun::star::chart2::XFormattedString > > SAL_CALL getText()
112         throw (::com::sun::star::uno::RuntimeException);
113     virtual void SAL_CALL setText( const ::com::sun::star::uno::Sequence<
114                                    ::com::sun::star::uno::Reference<
115                                    ::com::sun::star::chart2::XFormattedString > >& Strings )
116         throw (::com::sun::star::uno::RuntimeException);
117 
118     using ::cppu::OPropertySetHelper::disposing;
119 
120     // ____ OPropertySet ____
121     virtual void firePropertyChangeEvent();
122 
123     void fireModifyEvent();
124 
125 private:
126     ::com::sun::star::uno::Sequence<
127         ::com::sun::star::uno::Reference<
128             ::com::sun::star::chart2::XFormattedString > > m_aStrings;
129 
130     ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > m_xModifyEventForwarder;
131     ::com::sun::star::uno::Reference<
132         ::com::sun::star::uno::XComponentContext >
133                         m_xContext;
134 };
135 
136 } //  namespace chart
137 
138 // CHART2_REGRESSIONEQUATION_HXX
139 #endif
140