merge the formfield patch from ooo-build
[ooovba.git] / chart2 / source / model / main / FormattedString.hxx
blob4739b87f79172ee236311bc83c8f71cf9f1b7037
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: FormattedString.hxx,v $
10 * $Revision: 1.6.44.1 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef CHART_FORMATTEDSTRING_HXX
31 #define CHART_FORMATTEDSTRING_HXX
33 #include "MutexContainer.hxx"
34 #include "OPropertySet.hxx"
35 #include <cppuhelper/implbase5.hxx>
36 #include <comphelper/uno3.hxx>
37 #include "ServiceMacros.hxx"
38 #include "ModifyListenerHelper.hxx"
39 #include <com/sun/star/lang/XServiceInfo.hpp>
40 #include <com/sun/star/chart2/XFormattedString.hpp>
41 #include <com/sun/star/util/XCloneable.hpp>
42 #include <com/sun/star/uno/XComponentContext.hpp>
44 namespace chart
47 namespace impl
49 typedef ::cppu::WeakImplHelper5<
50 ::com::sun::star::chart2::XFormattedString,
51 ::com::sun::star::lang::XServiceInfo,
52 ::com::sun::star::util::XCloneable,
53 ::com::sun::star::util::XModifyBroadcaster,
54 ::com::sun::star::util::XModifyListener >
55 FormattedString_Base;
58 class FormattedString :
59 public MutexContainer,
60 public impl::FormattedString_Base,
61 public ::property::OPropertySet
63 public:
64 FormattedString( ::com::sun::star::uno::Reference<
65 ::com::sun::star::uno::XComponentContext > const & xContext );
66 virtual ~FormattedString();
68 /// declare XServiceInfo methods
69 APPHELPER_XSERVICEINFO_DECL()
70 /// establish methods for factory instatiation
71 APPHELPER_SERVICE_FACTORY_HELPER( FormattedString )
73 /// merge XInterface implementations
74 DECLARE_XINTERFACE()
75 /// merge XTypeProvider implementations
76 DECLARE_XTYPEPROVIDER()
78 protected:
79 explicit FormattedString( const FormattedString & rOther );
81 // ____ XFormattedString ____
82 virtual ::rtl::OUString SAL_CALL getString()
83 throw (::com::sun::star::uno::RuntimeException);
84 virtual void SAL_CALL setString( const ::rtl::OUString& String )
85 throw (::com::sun::star::uno::RuntimeException);
87 // ____ OPropertySet ____
88 virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const
89 throw(::com::sun::star::beans::UnknownPropertyException);
91 // ____ OPropertySet ____
92 virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
94 // ____ XPropertySet ____
95 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL
96 getPropertySetInfo()
97 throw (::com::sun::star::uno::RuntimeException);
99 // virtual sal_Bool SAL_CALL convertFastPropertyValue
100 // ( ::com::sun::star::uno::Any & rConvertedValue,
101 // ::com::sun::star::uno::Any & rOldValue,
102 // sal_Int32 nHandle,
103 // const ::com::sun::star::uno::Any& rValue )
104 // throw (::com::sun::star::lang::IllegalArgumentException);
106 // ____ XCloneable ____
107 virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone()
108 throw (::com::sun::star::uno::RuntimeException);
110 // ____ XModifyBroadcaster ____
111 virtual void SAL_CALL addModifyListener(
112 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
113 throw (::com::sun::star::uno::RuntimeException);
114 virtual void SAL_CALL removeModifyListener(
115 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener )
116 throw (::com::sun::star::uno::RuntimeException);
118 // ____ XModifyListener ____
119 virtual void SAL_CALL modified(
120 const ::com::sun::star::lang::EventObject& aEvent )
121 throw (::com::sun::star::uno::RuntimeException);
123 // ____ XEventListener (base of XModifyListener) ____
124 virtual void SAL_CALL disposing(
125 const ::com::sun::star::lang::EventObject& Source )
126 throw (::com::sun::star::uno::RuntimeException);
128 // ____ OPropertySet ____
129 virtual void firePropertyChangeEvent();
130 using OPropertySet::disposing;
132 void fireModifyEvent();
134 private:
135 ::rtl::OUString m_aString;
137 ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > m_xModifyEventForwarder;
140 } // namespace chart
142 // CHART_FORMATTEDSTRING_HXX
143 #endif