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_REPORTCOMPONENTHANDLER_HXX
25cdf0e10cSrcweir #define RPT_REPORTCOMPONENTHANDLER_HXX
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include "sal/config.h"
28cdf0e10cSrcweir #include "com/sun/star/uno/XComponentContext.hpp"
29cdf0e10cSrcweir #include "cppuhelper/compbase2.hxx"
30cdf0e10cSrcweir #include "cppuhelper/basemutex.hxx"
31cdf0e10cSrcweir #include "com/sun/star/inspection/XPropertyHandler.hpp"
32cdf0e10cSrcweir #include "com/sun/star/lang/XServiceInfo.hpp"
33cdf0e10cSrcweir 
34cdf0e10cSrcweir #include <memory>
35cdf0e10cSrcweir 
36cdf0e10cSrcweir //........................................................................
37cdf0e10cSrcweir namespace rptui
38cdf0e10cSrcweir {
39cdf0e10cSrcweir //........................................................................
40cdf0e10cSrcweir 
41cdf0e10cSrcweir     class OPropertyInfoService;
42cdf0e10cSrcweir 
43cdf0e10cSrcweir     typedef ::cppu::WeakComponentImplHelper2<   ::com::sun::star::inspection::XPropertyHandler
44cdf0e10cSrcweir                                             ,   ::com::sun::star::lang::XServiceInfo> ReportComponentHandler_Base;
45cdf0e10cSrcweir 
46cdf0e10cSrcweir     class ReportComponentHandler:
47cdf0e10cSrcweir         private ::cppu::BaseMutex,
48cdf0e10cSrcweir         public ReportComponentHandler_Base
49cdf0e10cSrcweir     {
50cdf0e10cSrcweir     public:
51cdf0e10cSrcweir         // XServiceInfo - static versions
52cdf0e10cSrcweir 		static ::rtl::OUString getImplementationName_Static(  ) throw(::com::sun::star::uno::RuntimeException);
53cdf0e10cSrcweir 		static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_static(  ) throw(::com::sun::star::uno::RuntimeException);
54cdf0e10cSrcweir 		static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
55cdf0e10cSrcweir 						create(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >&);
56cdf0e10cSrcweir 
57cdf0e10cSrcweir     public:
58cdf0e10cSrcweir         explicit ReportComponentHandler(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & context);
59cdf0e10cSrcweir 
60cdf0e10cSrcweir         // XServiceInfo
61cdf0e10cSrcweir 		virtual ::rtl::OUString SAL_CALL getImplementationName(  ) throw(::com::sun::star::uno::RuntimeException);
62cdf0e10cSrcweir 		virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException);
63cdf0e10cSrcweir 		virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(  ) throw(::com::sun::star::uno::RuntimeException);
64cdf0e10cSrcweir 
65cdf0e10cSrcweir         // ::com::sun::star::lang::XComponent:
66cdf0e10cSrcweir         virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & xListener)   throw (::com::sun::star::uno::RuntimeException);
67cdf0e10cSrcweir         virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw (::com::sun::star::uno::RuntimeException);
68cdf0e10cSrcweir 
69cdf0e10cSrcweir         // ::com::sun::star::inspection::XPropertyHandler:
70cdf0e10cSrcweir         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);
71cdf0e10cSrcweir         virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(const ::rtl::OUString & PropertyName) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException);
72cdf0e10cSrcweir         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);
73cdf0e10cSrcweir         virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState(const ::rtl::OUString & PropertyName) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException);
74cdf0e10cSrcweir         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);
75cdf0e10cSrcweir         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);
76cdf0e10cSrcweir         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);
77cdf0e10cSrcweir         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);
78cdf0e10cSrcweir         virtual void SAL_CALL removePropertyChangeListener(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener > & _rxListener) throw (::com::sun::star::uno::RuntimeException);
79cdf0e10cSrcweir         virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property > SAL_CALL getSupportedProperties() throw (::com::sun::star::uno::RuntimeException);
80cdf0e10cSrcweir         virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupersededProperties() throw (::com::sun::star::uno::RuntimeException);
81cdf0e10cSrcweir         virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getActuatingProperties() throw (::com::sun::star::uno::RuntimeException);
82cdf0e10cSrcweir         virtual ::sal_Bool SAL_CALL isComposable(const ::rtl::OUString & PropertyName) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException);
83cdf0e10cSrcweir         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);
84cdf0e10cSrcweir         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);
85cdf0e10cSrcweir         virtual ::sal_Bool SAL_CALL suspend(::sal_Bool Suspend) throw (::com::sun::star::uno::RuntimeException);
86cdf0e10cSrcweir 
87cdf0e10cSrcweir     protected:
~ReportComponentHandler()88cdf0e10cSrcweir         virtual ~ReportComponentHandler() {}
89cdf0e10cSrcweir     private:
90cdf0e10cSrcweir         ReportComponentHandler(ReportComponentHandler &); // not defined
91cdf0e10cSrcweir         void operator =(ReportComponentHandler &); // not defined
92cdf0e10cSrcweir 
93cdf0e10cSrcweir 
94cdf0e10cSrcweir 
95cdf0e10cSrcweir         // overload WeakComponentImplHelperBase::disposing()
96cdf0e10cSrcweir         // This function is called upon disposing the component,
97cdf0e10cSrcweir         // if your component needs special work when it becomes
98cdf0e10cSrcweir         // disposed, do it here.
99cdf0e10cSrcweir         virtual void SAL_CALL disposing();
100cdf0e10cSrcweir 
101cdf0e10cSrcweir         ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >        m_xContext;
102cdf0e10cSrcweir         ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyHandler >  m_xFormComponentHandler; /// delegatee
103cdf0e10cSrcweir         ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >               m_xReportComponent; /// inspectee
104cdf0e10cSrcweir         ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >               m_xFormComponent; /// inspectee
105cdf0e10cSrcweir         ::std::auto_ptr< OPropertyInfoService >                                             m_pInfoService;
106cdf0e10cSrcweir     };
107cdf0e10cSrcweir //........................................................................
108cdf0e10cSrcweir } // namespace rptui
109cdf0e10cSrcweir //........................................................................
110cdf0e10cSrcweir 
111cdf0e10cSrcweir #endif // RPT_REPORTCOMPONENTHANDLER_HXX
112