Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*
3 : : * This file is part of the LibreOffice project.
4 : : *
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/.
8 : : *
9 : : * This file incorporates work covered by the following license notice:
10 : : *
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 .
18 : : */
19 : : #ifndef REPORTDESIGN_API_REPORTENGINEJFREE_HXX
20 : : #define REPORTDESIGN_API_REPORTENGINEJFREE_HXX
21 : :
22 : : #include <com/sun/star/report/XReportEngine.hpp>
23 : : #include <cppuhelper/compbase2.hxx>
24 : : #include <comphelper/broadcasthelper.hxx>
25 : : #include <comphelper/uno3.hxx>
26 : : #include <comphelper/types.hxx>
27 : : #include <cppuhelper/propertysetmixin.hxx>
28 : : #include <com/sun/star/uno/XComponentContext.hpp>
29 : : #include <com/sun/star/sdbc/XRowSet.hpp>
30 : : #include <comphelper/stl_types.hxx>
31 : : #include <comphelper/implementationreference.hxx>
32 : : #include <com/sun/star/lang/XServiceInfo.hpp>
33 : :
34 : : namespace reportdesign
35 : : {
36 : : typedef ::cppu::WeakComponentImplHelper2< com::sun::star::report::XReportEngine
37 : : ,com::sun::star::lang::XServiceInfo> ReportEngineBase;
38 : : typedef ::cppu::PropertySetMixin<com::sun::star::report::XReportEngine> ReportEnginePropertySet;
39 : :
40 : : class OReportEngineJFree : public comphelper::OMutexAndBroadcastHelper,
41 : : public ReportEngineBase,
42 : : public ReportEnginePropertySet
43 : : {
44 : : typedef ::std::multimap< ::rtl::OUString, ::com::sun::star::uno::Any , ::comphelper::UStringMixLess> TComponentMap;
45 : : ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
46 : : ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition > m_xReport;
47 : : ::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator> m_StatusIndicator;
48 : : ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > m_xActiveConnection;
49 : : ::sal_Int32 m_nMaxRows;
50 : : private:
51 : : OReportEngineJFree(const OReportEngineJFree&);
52 : : OReportEngineJFree& operator=(const OReportEngineJFree&);
53 : 0 : template <typename T> void set( const ::rtl::OUString& _sProperty
54 : : ,const T& _Value
55 : : ,T& _member)
56 : : {
57 [ # # ][ # # ]: 0 : BoundListeners l;
[ # # ]
58 : : {
59 [ # # ][ # # ]: 0 : ::osl::MutexGuard aGuard(m_aMutex);
[ # # ]
60 [ # # ][ # # ]: 0 : prepareSet(_sProperty, ::com::sun::star::uno::makeAny(_member), ::com::sun::star::uno::makeAny(_Value), &l);
[ # # ][ # # ]
[ # # ][ # # ]
[ # # ]
61 [ # # # # ]: 0 : _member = _Value;
[ # # ]
[ # # # # ]
62 : : }
63 [ # # ][ # # ]: 0 : l.notify();
[ # # ][ # # ]
[ # # ][ # # ]
64 : 0 : }
65 : :
66 : : /** returns the file url for a new model
67 : : *
68 : : * \return The new file url.
69 : : */
70 : : ::rtl::OUString getNewOutputName();
71 : :
72 : : protected:
73 : : // TODO: VirtualFunctionFinder: This is virtual function!
74 : : //
75 : : virtual ~OReportEngineJFree();
76 : : public:
77 : : typedef ::comphelper::ImplementationReference< OReportEngineJFree ,::com::sun::star::report::XReportEngine,::com::sun::star::uno::XWeak > TReportEngine;
78 : :
79 : : OReportEngineJFree(const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& context);
80 : :
81 : : DECLARE_XINTERFACE( )
82 : : // ::com::sun::star::lang::XServiceInfo
83 : : virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
84 : : virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
85 : : virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
86 : :
87 : : static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException );
88 : : static ::rtl::OUString getImplementationName_Static(void) throw( ::com::sun::star::uno::RuntimeException );
89 : : static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
90 : : create(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & xContext);
91 : : private:
92 : : // com::sun::star::beans::XPropertySet
93 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
94 : : 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);
95 : : 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);
96 : : 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);
97 : : 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);
98 : : 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);
99 : : 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);
100 : :
101 : : // XReportEngine
102 : : // Attributes
103 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportDefinition > SAL_CALL getReportDefinition() throw (::com::sun::star::uno::RuntimeException) ;
104 : : 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);
105 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > SAL_CALL getActiveConnection() throw (::com::sun::star::uno::RuntimeException);
106 : : 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);
107 : : virtual ::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator > SAL_CALL getStatusIndicator() throw (::com::sun::star::uno::RuntimeException) ;
108 : : virtual void SAL_CALL setStatusIndicator( const ::com::sun::star::uno::Reference< ::com::sun::star::task::XStatusIndicator >& _statusindicator ) throw (::com::sun::star::uno::RuntimeException) ;
109 : : virtual ::sal_Int32 SAL_CALL getMaxRows() throw (::com::sun::star::uno::RuntimeException);
110 : : virtual void SAL_CALL setMaxRows( ::sal_Int32 _MaxRows ) throw (::com::sun::star::uno::RuntimeException);
111 : : // Methods
112 : : 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) ;
113 : : 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) ;
114 : : ::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) ;
115 : : 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) ;
116 : : virtual void SAL_CALL interrupt( ) throw (::com::sun::star::lang::DisposedException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException) ;
117 : :
118 : : // XComponent
119 : : virtual void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException);
120 : 0 : virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw(::com::sun::star::uno::RuntimeException)
121 : : {
122 : 0 : cppu::WeakComponentImplHelperBase::addEventListener(aListener);
123 : 0 : }
124 : 0 : virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw(::com::sun::star::uno::RuntimeException)
125 : : {
126 : 0 : cppu::WeakComponentImplHelperBase::removeEventListener(aListener);
127 : 0 : }
128 : : };
129 : : }
130 : : #endif //REPORTDESIGN_API_REPORTENGINEJFREE_HXX
131 : :
132 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|