1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
19 #ifndef INCLUDED_REPORTDESIGN_SOURCE_CORE_INC_REPORTENGINEJFREE_HXX
20 #define INCLUDED_REPORTDESIGN_SOURCE_CORE_INC_REPORTENGINEJFREE_HXX
22 #include <sal/config.h>
26 #include <com/sun/star/report/XReportEngine.hpp>
27 #include <cppuhelper/compbase2.hxx>
28 #include <comphelper/broadcasthelper.hxx>
29 #include <comphelper/uno3.hxx>
30 #include <comphelper/types.hxx>
31 #include <cppuhelper/propertysetmixin.hxx>
32 #include <com/sun/star/uno/XComponentContext.hpp>
33 #include <com/sun/star/sdbc/XRowSet.hpp>
34 #include <comphelper/stl_types.hxx>
35 #include <com/sun/star/lang/XServiceInfo.hpp>
36 #include <rtl/ref.hxx>
38 namespace reportdesign
40 typedef ::cppu::WeakComponentImplHelper2
< com::sun::star::report::XReportEngine
41 ,com::sun::star::lang::XServiceInfo
> ReportEngineBase
;
42 typedef ::cppu::PropertySetMixin
<com::sun::star::report::XReportEngine
> ReportEnginePropertySet
;
44 class OReportEngineJFree
: public comphelper::OMutexAndBroadcastHelper
,
45 public ReportEngineBase
,
46 public ReportEnginePropertySet
48 typedef ::std::multimap
< OUString
, ::com::sun::star::uno::Any
, ::comphelper::UStringMixLess
> TComponentMap
;
49 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> m_xContext
;
50 ::com::sun::star::uno::Reference
< ::com::sun::star::report::XReportDefinition
> m_xReport
;
51 ::com::sun::star::uno::Reference
< ::com::sun::star::task::XStatusIndicator
> m_StatusIndicator
;
52 ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XConnection
> m_xActiveConnection
;
53 ::sal_Int32 m_nMaxRows
;
55 OReportEngineJFree(const OReportEngineJFree
&) SAL_DELETED_FUNCTION
;
56 OReportEngineJFree
& operator=(const OReportEngineJFree
&) SAL_DELETED_FUNCTION
;
57 template <typename T
> void set( const OUString
& _sProperty
63 ::osl::MutexGuard
aGuard(m_aMutex
);
64 prepareSet(_sProperty
, ::com::sun::star::uno::makeAny(_member
), ::com::sun::star::uno::makeAny(_Value
), &l
);
70 /** returns the file url for a new model
72 * \return The new file url.
74 OUString
getNewOutputName();
77 // TODO: VirtualFunctionFinder: This is virtual function!
79 virtual ~OReportEngineJFree();
81 typedef rtl::Reference
<OReportEngineJFree
> TReportEngine
;
83 OReportEngineJFree(const com::sun::star::uno::Reference
< com::sun::star::uno::XComponentContext
>& context
);
86 // ::com::sun::star::lang::XServiceInfo
87 virtual sal_Bool SAL_CALL
supportsService( const OUString
& ServiceName
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
88 virtual OUString SAL_CALL
getImplementationName( ) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
89 virtual ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
91 static ::com::sun::star::uno::Sequence
< OUString
> getSupportedServiceNames_Static() throw( ::com::sun::star::uno::RuntimeException
);
92 static OUString
getImplementationName_Static() throw( ::com::sun::star::uno::RuntimeException
);
93 static ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
> SAL_CALL
94 create(::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> const & xContext
);
96 // com::sun::star::beans::XPropertySet
97 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
98 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
;
99 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
;
100 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
;
101 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
;
102 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
;
103 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
;
107 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::report::XReportDefinition
> SAL_CALL
getReportDefinition() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
108 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
, std::exception
) SAL_OVERRIDE
;
109 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XConnection
> SAL_CALL
getActiveConnection() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
110 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
, std::exception
) SAL_OVERRIDE
;
111 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::task::XStatusIndicator
> SAL_CALL
getStatusIndicator() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
112 virtual void SAL_CALL
setStatusIndicator( const ::com::sun::star::uno::Reference
< ::com::sun::star::task::XStatusIndicator
>& _statusindicator
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
113 virtual ::sal_Int32 SAL_CALL
getMaxRows() throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
114 virtual void SAL_CALL
setMaxRows( ::sal_Int32 _MaxRows
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
116 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
, std::exception
) SAL_OVERRIDE
;
117 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
, std::exception
) SAL_OVERRIDE
;
118 ::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
) ;
119 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
, std::exception
) SAL_OVERRIDE
;
120 virtual void SAL_CALL
interrupt( ) throw (::com::sun::star::lang::DisposedException
, ::com::sun::star::uno::Exception
, ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
123 virtual void SAL_CALL
dispose() throw(::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
124 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
126 cppu::WeakComponentImplHelperBase::addEventListener(aListener
);
128 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
130 cppu::WeakComponentImplHelperBase::removeEventListener(aListener
);
134 #endif // INCLUDED_REPORTDESIGN_SOURCE_CORE_INC_REPORTENGINEJFREE_HXX
136 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */