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_MODEL_MAIN_FORMATTEDSTRING_HXX
20 : #define INCLUDED_CHART2_SOURCE_MODEL_MAIN_FORMATTEDSTRING_HXX
21 :
22 : #include "MutexContainer.hxx"
23 : #include "OPropertySet.hxx"
24 : #include <cppuhelper/implbase5.hxx>
25 : #include <comphelper/uno3.hxx>
26 : #include "ServiceMacros.hxx"
27 : #include "ModifyListenerHelper.hxx"
28 : #include <com/sun/star/lang/XServiceInfo.hpp>
29 : #include <com/sun/star/chart2/XFormattedString2.hpp>
30 : #include <com/sun/star/util/XCloneable.hpp>
31 : #include <com/sun/star/uno/XComponentContext.hpp>
32 :
33 : namespace chart
34 : {
35 :
36 : namespace impl
37 : {
38 : typedef ::cppu::WeakImplHelper5<
39 : css::chart2::XFormattedString2,
40 : css::lang::XServiceInfo,
41 : css::util::XCloneable,
42 : css::util::XModifyBroadcaster,
43 : css::util::XModifyListener >
44 : FormattedString_Base;
45 : }
46 :
47 : class FormattedString :
48 : public MutexContainer,
49 : public impl::FormattedString_Base,
50 : public ::property::OPropertySet
51 : {
52 : public:
53 : FormattedString( css::uno::Reference<
54 : css::uno::XComponentContext > const & xContext );
55 : virtual ~FormattedString();
56 :
57 : /// declare XServiceInfo methods
58 : APPHELPER_XSERVICEINFO_DECL()
59 : /// establish methods for factory instatiation
60 1525 : APPHELPER_SERVICE_FACTORY_HELPER( FormattedString )
61 :
62 : /// merge XInterface implementations
63 : DECLARE_XINTERFACE()
64 : /// merge XTypeProvider implementations
65 : DECLARE_XTYPEPROVIDER()
66 :
67 55902 : virtual void SAL_CALL setPropertyValue(const OUString& p1, const css::uno::Any& p2) throw (css::beans::UnknownPropertyException, css::beans::PropertyVetoException, css::lang::IllegalArgumentException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE
68 55902 : { ::property::OPropertySet::setPropertyValue(p1, p2); }
69 14980 : virtual css::uno::Any SAL_CALL getPropertyValue(const OUString& p1) throw (css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE
70 14980 : { return ::property::OPropertySet::getPropertyValue(p1); }
71 132 : virtual void SAL_CALL addPropertyChangeListener(const OUString& p1, const css::uno::Reference<css::beans::XPropertyChangeListener>& p2) throw (css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE
72 132 : { ::property::OPropertySet::addPropertyChangeListener(p1, p2); }
73 132 : virtual void SAL_CALL removePropertyChangeListener(const OUString& p1, const css::uno::Reference<css::beans::XPropertyChangeListener>& p2) throw (css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE
74 132 : { ::property::OPropertySet::removePropertyChangeListener(p1, p2); }
75 0 : virtual void SAL_CALL addVetoableChangeListener(const OUString& p1, const css::uno::Reference<css::beans::XVetoableChangeListener>& p2) throw (css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE
76 0 : { ::property::OPropertySet::addVetoableChangeListener(p1, p2); }
77 0 : virtual void SAL_CALL removeVetoableChangeListener(const OUString& p1, const css::uno::Reference<css::beans::XVetoableChangeListener>& p2) throw (css::beans::UnknownPropertyException, css::lang::WrappedTargetException, css::uno::RuntimeException, std::exception) SAL_OVERRIDE
78 0 : { ::property::OPropertySet::removeVetoableChangeListener(p1, p2); }
79 :
80 : protected:
81 : explicit FormattedString( const FormattedString & rOther );
82 :
83 : // ____ XFormattedString ____
84 : virtual OUString SAL_CALL getString()
85 : throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
86 : virtual void SAL_CALL setString( const OUString& String )
87 : throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
88 :
89 : // ____ OPropertySet ____
90 : virtual css::uno::Any GetDefaultValue( sal_Int32 nHandle ) const
91 : throw (css::beans::UnknownPropertyException,
92 : css::uno::RuntimeException) SAL_OVERRIDE;
93 :
94 : // ____ OPropertySet ____
95 : virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper() SAL_OVERRIDE;
96 :
97 : // ____ XPropertySet ____
98 : virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL
99 : getPropertySetInfo()
100 : throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
101 :
102 : // ____ XCloneable ____
103 : virtual css::uno::Reference< css::util::XCloneable > SAL_CALL createClone()
104 : throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
105 :
106 : // ____ XModifyBroadcaster ____
107 : virtual void SAL_CALL addModifyListener(
108 : const css::uno::Reference< css::util::XModifyListener >& aListener )
109 : throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
110 : virtual void SAL_CALL removeModifyListener(
111 : const css::uno::Reference< css::util::XModifyListener >& aListener )
112 : throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
113 :
114 : // ____ XModifyListener ____
115 : virtual void SAL_CALL modified(
116 : const css::lang::EventObject& aEvent )
117 : throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
118 :
119 : // ____ XEventListener (base of XModifyListener) ____
120 : virtual void SAL_CALL disposing(
121 : const css::lang::EventObject& Source )
122 : throw (css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
123 :
124 : // ____ OPropertySet ____
125 : virtual void firePropertyChangeEvent() SAL_OVERRIDE;
126 : using OPropertySet::disposing;
127 :
128 : void fireModifyEvent();
129 :
130 : private:
131 : OUString m_aString;
132 :
133 : css::uno::Reference< css::util::XModifyListener > m_xModifyEventForwarder;
134 : };
135 :
136 : } // namespace chart
137 :
138 : // INCLUDED_CHART2_SOURCE_MODEL_MAIN_FORMATTEDSTRING_HXX
139 : #endif
140 :
141 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|