LibreOffice Module reportdesign (master)  1
ReportEngineJFree.hxx
Go to the documentation of this file.
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 INCLUDED_REPORTDESIGN_SOURCE_CORE_INC_REPORTENGINEJFREE_HXX
20 #define INCLUDED_REPORTDESIGN_SOURCE_CORE_INC_REPORTENGINEJFREE_HXX
21 
22 #include <sal/config.h>
23 
24 #include <com/sun/star/report/XReportEngine.hpp>
25 #include <cppuhelper/compbase.hxx>
27 #include <comphelper/uno3.hxx>
29 #include <com/sun/star/uno/XComponentContext.hpp>
30 #include <com/sun/star/lang/XServiceInfo.hpp>
31 
32 namespace reportdesign
33 {
34  typedef ::cppu::WeakComponentImplHelper< css::report::XReportEngine
35  ,css::lang::XServiceInfo> ReportEngineBase;
36  typedef ::cppu::PropertySetMixin<css::report::XReportEngine> ReportEnginePropertySet;
37 
39  public ReportEngineBase,
40  public ReportEnginePropertySet
41  {
42  css::uno::Reference< css::uno::XComponentContext > m_xContext;
43  css::uno::Reference< css::report::XReportDefinition > m_xReport;
44  css::uno::Reference< css::task::XStatusIndicator> m_StatusIndicator;
45  css::uno::Reference< css::sdbc::XConnection > m_xActiveConnection;
46  ::sal_Int32 m_nMaxRows;
47  private:
48  OReportEngineJFree(const OReportEngineJFree&) = delete;
50  template <typename T> void set( const OUString& _sProperty
51  ,const T& Value
52  ,T& _member)
53  {
54  BoundListeners l;
55  {
56  ::osl::MutexGuard aGuard(m_aMutex);
57  prepareSet(_sProperty, css::uno::makeAny(_member), css::uno::makeAny(Value), &l);
58  _member = Value;
59  }
60  l.notify();
61  }
62 
67  OUString getNewOutputName();
68 
69  protected:
70  // TODO: VirtualFunctionFinder: This is virtual function!
71 
72  virtual ~OReportEngineJFree() override;
73  public:
74  OReportEngineJFree(const css::uno::Reference< css::uno::XComponentContext >& context);
75 
77  // css::lang::XServiceInfo
78  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
79  virtual OUString SAL_CALL getImplementationName( ) override;
80  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
81 
82  private:
83  // css::beans::XPropertySet
84  virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
85  virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
86  virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
87  virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
88  virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
89  virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
90  virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
91 
92  // XReportEngine
93  // Attributes
94  virtual css::uno::Reference< css::report::XReportDefinition > SAL_CALL getReportDefinition() override ;
95  virtual void SAL_CALL setReportDefinition( const css::uno::Reference< css::report::XReportDefinition >& _reportdefinition ) override;
96  virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL getActiveConnection() override;
97  virtual void SAL_CALL setActiveConnection( const css::uno::Reference< css::sdbc::XConnection >& _activeconnection ) override;
98  virtual css::uno::Reference< css::task::XStatusIndicator > SAL_CALL getStatusIndicator() override ;
99  virtual void SAL_CALL setStatusIndicator( const css::uno::Reference< css::task::XStatusIndicator >& _statusindicator ) override ;
100  virtual ::sal_Int32 SAL_CALL getMaxRows() override;
101  virtual void SAL_CALL setMaxRows( ::sal_Int32 MaxRows ) override;
102  // Methods
103  virtual css::uno::Reference< css::frame::XModel > SAL_CALL createDocumentModel( ) override ;
104  virtual css::uno::Reference< css::frame::XModel > SAL_CALL createDocumentAlive( const css::uno::Reference< css::frame::XFrame >& _frame ) override ;
109  css::uno::Reference< css::frame::XModel > createDocumentAlive( const css::uno::Reference< css::frame::XFrame >& _frame ,bool _bHidden) ;
110  virtual css::util::URL SAL_CALL createDocument( ) override ;
111  virtual void SAL_CALL interrupt( ) override ;
112 
113  // XComponent
114  virtual void SAL_CALL dispose() override;
115  virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > & aListener) override
116  {
117  cppu::WeakComponentImplHelperBase::addEventListener(aListener);
118  }
119  virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > & aListener) override
120  {
121  cppu::WeakComponentImplHelperBase::removeEventListener(aListener);
122  }
123  };
124 }
125 #endif // INCLUDED_REPORTDESIGN_SOURCE_CORE_INC_REPORTENGINEJFREE_HXX
126 
127 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual css::uno::Reference< css::frame::XModel > SAL_CALL createDocumentAlive(const css::uno::Reference< css::frame::XFrame > &_frame) override
OUString getNewOutputName()
returns the file url for a new model
virtual css::uno::Reference< css::report::XReportDefinition > SAL_CALL getReportDefinition() override
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
OReportEngineJFree & operator=(const OReportEngineJFree &)=delete
::cppu::PropertySetMixin< css::report::XReportEngine > ReportEnginePropertySet
virtual void SAL_CALL interrupt() override
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
virtual css::util::URL SAL_CALL createDocument() override
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
css::uno::Reference< css::uno::XComponentContext > m_xContext
::cppu::WeakComponentImplHelper< css::report::XReportEngine,css::lang::XServiceInfo > ReportEngineBase
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
virtual void SAL_CALL setReportDefinition(const css::uno::Reference< css::report::XReportDefinition > &_reportdefinition) override
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
virtual OUString SAL_CALL getImplementationName() override
virtual void SAL_CALL setMaxRows(::sal_Int32 MaxRows) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual css::uno::Reference< css::frame::XModel > SAL_CALL createDocumentModel() override
unsigned char sal_Bool
virtual css::uno::Reference< css::task::XStatusIndicator > SAL_CALL getStatusIndicator() override
OReportEngineJFree(const OReportEngineJFree &)=delete
virtual void SAL_CALL dispose() override
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
void prepareSet(rtl::OUString const &propertyName, css::uno::Any const &oldValue, css::uno::Any const &newValue, BoundListeners *boundListeners)
virtual void SAL_CALL setActiveConnection(const css::uno::Reference< css::sdbc::XConnection > &_activeconnection) override
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
css::uno::Reference< css::sdbc::XConnection > m_xActiveConnection
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
void set(const OUString &_sProperty, const T &Value, T &_member)
virtual ::sal_Int32 SAL_CALL getMaxRows() override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual void SAL_CALL setStatusIndicator(const css::uno::Reference< css::task::XStatusIndicator > &_statusindicator) override
virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL getActiveConnection() override
css::uno::Reference< css::report::XReportDefinition > m_xReport
#define DECLARE_XINTERFACE()
css::uno::Reference< css::task::XStatusIndicator > m_StatusIndicator