LibreOffice Module reportdesign (master)  1
DataProviderHandler.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 
20 #ifndef INCLUDED_REPORTDESIGN_SOURCE_UI_INC_DATAPROVIDERHANDLER_HXX
21 #define INCLUDED_REPORTDESIGN_SOURCE_UI_INC_DATAPROVIDERHANDLER_HXX
22 
23 #include <sal/config.h>
24 
25 #include <cppuhelper/compbase.hxx>
26 #include <cppuhelper/basemutex.hxx>
27 
28 #include <com/sun/star/uno/XComponentContext.hpp>
29 #include <com/sun/star/inspection/XPropertyHandler.hpp>
30 #include <com/sun/star/chart2/XChartDocument.hpp>
31 #include <com/sun/star/chart2/data/XDatabaseDataProvider.hpp>
32 #include <com/sun/star/report/XReportComponent.hpp>
33 #include <com/sun/star/script/XTypeConverter.hpp>
34 #include <com/sun/star/lang/XServiceInfo.hpp>
35 
36 
37 namespace rptui
38 {
39 
40 
42 
43  typedef ::cppu::WeakComponentImplHelper< css::inspection::XPropertyHandler
44  , css::lang::XServiceInfo> DataProviderHandler_Base;
45 
47  private ::cppu::BaseMutex,
48  public DataProviderHandler_Base
49  {
50  public:
51  explicit DataProviderHandler(css::uno::Reference< css::uno::XComponentContext > const & context);
52  private:
53 
54  // XServiceInfo
55  virtual OUString SAL_CALL getImplementationName( ) override;
56  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
57  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
58 
59  // css::lang::XComponent:
60  virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > & xListener) override;
61  virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > & aListener) override;
62 
63  // css::inspection::XPropertyHandler:
64  virtual void SAL_CALL inspect(const css::uno::Reference< css::uno::XInterface > & Component) override;
65  virtual css::uno::Any SAL_CALL getPropertyValue(const OUString & PropertyName) override;
66  virtual void SAL_CALL setPropertyValue(const OUString & PropertyName, const css::uno::Any & Value) override;
67  virtual css::beans::PropertyState SAL_CALL getPropertyState(const OUString & PropertyName) override;
68  virtual css::inspection::LineDescriptor SAL_CALL describePropertyLine(const OUString& PropertyName, const css::uno::Reference< css::inspection::XPropertyControlFactory >& ControlFactory ) override;
69  virtual css::uno::Any SAL_CALL convertToPropertyValue(const OUString & PropertyName, const css::uno::Any & ControlValue) override;
70  virtual css::uno::Any SAL_CALL convertToControlValue(const OUString & PropertyName, const css::uno::Any & PropertyValue, const css::uno::Type & ControlValueType) override;
71  virtual void SAL_CALL addPropertyChangeListener(const css::uno::Reference< css::beans::XPropertyChangeListener > & Listener) override;
72  virtual void SAL_CALL removePropertyChangeListener(const css::uno::Reference< css::beans::XPropertyChangeListener > & _rxListener) override;
73  virtual css::uno::Sequence< css::beans::Property > SAL_CALL getSupportedProperties() override;
74  virtual css::uno::Sequence< OUString > SAL_CALL getSupersededProperties() override;
75  virtual css::uno::Sequence< OUString > SAL_CALL getActuatingProperties() override;
76  virtual sal_Bool SAL_CALL isComposable(const OUString & PropertyName) override;
77  virtual css::inspection::InteractiveSelectionResult SAL_CALL onInteractivePropertySelection(const OUString & PropertyName, sal_Bool Primary, css::uno::Any & out_Data, const css::uno::Reference< css::inspection::XObjectInspectorUI > & InspectorUI) override;
78  virtual void SAL_CALL actuatingPropertyChanged(const OUString & ActuatingPropertyName, const css::uno::Any & NewValue, const css::uno::Any & OldValue, const css::uno::Reference< css::inspection::XObjectInspectorUI > & InspectorUI, sal_Bool FirstTimeInit) override;
79  virtual sal_Bool SAL_CALL suspend(sal_Bool Suspend) override;
80 
81  protected:
82  virtual ~DataProviderHandler() override {}
83  private:
84  DataProviderHandler(DataProviderHandler const &) = delete;
85  void operator =(DataProviderHandler const &) = delete;
86 
87 
88  bool impl_dialogLinkedFields_nothrow( ::osl::ClearableMutexGuard& _rClearBeforeDialog ) const;
89  bool impl_dialogChartType_nothrow( ::osl::ClearableMutexGuard& _rClearBeforeDialog ) const;
90  void impl_updateChartTitle_throw(const css::uno::Any& _aValue);
91 
92  // override WeakComponentImplHelperBase::disposing()
93  // This function is called upon disposing the component,
94  // if your component needs special work when it becomes
95  // disposed, do it here.
96  virtual void SAL_CALL disposing() override;
97 
98  css::uno::Reference< css::uno::XComponentContext > m_xContext;
99  css::uno::Reference< css::inspection::XPropertyHandler > m_xFormComponentHandler;
100  css::uno::Reference< css::chart2::data::XDatabaseDataProvider> m_xDataProvider;
101  css::uno::Reference< css::uno::XInterface > m_xFormComponent;
102  css::uno::Reference< css::report::XReportComponent > m_xReportComponent;
103  css::uno::Reference< css::chart2::XChartDocument> m_xChartModel;
104  css::uno::Reference< css::beans::XPropertyChangeListener > m_xMasterDetails;
106  css::uno::Reference< css::script::XTypeConverter > m_xTypeConverter;
107  };
108 
109 } // namespace rptui
110 
111 
112 #endif // INCLUDED_REPORTDESIGN_SOURCE_UI_INC_DATAPROVIDERHANDLER_HXX
113 
114 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::inspection::XPropertyHandler > m_xFormComponentHandler
virtual css::uno::Sequence< OUString > SAL_CALL getActuatingProperties() override
virtual css::uno::Sequence< css::beans::Property > SAL_CALL getSupportedProperties() override
css::uno::Reference< css::script::XTypeConverter > m_xTypeConverter
type converter, needed on various occasions
void operator=(DataProviderHandler const &)=delete
virtual void SAL_CALL addPropertyChangeListener(const css::uno::Reference< css::beans::XPropertyChangeListener > &Listener) override
virtual void SAL_CALL disposing() override
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &xListener) override
virtual sal_Bool SAL_CALL suspend(sal_Bool Suspend) override
bool impl_dialogChartType_nothrow(::osl::ClearableMutexGuard &_rClearBeforeDialog) const
Value
virtual OUString SAL_CALL getImplementationName() override
virtual css::uno::Any SAL_CALL convertToPropertyValue(const OUString &PropertyName, const css::uno::Any &ControlValue) override
virtual sal_Bool SAL_CALL isComposable(const OUString &PropertyName) override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
::std::pair< MetaAction *, int > Component
css::uno::Reference< css::chart2::data::XDatabaseDataProvider > m_xDataProvider
delegatee
virtual css::uno::Sequence< OUString > SAL_CALL getSupersededProperties() override
css::uno::Reference< css::uno::XComponentContext > m_xContext
bool impl_dialogLinkedFields_nothrow(::osl::ClearableMutexGuard &_rClearBeforeDialog) const
unsigned char sal_Bool
virtual ~DataProviderHandler() override
virtual css::uno::Any SAL_CALL convertToControlValue(const OUString &PropertyName, const css::uno::Any &PropertyValue, const css::uno::Type &ControlValueType) override
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
::cppu::WeakComponentImplHelper< css::inspection::XPropertyHandler, css::lang::XServiceInfo > DataProviderHandler_Base
css::uno::Reference< css::report::XReportComponent > m_xReportComponent
inspectee
virtual void SAL_CALL removePropertyChangeListener(const css::uno::Reference< css::beans::XPropertyChangeListener > &_rxListener) override
DataProviderHandler(css::uno::Reference< css::uno::XComponentContext > const &context)
virtual css::inspection::InteractiveSelectionResult SAL_CALL onInteractivePropertySelection(const OUString &PropertyName, sal_Bool Primary, css::uno::Any &out_Data, const css::uno::Reference< css::inspection::XObjectInspectorUI > &InspectorUI) override
virtual void SAL_CALL actuatingPropertyChanged(const OUString &ActuatingPropertyName, const css::uno::Any &NewValue, const css::uno::Any &OldValue, const css::uno::Reference< css::inspection::XObjectInspectorUI > &InspectorUI, sal_Bool FirstTimeInit) override
virtual css::beans::PropertyState SAL_CALL getPropertyState(const OUString &PropertyName) override
css::uno::Reference< css::chart2::XChartDocument > m_xChartModel
inspectee
css::uno::Reference< css::uno::XInterface > m_xFormComponent
inspectee
virtual css::inspection::LineDescriptor SAL_CALL describePropertyLine(const OUString &PropertyName, const css::uno::Reference< css::inspection::XPropertyControlFactory > &ControlFactory) override
virtual void SAL_CALL inspect(const css::uno::Reference< css::uno::XInterface > &Component) override
virtual void SAL_CALL setPropertyValue(const OUString &PropertyName, const css::uno::Any &Value) override
css::uno::Reference< css::beans::XPropertyChangeListener > m_xMasterDetails
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
void impl_updateChartTitle_throw(const css::uno::Any &_aValue)