1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: FixedLine.hxx,v $
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 RPT_FIXEDLINE_HXX
31 #define RPT_FIXEDLINE_HXX
33 #include <cppuhelper/propertysetmixin.hxx>
34 #include <com/sun/star/report/XFixedLine.hpp>
35 #include "ReportControlModel.hxx"
36 #include <cppuhelper/compbase2.hxx>
37 #include <comphelper/broadcasthelper.hxx>
38 #include <com/sun/star/lang/XServiceInfo.hpp>
39 #include "ReportHelperDefines.hxx"
42 namespace reportdesign
44 typedef ::cppu::PropertySetMixin
< com::sun::star::report::XFixedLine
> FixedLinePropertySet
;
45 typedef ::cppu::WeakComponentImplHelper2
< com::sun::star::report::XFixedLine
46 ,com::sun::star::lang::XServiceInfo
> FixedLineBase
;
48 /** \class OFixedLine Defines the implementation of a \interface com:::sun::star::report::XFixedLine
49 * \ingroup reportdesign_api
52 class OFixedLine
: public comphelper::OBaseMutex
,
54 public FixedLinePropertySet
56 friend class OShapeHelper
;
57 OReportControlModel m_aProps
;
58 ::com::sun::star::drawing::LineStyle m_LineStyle
;
59 ::com::sun::star::drawing::LineDash m_LineDash
;
60 sal_Int32 m_nOrientation
;
61 ::sal_Int32 m_LineColor
;
62 ::sal_Int16 m_LineTransparence
;
63 ::sal_Int32 m_LineWidth
;
66 OFixedLine(const OFixedLine
&);
67 OFixedLine
& operator=(const OFixedLine
&);
69 template <typename T
> void set( const ::rtl::OUString
& _sProperty
75 ::osl::MutexGuard
aGuard(m_aMutex
);
76 prepareSet(_sProperty
, ::com::sun::star::uno::makeAny(_member
), ::com::sun::star::uno::makeAny(_Value
), &l
);
81 void checkIndex(sal_Int32 _nIndex
);
83 virtual ~OFixedLine();
85 explicit OFixedLine(::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> const & _xContext
);
86 explicit OFixedLine(::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> const & _xContext
87 ,const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
> & _xFactory
88 ,::com::sun::star::uno::Reference
< ::com::sun::star::drawing::XShape
>& _xShape
89 ,sal_Int32 _nOrientation
);
92 // ::com::sun::star::lang::XServiceInfo
93 virtual ::sal_Bool SAL_CALL
supportsService( const ::rtl::OUString
& ServiceName
) throw (::com::sun::star::uno::RuntimeException
);
94 virtual ::rtl::OUString SAL_CALL
getImplementationName( ) throw(::com::sun::star::uno::RuntimeException
);
95 virtual ::com::sun::star::uno::Sequence
< ::rtl::OUString
> SAL_CALL
getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException
);
97 static ::com::sun::star::uno::Sequence
< ::rtl::OUString
> getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException
);
98 static ::rtl::OUString
getImplementationName_Static(void) throw( ::com::sun::star::uno::RuntimeException
);
99 static ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
> SAL_CALL
100 create(::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> const & xContext
);
101 // com::sun::star::beans::XPropertySet
102 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException
);
103 virtual void SAL_CALL
setPropertyValue( const ::rtl::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
);
104 virtual ::com::sun::star::uno::Any SAL_CALL
getPropertyValue( const ::rtl::OUString
& PropertyName
) throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
105 virtual void SAL_CALL
addPropertyChangeListener( const ::rtl::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
);
106 virtual void SAL_CALL
removePropertyChangeListener( const ::rtl::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
);
107 virtual void SAL_CALL
addVetoableChangeListener( const ::rtl::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
);
108 virtual void SAL_CALL
removeVetoableChangeListener( const ::rtl::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
);
111 REPORTCOMPONENT_HEADER()
117 virtual ::rtl::OUString SAL_CALL
getShapeType( ) throw (::com::sun::star::uno::RuntimeException
);
119 // XReportControlModel
120 REPORTCONTROLMODEL_HEADER()
123 virtual ::sal_Int32 SAL_CALL
getOrientation() throw (::com::sun::star::beans::UnknownPropertyException
,::com::sun::star::uno::RuntimeException
);
124 virtual void SAL_CALL
setOrientation( ::sal_Int32 _orientation
) throw (::com::sun::star::beans::UnknownPropertyException
,::com::sun::star::uno::RuntimeException
);
125 virtual ::com::sun::star::drawing::LineStyle SAL_CALL
getLineStyle() throw (::com::sun::star::uno::RuntimeException
);
126 virtual void SAL_CALL
setLineStyle( ::com::sun::star::drawing::LineStyle _linestyle
) throw (::com::sun::star::uno::RuntimeException
);
127 virtual ::com::sun::star::drawing::LineDash SAL_CALL
getLineDash() throw (::com::sun::star::uno::RuntimeException
);
128 virtual void SAL_CALL
setLineDash( const ::com::sun::star::drawing::LineDash
& _linedash
) throw (::com::sun::star::uno::RuntimeException
);
129 virtual ::sal_Int32 SAL_CALL
getLineColor() throw (::com::sun::star::uno::RuntimeException
);
130 virtual void SAL_CALL
setLineColor( ::sal_Int32 _linecolor
) throw (::com::sun::star::uno::RuntimeException
);
131 virtual ::sal_Int16 SAL_CALL
getLineTransparence() throw (::com::sun::star::uno::RuntimeException
);
132 virtual void SAL_CALL
setLineTransparence( ::sal_Int16 _linetransparence
) throw (::com::sun::star::uno::RuntimeException
);
133 virtual ::sal_Int32 SAL_CALL
getLineWidth() throw (::com::sun::star::uno::RuntimeException
);
134 virtual void SAL_CALL
setLineWidth( ::sal_Int32 _linewidth
) throw (::com::sun::star::uno::RuntimeException
);
136 // ::com::sun::star::report::XReportControlFormat
137 REPORTCONTROLFORMAT_HEADER()
140 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::util::XCloneable
> SAL_CALL
createClone( ) throw (::com::sun::star::uno::RuntimeException
);
143 virtual void SAL_CALL
dispose() throw(::com::sun::star::uno::RuntimeException
);
144 virtual void SAL_CALL
addEventListener(const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XEventListener
> & aListener
) throw(::com::sun::star::uno::RuntimeException
)
146 cppu::WeakComponentImplHelperBase::addEventListener(aListener
);
148 virtual void SAL_CALL
removeEventListener(const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XEventListener
> & aListener
) throw(::com::sun::star::uno::RuntimeException
)
150 cppu::WeakComponentImplHelperBase::removeEventListener(aListener
);
154 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
> SAL_CALL
getParent( ) throw (::com::sun::star::uno::RuntimeException
);
155 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
);
158 virtual void SAL_CALL
addContainerListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::container::XContainerListener
>& xListener
) throw (::com::sun::star::uno::RuntimeException
);
159 virtual void SAL_CALL
removeContainerListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::container::XContainerListener
>& xListener
) throw (::com::sun::star::uno::RuntimeException
);
162 virtual ::com::sun::star::uno::Type SAL_CALL
getElementType( ) throw (::com::sun::star::uno::RuntimeException
);
163 virtual ::sal_Bool SAL_CALL
hasElements( ) throw (::com::sun::star::uno::RuntimeException
);
166 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
);
169 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
);
170 virtual void SAL_CALL
removeByIndex( ::sal_Int32 Index
) throw (::com::sun::star::lang::IndexOutOfBoundsException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
);
173 virtual ::sal_Int32 SAL_CALL
getCount( ) throw (::com::sun::star::uno::RuntimeException
);
174 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
);
177 #endif //RPT_FIXEDLINE_HXX