1*9ee13d13SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*9ee13d13SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*9ee13d13SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*9ee13d13SAndrew Rist  * distributed with this work for additional information
6*9ee13d13SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*9ee13d13SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*9ee13d13SAndrew Rist  * "License"); you may not use this file except in compliance
9*9ee13d13SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*9ee13d13SAndrew Rist  *
11*9ee13d13SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*9ee13d13SAndrew Rist  *
13*9ee13d13SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*9ee13d13SAndrew Rist  * software distributed under the License is distributed on an
15*9ee13d13SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*9ee13d13SAndrew Rist  * KIND, either express or implied.  See the License for the
17*9ee13d13SAndrew Rist  * specific language governing permissions and limitations
18*9ee13d13SAndrew Rist  * under the License.
19*9ee13d13SAndrew Rist  *
20*9ee13d13SAndrew Rist  *************************************************************/
21*9ee13d13SAndrew Rist 
22*9ee13d13SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef RPT_DATAPROVIDERHANDLER_HXX
25cdf0e10cSrcweir #define RPT_DATAPROVIDERHANDLER_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include "sal/config.h"
28cdf0e10cSrcweir 
29cdf0e10cSrcweir #include "cppuhelper/compbase2.hxx"
30cdf0e10cSrcweir #include "cppuhelper/basemutex.hxx"
31cdf0e10cSrcweir 
32cdf0e10cSrcweir #include "com/sun/star/uno/XComponentContext.hpp"
33cdf0e10cSrcweir #include "com/sun/star/inspection/XPropertyHandler.hpp"
34cdf0e10cSrcweir #include "com/sun/star/chart2/XChartDocument.hpp"
35cdf0e10cSrcweir #include "com/sun/star/chart2/data/XDatabaseDataProvider.hpp"
36cdf0e10cSrcweir #include "com/sun/star/report/XReportComponent.hpp"
37cdf0e10cSrcweir #include "com/sun/star/script/XTypeConverter.hpp"
38cdf0e10cSrcweir #include "com/sun/star/lang/XServiceInfo.hpp"
39cdf0e10cSrcweir 
40cdf0e10cSrcweir #include <memory>
41cdf0e10cSrcweir 
42cdf0e10cSrcweir //........................................................................
43cdf0e10cSrcweir namespace rptui
44cdf0e10cSrcweir {
45cdf0e10cSrcweir //........................................................................
46cdf0e10cSrcweir 
47cdf0e10cSrcweir     class OPropertyInfoService;
48cdf0e10cSrcweir 
49cdf0e10cSrcweir     typedef ::cppu::WeakComponentImplHelper2<   ::com::sun::star::inspection::XPropertyHandler
50cdf0e10cSrcweir                                             ,   ::com::sun::star::lang::XServiceInfo> DataProviderHandler_Base;
51cdf0e10cSrcweir 
52cdf0e10cSrcweir     class DataProviderHandler:
53cdf0e10cSrcweir         private ::cppu::BaseMutex,
54cdf0e10cSrcweir         public DataProviderHandler_Base
55cdf0e10cSrcweir     {
56cdf0e10cSrcweir     public:
57cdf0e10cSrcweir         // XServiceInfo - static versions
58cdf0e10cSrcweir 		static ::rtl::OUString getImplementationName_Static(  ) throw(::com::sun::star::uno::RuntimeException);
59cdf0e10cSrcweir 		static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_static(  ) throw(::com::sun::star::uno::RuntimeException);
60cdf0e10cSrcweir 		static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
61cdf0e10cSrcweir 						create(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >&);
62cdf0e10cSrcweir 
63cdf0e10cSrcweir         explicit DataProviderHandler(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & context);
64cdf0e10cSrcweir     private:
65cdf0e10cSrcweir 
66cdf0e10cSrcweir         // XServiceInfo
67cdf0e10cSrcweir 		virtual ::rtl::OUString SAL_CALL getImplementationName(  ) throw(::com::sun::star::uno::RuntimeException);
68cdf0e10cSrcweir 		virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
69cdf0e10cSrcweir 		virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(  ) throw(::com::sun::star::uno::RuntimeException);
70cdf0e10cSrcweir 
71cdf0e10cSrcweir         // ::com::sun::star::lang::XComponent:
72cdf0e10cSrcweir         virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & xListener)   throw (::com::sun::star::uno::RuntimeException);
73cdf0e10cSrcweir         virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw (::com::sun::star::uno::RuntimeException);
74cdf0e10cSrcweir 
75cdf0e10cSrcweir         // ::com::sun::star::inspection::XPropertyHandler:
76cdf0e10cSrcweir         virtual void SAL_CALL inspect(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > & Component) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::NullPointerException);
77cdf0e10cSrcweir         virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(const ::rtl::OUString & PropertyName) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException);
78cdf0e10cSrcweir         virtual void SAL_CALL setPropertyValue(const ::rtl::OUString & PropertyName, const ::com::sun::star::uno::Any & Value) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException);
79cdf0e10cSrcweir         virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState(const ::rtl::OUString & PropertyName) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException);
80cdf0e10cSrcweir         virtual ::com::sun::star::inspection::LineDescriptor SAL_CALL describePropertyLine(const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControlFactory >& ControlFactory ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::NullPointerException, ::com::sun::star::uno::RuntimeException);
81cdf0e10cSrcweir         virtual ::com::sun::star::uno::Any SAL_CALL convertToPropertyValue(const ::rtl::OUString & PropertyName, const ::com::sun::star::uno::Any & ControlValue) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException);
82cdf0e10cSrcweir         virtual ::com::sun::star::uno::Any SAL_CALL convertToControlValue(const ::rtl::OUString & PropertyName, const ::com::sun::star::uno::Any & PropertyValue, const ::com::sun::star::uno::Type & ControlValueType) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException);
83cdf0e10cSrcweir         virtual void SAL_CALL addPropertyChangeListener(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener > & Listener) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::NullPointerException);
84cdf0e10cSrcweir         virtual void SAL_CALL removePropertyChangeListener(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener > & _rxListener) throw (::com::sun::star::uno::RuntimeException);
85cdf0e10cSrcweir         virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property > SAL_CALL getSupportedProperties() throw (::com::sun::star::uno::RuntimeException);
86cdf0e10cSrcweir         virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupersededProperties() throw (::com::sun::star::uno::RuntimeException);
87cdf0e10cSrcweir         virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getActuatingProperties() throw (::com::sun::star::uno::RuntimeException);
88cdf0e10cSrcweir         virtual ::sal_Bool SAL_CALL isComposable(const ::rtl::OUString & PropertyName) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException);
89cdf0e10cSrcweir         virtual ::com::sun::star::inspection::InteractiveSelectionResult SAL_CALL onInteractivePropertySelection(const ::rtl::OUString & PropertyName, ::sal_Bool Primary, ::com::sun::star::uno::Any & out_Data, const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XObjectInspectorUI > & InspectorUI) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::NullPointerException);
90cdf0e10cSrcweir         virtual void SAL_CALL actuatingPropertyChanged(const ::rtl::OUString & ActuatingPropertyName, const ::com::sun::star::uno::Any & NewValue, const ::com::sun::star::uno::Any & OldValue, const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XObjectInspectorUI > & InspectorUI, ::sal_Bool FirstTimeInit) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::lang::NullPointerException);
91cdf0e10cSrcweir         virtual ::sal_Bool SAL_CALL suspend(::sal_Bool Suspend) throw (::com::sun::star::uno::RuntimeException);
92cdf0e10cSrcweir 
93cdf0e10cSrcweir     protected:
~DataProviderHandler()94cdf0e10cSrcweir         virtual ~DataProviderHandler() {}
95cdf0e10cSrcweir     private:
96cdf0e10cSrcweir         DataProviderHandler(DataProviderHandler &); // not defined
97cdf0e10cSrcweir         void operator =(DataProviderHandler &); // not defined
98cdf0e10cSrcweir 
99cdf0e10cSrcweir 
100cdf0e10cSrcweir         bool impl_dialogLinkedFields_nothrow( ::osl::ClearableMutexGuard& _rClearBeforeDialog ) const;
101cdf0e10cSrcweir         bool impl_dialogChartType_nothrow( ::osl::ClearableMutexGuard& _rClearBeforeDialog ) const;
102cdf0e10cSrcweir         void impl_updateChartTitle_throw(const ::com::sun::star::uno::Any& _aValue);
103cdf0e10cSrcweir 
104cdf0e10cSrcweir         // overload WeakComponentImplHelperBase::disposing()
105cdf0e10cSrcweir         // This function is called upon disposing the component,
106cdf0e10cSrcweir         // if your component needs special work when it becomes
107cdf0e10cSrcweir         // disposed, do it here.
108cdf0e10cSrcweir         virtual void SAL_CALL disposing();
109cdf0e10cSrcweir 
110cdf0e10cSrcweir         ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >                m_xContext;
111cdf0e10cSrcweir         ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyHandler >          m_xFormComponentHandler; /// delegatee
112cdf0e10cSrcweir         ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDatabaseDataProvider>    m_xDataProvider; /// inspectee
113cdf0e10cSrcweir         ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >                       m_xFormComponent; /// inspectee
114cdf0e10cSrcweir         ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent >              m_xReportComponent; /// inspectee
115cdf0e10cSrcweir         ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartDocument>                 m_xChartModel;
116cdf0e10cSrcweir         ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >        m_xMasterDetails;
117cdf0e10cSrcweir         /// type converter, needed on various occasions
118cdf0e10cSrcweir         ::com::sun::star::uno::Reference< ::com::sun::star::script::XTypeConverter >                m_xTypeConverter;
119cdf0e10cSrcweir         ::std::auto_ptr< OPropertyInfoService >                                                     m_pInfoService;
120cdf0e10cSrcweir     };
121cdf0e10cSrcweir //........................................................................
122cdf0e10cSrcweir } // namespace rptui
123cdf0e10cSrcweir //........................................................................
124cdf0e10cSrcweir 
125cdf0e10cSrcweir #endif // RPT_DATAPROVIDERHANDLER_HXX
126