bump product version to 5.0.4.1
[LibreOffice.git] / reportdesign / source / core / inc / FixedText.hxx
blob2b19fab22956bfdbf19151bae4c0da8a9d2bf8f1
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
20 #ifndef INCLUDED_REPORTDESIGN_SOURCE_CORE_INC_FIXEDTEXT_HXX
21 #define INCLUDED_REPORTDESIGN_SOURCE_CORE_INC_FIXEDTEXT_HXX
23 #include <cppuhelper/propertysetmixin.hxx>
24 #include <com/sun/star/report/XFixedText.hpp>
25 #include "ReportControlModel.hxx"
26 #include <cppuhelper/compbase2.hxx>
27 #include <comphelper/broadcasthelper.hxx>
28 #include <com/sun/star/lang/XServiceInfo.hpp>
29 #include "ReportHelperDefines.hxx"
32 namespace reportdesign
34 typedef ::cppu::PropertySetMixin< com::sun::star::report::XFixedText > FixedTextPropertySet;
35 typedef ::cppu::WeakComponentImplHelper2< com::sun::star::report::XFixedText
36 ,com::sun::star::lang::XServiceInfo > FixedTextBase;
38 /** \class OFixedText Defines the implementation of a \interface com:::sun::star::report::XFixedText
39 * \ingroup reportdesign_api
42 class OFixedText : public comphelper::OBaseMutex,
43 public FixedTextBase,
44 public FixedTextPropertySet
46 friend class OShapeHelper;
47 OReportControlModel m_aProps;
48 OUString m_sLabel;
49 private:
50 OFixedText(const OFixedText&) SAL_DELETED_FUNCTION;
51 OFixedText& operator=(const OFixedText&) SAL_DELETED_FUNCTION;
53 template <typename T> void set( const OUString& _sProperty
54 ,const T& _Value
55 ,T& _member)
57 BoundListeners l;
59 ::osl::MutexGuard aGuard(m_aMutex);
60 if ( _member != _Value )
62 prepareSet(_sProperty, ::com::sun::star::uno::makeAny(_member), ::com::sun::star::uno::makeAny(_Value), &l);
63 _member = _Value;
66 l.notify();
68 void set( const OUString& _sProperty
69 ,bool _Value
70 ,bool& _member)
72 BoundListeners l;
74 ::osl::MutexGuard aGuard(m_aMutex);
75 if ( _member != _Value )
77 prepareSet(_sProperty, ::com::sun::star::uno::makeAny(_member), ::com::sun::star::uno::makeAny(_Value), &l);
78 _member = _Value;
81 l.notify();
83 void checkIndex(sal_Int32 _nIndex);
84 protected:
85 virtual ~OFixedText();
86 public:
87 explicit OFixedText(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & _xContext);
88 explicit OFixedText(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & _xContext
89 ,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & _xFactory
90 ,::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape >& _xShape);
92 DECLARE_XINTERFACE( )
93 // ::com::sun::star::lang::XServiceInfo
94 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
95 virtual OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
96 virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
98 static ::com::sun::star::uno::Sequence< OUString > getSupportedServiceNames_Static() throw( ::com::sun::star::uno::RuntimeException );
99 static OUString getImplementationName_Static() throw( ::com::sun::star::uno::RuntimeException );
100 static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
101 create(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & xContext);
102 // com::sun::star::beans::XPropertySet
103 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
104 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
105 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
106 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
107 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
108 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
109 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
111 // XReportComponent
112 REPORTCOMPONENT_HEADER()
113 // XShape
114 SHAPE_HEADER()
116 // XShapeDescriptor
117 virtual OUString SAL_CALL getShapeType( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
119 // XReportControlModel
120 REPORTCONTROLMODEL_HEADER()
122 // XCloneable
123 virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
125 // XFixedText
126 virtual OUString SAL_CALL getLabel() throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
127 virtual void SAL_CALL setLabel( const OUString& _label ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
129 // ::com::sun::star::report::XReportControlFormat
130 REPORTCONTROLFORMAT_HEADER()
132 // XComponent
133 virtual void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
134 virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
136 cppu::WeakComponentImplHelperBase::addEventListener(aListener);
138 virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE
140 cppu::WeakComponentImplHelperBase::removeEventListener(aListener);
143 // XChild
144 virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
145 virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Parent ) throw (::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
146 // XContainer
147 virtual void SAL_CALL addContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
148 virtual void SAL_CALL removeContainerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener >& xListener ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
150 // XElementAccess
151 virtual ::com::sun::star::uno::Type SAL_CALL getElementType( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
152 virtual sal_Bool SAL_CALL hasElements( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
154 // XIndexReplace
155 virtual void SAL_CALL replaceByIndex( ::sal_Int32 Index, const ::com::sun::star::uno::Any& Element ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
157 // XIndexContainer
158 virtual void SAL_CALL insertByIndex( ::sal_Int32 Index, const ::com::sun::star::uno::Any& Element ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
159 virtual void SAL_CALL removeByIndex( ::sal_Int32 Index ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
161 // XIndexAccess
162 virtual ::sal_Int32 SAL_CALL getCount( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
163 virtual ::com::sun::star::uno::Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (::com::sun::star::lang::IndexOutOfBoundsException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
166 #endif // INCLUDED_REPORTDESIGN_SOURCE_CORE_INC_FIXEDTEXT_HXX
168 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */