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: ReportEngineJFree.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 REPORTDESIGN_API_REPORTENGINEJFREE_HXX
31 #define REPORTDESIGN_API_REPORTENGINEJFREE_HXX
33 #include <com/sun/star/report/XReportEngine.hpp>
34 #include <cppuhelper/compbase2.hxx>
35 #include <comphelper/broadcasthelper.hxx>
36 #include <comphelper/uno3.hxx>
37 #include <comphelper/types.hxx>
38 #include <cppuhelper/propertysetmixin.hxx>
39 #include <com/sun/star/uno/XComponentContext.hpp>
40 #include <com/sun/star/sdbc/XRowSet.hpp>
41 #include <comphelper/stl_types.hxx>
42 #include <comphelper/implementationreference.hxx>
43 #include <com/sun/star/lang/XServiceInfo.hpp>
45 namespace reportdesign
47 typedef ::cppu::WeakComponentImplHelper2
< com::sun::star::report::XReportEngine
48 ,com::sun::star::lang::XServiceInfo
> ReportEngineBase
;
49 typedef ::cppu::PropertySetMixin
<com::sun::star::report::XReportEngine
> ReportEnginePropertySet
;
51 class OReportEngineJFree
: public comphelper::OMutexAndBroadcastHelper
,
52 public ReportEngineBase
,
53 public ReportEnginePropertySet
55 typedef ::std::multimap
< ::rtl::OUString
, ::com::sun::star::uno::Any
, ::comphelper::UStringMixLess
> TComponentMap
;
56 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> m_xContext
;
57 ::com::sun::star::uno::Reference
< ::com::sun::star::report::XReportDefinition
> m_xReport
;
58 ::com::sun::star::uno::Reference
< ::com::sun::star::task::XStatusIndicator
> m_StatusIndicator
;
59 ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XConnection
> m_xActiveConnection
;
61 OReportEngineJFree(const OReportEngineJFree
&);
62 OReportEngineJFree
& operator=(const OReportEngineJFree
&);
63 template <typename T
> void set( const ::rtl::OUString
& _sProperty
69 ::osl::MutexGuard
aGuard(m_aMutex
);
70 prepareSet(_sProperty
, ::com::sun::star::uno::makeAny(_member
), ::com::sun::star::uno::makeAny(_Value
), &l
);
76 /** returns the file url for a new model
78 * \return The new file url.
80 ::rtl::OUString
getNewOutputName();
83 // TODO: VirtualFunctionFinder: This is virtual function!
85 virtual ~OReportEngineJFree();
87 typedef ::comphelper::ImplementationReference
< OReportEngineJFree
,::com::sun::star::report::XReportEngine
,::com::sun::star::uno::XWeak
> TReportEngine
;
89 OReportEngineJFree(const com::sun::star::uno::Reference
< com::sun::star::uno::XComponentContext
>& context
);
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
);
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
);
104 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
);
105 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
);
106 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
);
107 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
);
108 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
);
109 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
);
113 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::report::XReportDefinition
> SAL_CALL
getReportDefinition() throw (::com::sun::star::uno::RuntimeException
) ;
114 virtual void SAL_CALL
setReportDefinition( const ::com::sun::star::uno::Reference
< ::com::sun::star::report::XReportDefinition
>& _reportdefinition
) throw (::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::uno::RuntimeException
);
115 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XConnection
> SAL_CALL
getActiveConnection() throw (::com::sun::star::uno::RuntimeException
);
116 virtual void SAL_CALL
setActiveConnection( const ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XConnection
>& _activeconnection
) throw (::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::uno::RuntimeException
);
117 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::task::XStatusIndicator
> SAL_CALL
getStatusIndicator() throw (::com::sun::star::uno::RuntimeException
) ;
118 virtual void SAL_CALL
setStatusIndicator( const ::com::sun::star::uno::Reference
< ::com::sun::star::task::XStatusIndicator
>& _statusindicator
) throw (::com::sun::star::uno::RuntimeException
) ;
120 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XModel
> SAL_CALL
createDocumentModel( ) throw (::com::sun::star::lang::DisposedException
, ::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::uno::Exception
, ::com::sun::star::uno::RuntimeException
) ;
121 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XModel
> SAL_CALL
createDocumentAlive( const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
>& _frame
) throw (::com::sun::star::lang::DisposedException
, ::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::uno::Exception
, ::com::sun::star::uno::RuntimeException
) ;
122 ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XModel
> SAL_CALL
createDocumentAlive( const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
>& _frame
,bool _bHidden
) throw (::com::sun::star::lang::DisposedException
, ::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::uno::Exception
, ::com::sun::star::uno::RuntimeException
) ;
123 virtual ::com::sun::star::util::URL SAL_CALL
createDocument( ) throw (::com::sun::star::lang::DisposedException
, ::com::sun::star::lang::IllegalArgumentException
, ::com::sun::star::uno::Exception
, ::com::sun::star::uno::RuntimeException
) ;
124 virtual void SAL_CALL
interrupt( ) throw (::com::sun::star::lang::DisposedException
, ::com::sun::star::uno::Exception
, ::com::sun::star::uno::RuntimeException
) ;
127 virtual void SAL_CALL
dispose() throw(::com::sun::star::uno::RuntimeException
);
128 virtual void SAL_CALL
addEventListener(const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XEventListener
> & aListener
) throw(::com::sun::star::uno::RuntimeException
)
130 cppu::WeakComponentImplHelperBase::addEventListener(aListener
);
132 virtual void SAL_CALL
removeEventListener(const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XEventListener
> & aListener
) throw(::com::sun::star::uno::RuntimeException
)
134 cppu::WeakComponentImplHelperBase::removeEventListener(aListener
);
138 #endif //REPORTDESIGN_API_REPORTENGINEJFREE_HXX