lok: vcl: fix multiple floatwin removal case more robustly.
[LibreOffice.git] / reportdesign / source / core / inc / ReportEngineJFree.hxx
blob2347bd702b4d26ce268c646172864992e0e5f6d6
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 .
19 #ifndef INCLUDED_REPORTDESIGN_SOURCE_CORE_INC_REPORTENGINEJFREE_HXX
20 #define INCLUDED_REPORTDESIGN_SOURCE_CORE_INC_REPORTENGINEJFREE_HXX
22 #include <sal/config.h>
24 #include <map>
26 #include <com/sun/star/report/XReportEngine.hpp>
27 #include <cppuhelper/compbase.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 <com/sun/star/lang/XServiceInfo.hpp>
35 #include <rtl/ref.hxx>
37 namespace reportdesign
39 typedef ::cppu::WeakComponentImplHelper< css::report::XReportEngine
40 ,css::lang::XServiceInfo> ReportEngineBase;
41 typedef ::cppu::PropertySetMixin<css::report::XReportEngine> ReportEnginePropertySet;
43 class OReportEngineJFree : public comphelper::OMutexAndBroadcastHelper,
44 public ReportEngineBase,
45 public ReportEnginePropertySet
47 css::uno::Reference< css::uno::XComponentContext > m_xContext;
48 css::uno::Reference< css::report::XReportDefinition > m_xReport;
49 css::uno::Reference< css::task::XStatusIndicator> m_StatusIndicator;
50 css::uno::Reference< css::sdbc::XConnection > m_xActiveConnection;
51 ::sal_Int32 m_nMaxRows;
52 private:
53 OReportEngineJFree(const OReportEngineJFree&) = delete;
54 OReportEngineJFree& operator=(const OReportEngineJFree&) = delete;
55 template <typename T> void set( const OUString& _sProperty
56 ,const T& Value
57 ,T& _member)
59 BoundListeners l;
61 ::osl::MutexGuard aGuard(m_aMutex);
62 prepareSet(_sProperty, css::uno::makeAny(_member), css::uno::makeAny(Value), &l);
63 _member = Value;
65 l.notify();
68 /** returns the file url for a new model
70 * \return The new file url.
72 OUString getNewOutputName();
74 protected:
75 // TODO: VirtualFunctionFinder: This is virtual function!
77 virtual ~OReportEngineJFree() override;
78 public:
79 OReportEngineJFree(const css::uno::Reference< css::uno::XComponentContext >& context);
81 DECLARE_XINTERFACE( )
82 // css::lang::XServiceInfo
83 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
84 virtual OUString SAL_CALL getImplementationName( ) override;
85 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
87 /// @throws css::uno::RuntimeException
88 static css::uno::Sequence< OUString > getSupportedServiceNames_Static();
89 /// @throws css::uno::RuntimeException
90 static OUString getImplementationName_Static();
91 static css::uno::Reference< css::uno::XInterface >
92 create(css::uno::Reference< css::uno::XComponentContext > const & xContext);
93 private:
94 // css::beans::XPropertySet
95 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
96 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
97 virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
98 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
99 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
100 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
101 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
103 // XReportEngine
104 // Attributes
105 virtual css::uno::Reference< css::report::XReportDefinition > SAL_CALL getReportDefinition() override ;
106 virtual void SAL_CALL setReportDefinition( const css::uno::Reference< css::report::XReportDefinition >& _reportdefinition ) override;
107 virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL getActiveConnection() override;
108 virtual void SAL_CALL setActiveConnection( const css::uno::Reference< css::sdbc::XConnection >& _activeconnection ) override;
109 virtual css::uno::Reference< css::task::XStatusIndicator > SAL_CALL getStatusIndicator() override ;
110 virtual void SAL_CALL setStatusIndicator( const css::uno::Reference< css::task::XStatusIndicator >& _statusindicator ) override ;
111 virtual ::sal_Int32 SAL_CALL getMaxRows() override;
112 virtual void SAL_CALL setMaxRows( ::sal_Int32 MaxRows ) override;
113 // Methods
114 virtual css::uno::Reference< css::frame::XModel > SAL_CALL createDocumentModel( ) override ;
115 virtual css::uno::Reference< css::frame::XModel > SAL_CALL createDocumentAlive( const css::uno::Reference< css::frame::XFrame >& _frame ) override ;
116 /// @throws css::lang::DisposedException
117 /// @throws css::lang::IllegalArgumentException
118 /// @throws css::uno::Exception
119 /// @throws css::uno::RuntimeException
120 css::uno::Reference< css::frame::XModel > createDocumentAlive( const css::uno::Reference< css::frame::XFrame >& _frame ,bool _bHidden) ;
121 virtual css::util::URL SAL_CALL createDocument( ) override ;
122 virtual void SAL_CALL interrupt( ) override ;
124 // XComponent
125 virtual void SAL_CALL dispose() override;
126 virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > & aListener) override
128 cppu::WeakComponentImplHelperBase::addEventListener(aListener);
130 virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > & aListener) override
132 cppu::WeakComponentImplHelperBase::removeEventListener(aListener);
136 #endif // INCLUDED_REPORTDESIGN_SOURCE_CORE_INC_REPORTENGINEJFREE_HXX
138 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */