merged tag ooo/OOO330_m14
[LibreOffice.git] / chart2 / source / model / main / FormattedString.hxx
blob9293d73afa5b5ded6ae42c1a379ddcce7a9a67fb
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
27 #ifndef CHART_FORMATTEDSTRING_HXX
28 #define CHART_FORMATTEDSTRING_HXX
30 #include "MutexContainer.hxx"
31 #include "OPropertySet.hxx"
32 #include <cppuhelper/implbase5.hxx>
33 #include <comphelper/uno3.hxx>
34 #include "ServiceMacros.hxx"
35 #include "ModifyListenerHelper.hxx"
36 #include <com/sun/star/lang/XServiceInfo.hpp>
37 #include <com/sun/star/chart2/XFormattedString.hpp>
38 #include <com/sun/star/util/XCloneable.hpp>
39 #include <com/sun/star/uno/XComponentContext.hpp>
41 namespace chart
44 namespace impl
46 typedef ::cppu::WeakImplHelper5<
47 ::com::sun::star::chart2::XFormattedString,
48 ::com::sun::star::lang::XServiceInfo,
49 ::com::sun::star::util::XCloneable,
50 ::com::sun::star::util::XModifyBroadcaster,
51 ::com::sun::star::util::XModifyListener >
52 FormattedString_Base;
55 class FormattedString :
56 public MutexContainer,
57 public impl::FormattedString_Base,
58 public ::property::OPropertySet
60 public:
61 FormattedString( ::com::sun::star::uno::Reference<
62 ::com::sun::star::uno::XComponentContext > const & xContext );
63 virtual ~FormattedString();
65 /// declare XServiceInfo methods
66 APPHELPER_XSERVICEINFO_DECL()
67 /// establish methods for factory instatiation
68 APPHELPER_SERVICE_FACTORY_HELPER( FormattedString )
70 /// merge XInterface implementations
71 DECLARE_XINTERFACE()
72 /// merge XTypeProvider implementations
73 DECLARE_XTYPEPROVIDER()
75 protected:
76 explicit FormattedString( const FormattedString & rOther );
78 // ____ XFormattedString ____
79 virtual ::rtl::OUString SAL_CALL getString()
80 throw (::com::sun::star::uno::RuntimeException);
81 virtual void SAL_CALL setString( const ::rtl::OUString& String )
82 throw (::com::sun::star::uno::RuntimeException);
84 // ____ OPropertySet ____
85 virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const
86 throw(::com::sun::star::beans::UnknownPropertyException);
88 // ____ OPropertySet ____
89 virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
91 // ____ XPropertySet ____
92 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL
93 getPropertySetInfo()
94 throw (::com::sun::star::uno::RuntimeException);
96 // virtual sal_Bool SAL_CALL convertFastPropertyValue
97 // ( ::com::sun::star::uno::Any & rConvertedValue,
98 // ::com::sun::star::uno::Any & rOldValue,
99 // sal_Int32 nHandle,
100 // const ::com::sun::star::uno::Any& rValue )
101 // throw (::com::sun::star::lang::IllegalArgumentException);
103 // ____ XCloneable ____
104 virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone()
105 throw (::com::sun::star::uno::RuntimeException);
107 // ____ XModifyBroadcaster ____
108 virtual void SAL_CALL addModifyListener(
109 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
110 throw (::com::sun::star::uno::RuntimeException);
111 virtual void SAL_CALL removeModifyListener(
112 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
113 throw (::com::sun::star::uno::RuntimeException);
115 // ____ XModifyListener ____
116 virtual void SAL_CALL modified(
117 const ::com::sun::star::lang::EventObject& aEvent )
118 throw (::com::sun::star::uno::RuntimeException);
120 // ____ XEventListener (base of XModifyListener) ____
121 virtual void SAL_CALL disposing(
122 const ::com::sun::star::lang::EventObject& Source )
123 throw (::com::sun::star::uno::RuntimeException);
125 // ____ OPropertySet ____
126 virtual void firePropertyChangeEvent();
127 using OPropertySet::disposing;
129 void fireModifyEvent();
131 private:
132 ::rtl::OUString m_aString;
134 ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > m_xModifyEventForwarder;
137 } // namespace chart
139 // CHART_FORMATTEDSTRING_HXX
140 #endif