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 EXTENSIONS_SOURCE_PROPCTRLR_CELLBINDINGHANDLER_HXX
25 #define EXTENSIONS_SOURCE_PROPCTRLR_CELLBINDINGHANDLER_HXX
26 
27 #include "propertyhandler.hxx"
28 
29 /** === begin UNO includes === **/
30 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
31 /** === end UNO includes === **/
32 #include <rtl/ref.hxx>
33 
34 #include <memory>
35 
36 //........................................................................
37 namespace pcr
38 {
39 //........................................................................
40 
41     class CellBindingHelper;
42     class IPropertyEnumRepresentation;
43 	//====================================================================
44 	//= CellBindingPropertyHandler
45 	//====================================================================
46     class CellBindingPropertyHandler;
47     typedef HandlerComponentBase< CellBindingPropertyHandler > CellBindingPropertyHandler_Base;
48     class CellBindingPropertyHandler : public CellBindingPropertyHandler_Base
49 	{
50     private:
51         ::std::auto_ptr< CellBindingHelper >            m_pHelper;
52         ::rtl::Reference< IPropertyEnumRepresentation > m_pCellExchangeConverter;
53 
54     public:
55         CellBindingPropertyHandler(
56             const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext
57         );
58 
59         static ::rtl::OUString SAL_CALL getImplementationName_static(  ) throw (::com::sun::star::uno::RuntimeException);
60         static ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames_static(  ) throw (::com::sun::star::uno::RuntimeException);
61 
62     protected:
63         ~CellBindingPropertyHandler();
64 
65     protected:
66         // XPropertyHandler overriables
67         virtual ::com::sun::star::uno::Any      SAL_CALL getPropertyValue( const ::rtl::OUString& _rPropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
68         virtual void                            SAL_CALL setPropertyValue( const ::rtl::OUString& _rPropertyName, const ::com::sun::star::uno::Any& _rValue ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
69         virtual ::com::sun::star::uno::Any      SAL_CALL convertToPropertyValue( const ::rtl::OUString& _rPropertyName, const ::com::sun::star::uno::Any& _rControlValue ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
70         virtual ::com::sun::star::uno::Any      SAL_CALL convertToControlValue( const ::rtl::OUString& _rPropertyName, const ::com::sun::star::uno::Any& _rPropertyValue, const ::com::sun::star::uno::Type& _rControlValueType ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
71         virtual ::com::sun::star::uno::Sequence< ::rtl::OUString >
72                                                 SAL_CALL getActuatingProperties( ) throw (::com::sun::star::uno::RuntimeException);
73         virtual void                            SAL_CALL actuatingPropertyChanged( const ::rtl::OUString& _rActuatingPropertyName, const ::com::sun::star::uno::Any& _rNewValue, const ::com::sun::star::uno::Any& _rOldValue, const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XObjectInspectorUI >& _rxInspectorUI, sal_Bool _bFirstTimeInit ) throw (::com::sun::star::lang::NullPointerException, ::com::sun::star::uno::RuntimeException);
74 
75         // PropertyHandler overridables
76         virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >
77                                                 SAL_CALL doDescribeSupportedProperties() const;
78         virtual void onNewComponent();
79 
80     private:
81         /** updates a property (UI) whose state depends on more than one other property
82 
83             ->actuatingPropertyChanged is called for certain properties in whose changes
84             we expressed interes (->getActuatingProperty). Now such a property change can
85             result in simple UI updates, for instance another property being enabled or disabled.
86 
87             However, it can also result in a more complex change: The current (UI) state might
88             depend on the value of more than one other property. Those dependent properties (their
89             UI, more precisely) are updated in this method.
90 
91             @param _nPropid
92                 the ->PropertyId of the dependent property whose UI state is to be updated
93 
94             @param _rxInspectorUI
95                 provides access to the property browser UI. Must not be <NULL/>.
96         */
97         void impl_updateDependentProperty_nothrow( PropertyId _nPropId, const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XObjectInspectorUI >& _rxInspectorUI ) const;
98 	};
99 
100 //........................................................................
101 } // namespace pcr
102 //........................................................................
103 
104 #endif // EXTENSIONS_SOURCE_PROPCTRLR_CELLBINDINGHANDLER_HXX
105 
106