Branch data 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 CHART_FORMATTEDSTRING_HXX
20 : : #define CHART_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/XFormattedString.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 : : ::com::sun::star::chart2::XFormattedString,
40 : : ::com::sun::star::lang::XServiceInfo,
41 : : ::com::sun::star::util::XCloneable,
42 : : ::com::sun::star::util::XModifyBroadcaster,
43 : : ::com::sun::star::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( ::com::sun::star::uno::Reference<
54 : : ::com::sun::star::uno::XComponentContext > const & xContext );
55 : : virtual ~FormattedString();
56 : :
57 : : /// declare XServiceInfo methods
58 : : APPHELPER_XSERVICEINFO_DECL()
59 : : /// establish methods for factory instatiation
60 [ + - ][ + - ]: 3243 : APPHELPER_SERVICE_FACTORY_HELPER( FormattedString )
61 : :
62 : : /// merge XInterface implementations
63 : : DECLARE_XINTERFACE()
64 : : /// merge XTypeProvider implementations
65 : : DECLARE_XTYPEPROVIDER()
66 : :
67 : : protected:
68 : : explicit FormattedString( const FormattedString & rOther );
69 : :
70 : : // ____ XFormattedString ____
71 : : virtual ::rtl::OUString SAL_CALL getString()
72 : : throw (::com::sun::star::uno::RuntimeException);
73 : : virtual void SAL_CALL setString( const ::rtl::OUString& String )
74 : : throw (::com::sun::star::uno::RuntimeException);
75 : :
76 : : // ____ OPropertySet ____
77 : : virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const
78 : : throw(::com::sun::star::beans::UnknownPropertyException);
79 : :
80 : : // ____ OPropertySet ____
81 : : virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
82 : :
83 : : // ____ XPropertySet ____
84 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL
85 : : getPropertySetInfo()
86 : : throw (::com::sun::star::uno::RuntimeException);
87 : :
88 : : // ____ XCloneable ____
89 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone()
90 : : throw (::com::sun::star::uno::RuntimeException);
91 : :
92 : : // ____ XModifyBroadcaster ____
93 : : virtual void SAL_CALL addModifyListener(
94 : : const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
95 : : throw (::com::sun::star::uno::RuntimeException);
96 : : virtual void SAL_CALL removeModifyListener(
97 : : const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
98 : : throw (::com::sun::star::uno::RuntimeException);
99 : :
100 : : // ____ XModifyListener ____
101 : : virtual void SAL_CALL modified(
102 : : const ::com::sun::star::lang::EventObject& aEvent )
103 : : throw (::com::sun::star::uno::RuntimeException);
104 : :
105 : : // ____ XEventListener (base of XModifyListener) ____
106 : : virtual void SAL_CALL disposing(
107 : : const ::com::sun::star::lang::EventObject& Source )
108 : : throw (::com::sun::star::uno::RuntimeException);
109 : :
110 : : // ____ OPropertySet ____
111 : : virtual void firePropertyChangeEvent();
112 : : using OPropertySet::disposing;
113 : :
114 : : void fireModifyEvent();
115 : :
116 : : private:
117 : : ::rtl::OUString m_aString;
118 : :
119 : : ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > m_xModifyEventForwarder;
120 : : };
121 : :
122 : : } // namespace chart
123 : :
124 : : // CHART_FORMATTEDSTRING_HXX
125 : : #endif
126 : :
127 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|