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_TOOLS_REGRESSIONEQUATION_HXX
20 #define INCLUDED_CHART2_SOURCE_TOOLS_REGRESSIONEQUATION_HXX
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>
29 #include "MutexContainer.hxx"
30 #include "OPropertySet.hxx"
31 #include "ModifyListenerHelper.hxx"
33 #include <cppuhelper/implbase5.hxx>
34 #include <comphelper/uno3.hxx>
41 typedef ::cppu::WeakImplHelper5
<
42 css::lang::XServiceInfo
,
43 ::com::sun::star::util::XCloneable
,
44 ::com::sun::star::util::XModifyBroadcaster
,
45 ::com::sun::star::util::XModifyListener
,
46 ::com::sun::star::chart2::XTitle
>
47 RegressionEquation_Base
;
50 class RegressionEquation
:
51 public MutexContainer
,
52 public impl::RegressionEquation_Base
,
53 public ::property::OPropertySet
56 explicit RegressionEquation(
57 const ::com::sun::star::uno::Reference
<
58 ::com::sun::star::uno::XComponentContext
> & xContext
);
59 virtual ~RegressionEquation();
61 virtual OUString SAL_CALL
62 getImplementationName()
63 throw( ::com::sun::star::uno::RuntimeException
, std::exception
)
65 virtual sal_Bool SAL_CALL
66 supportsService( const OUString
& ServiceName
)
67 throw( ::com::sun::star::uno::RuntimeException
, std::exception
)
69 virtual ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
70 getSupportedServiceNames()
71 throw( ::com::sun::star::uno::RuntimeException
, std::exception
)
73 static OUString
getImplementationName_Static();
74 static ::com::sun::star::uno::Sequence
< OUString
>
75 getSupportedServiceNames_Static();
77 /// merge XInterface implementations
79 /// establish methods for factory instatiation
80 static css::uno::Reference
< css::uno::XInterface
> SAL_CALL
create( css::uno::Reference
< css::uno::XComponentContext
> const & xContext
)
81 throw(css::uno::Exception
)
83 return (::cppu::OWeakObject
*)new RegressionEquation( xContext
);
87 explicit RegressionEquation( const RegressionEquation
& rOther
);
89 // ____ OPropertySet ____
90 virtual ::com::sun::star::uno::Any
GetDefaultValue( sal_Int32 nHandle
) const
91 throw (css::beans::UnknownPropertyException
,
92 css::uno::RuntimeException
) SAL_OVERRIDE
;
94 virtual ::cppu::IPropertyArrayHelper
& SAL_CALL
getInfoHelper() SAL_OVERRIDE
;
96 // ____ XPropertySet ____
97 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySetInfo
> SAL_CALL
99 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
101 // ____ XCloneable ____
102 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::util::XCloneable
> SAL_CALL
createClone()
103 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
105 // ____ XModifyBroadcaster ____
106 virtual void SAL_CALL
addModifyListener(
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 virtual void SAL_CALL
removeModifyListener(
110 const ::com::sun::star::uno::Reference
< ::com::sun::star::util::XModifyListener
>& aListener
)
111 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
113 // ____ XModifyListener ____
114 virtual void SAL_CALL
modified(
115 const ::com::sun::star::lang::EventObject
& aEvent
)
116 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
118 // ____ XEventListener (base of XModifyListener) ____
119 virtual void SAL_CALL
disposing(
120 const ::com::sun::star::lang::EventObject
& Source
)
121 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
124 virtual ::com::sun::star::uno::Sequence
<
125 ::com::sun::star::uno::Reference
<
126 ::com::sun::star::chart2::XFormattedString
> > SAL_CALL
getText()
127 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
128 virtual void SAL_CALL
setText( const ::com::sun::star::uno::Sequence
<
129 ::com::sun::star::uno::Reference
<
130 ::com::sun::star::chart2::XFormattedString
> >& Strings
)
131 throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
133 using ::cppu::OPropertySetHelper::disposing
;
135 // ____ OPropertySet ____
136 virtual void firePropertyChangeEvent() SAL_OVERRIDE
;
138 void fireModifyEvent();
141 ::com::sun::star::uno::Sequence
<
142 ::com::sun::star::uno::Reference
<
143 ::com::sun::star::chart2::XFormattedString
> > m_aStrings
;
145 ::com::sun::star::uno::Reference
< ::com::sun::star::util::XModifyListener
> m_xModifyEventForwarder
;
146 ::com::sun::star::uno::Reference
<
147 ::com::sun::star::uno::XComponentContext
>
153 // INCLUDED_CHART2_SOURCE_TOOLS_REGRESSIONEQUATION_HXX
156 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */