1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef RPT_REPORTCOMPONENTHANDLER_HXX 25 #define RPT_REPORTCOMPONENTHANDLER_HXX 26 27 #include "sal/config.h" 28 #include "com/sun/star/uno/XComponentContext.hpp" 29 #include "cppuhelper/compbase2.hxx" 30 #include "cppuhelper/basemutex.hxx" 31 #include "com/sun/star/inspection/XPropertyHandler.hpp" 32 #include "com/sun/star/lang/XServiceInfo.hpp" 33 34 #include <memory> 35 36 //........................................................................ 37 namespace rptui 38 { 39 //........................................................................ 40 41 class OPropertyInfoService; 42 43 typedef ::cppu::WeakComponentImplHelper2< ::com::sun::star::inspection::XPropertyHandler 44 , ::com::sun::star::lang::XServiceInfo> ReportComponentHandler_Base; 45 46 class ReportComponentHandler: 47 private ::cppu::BaseMutex, 48 public ReportComponentHandler_Base 49 { 50 public: 51 // XServiceInfo - static versions 52 static ::rtl::OUString getImplementationName_Static( ) throw(::com::sun::star::uno::RuntimeException); 53 static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_static( ) throw(::com::sun::star::uno::RuntimeException); 54 static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL 55 create(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >&); 56 57 public: 58 explicit ReportComponentHandler(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & context); 59 60 // XServiceInfo 61 virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException); 62 virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw(::com::sun::star::uno::RuntimeException); 63 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException); 64 65 // ::com::sun::star::lang::XComponent: 66 virtual void SAL_CALL addEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & xListener) throw (::com::sun::star::uno::RuntimeException); 67 virtual void SAL_CALL removeEventListener(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XEventListener > & aListener) throw (::com::sun::star::uno::RuntimeException); 68 69 // ::com::sun::star::inspection::XPropertyHandler: 70 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); 71 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue(const ::rtl::OUString & PropertyName) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); 72 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); 73 virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState(const ::rtl::OUString & PropertyName) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); 74 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); 75 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); 76 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); 77 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); 78 virtual void SAL_CALL removePropertyChangeListener(const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener > & _rxListener) throw (::com::sun::star::uno::RuntimeException); 79 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property > SAL_CALL getSupportedProperties() throw (::com::sun::star::uno::RuntimeException); 80 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupersededProperties() throw (::com::sun::star::uno::RuntimeException); 81 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getActuatingProperties() throw (::com::sun::star::uno::RuntimeException); 82 virtual ::sal_Bool SAL_CALL isComposable(const ::rtl::OUString & PropertyName) throw (::com::sun::star::uno::RuntimeException, ::com::sun::star::beans::UnknownPropertyException); 83 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); 84 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); 85 virtual ::sal_Bool SAL_CALL suspend(::sal_Bool Suspend) throw (::com::sun::star::uno::RuntimeException); 86 87 protected: ~ReportComponentHandler()88 virtual ~ReportComponentHandler() {} 89 private: 90 ReportComponentHandler(ReportComponentHandler &); // not defined 91 void operator =(ReportComponentHandler &); // not defined 92 93 94 95 // overload WeakComponentImplHelperBase::disposing() 96 // This function is called upon disposing the component, 97 // if your component needs special work when it becomes 98 // disposed, do it here. 99 virtual void SAL_CALL disposing(); 100 101 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; 102 ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyHandler > m_xFormComponentHandler; /// delegatee 103 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xReportComponent; /// inspectee 104 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > m_xFormComponent; /// inspectee 105 ::std::auto_ptr< OPropertyInfoService > m_pInfoService; 106 }; 107 //........................................................................ 108 } // namespace rptui 109 //........................................................................ 110 111 #endif // RPT_REPORTCOMPONENTHANDLER_HXX 112