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_EFORMSPROPERTYHANDLER_HXX
25 #define EXTENSIONS_SOURCE_PROPCTRLR_EFORMSPROPERTYHANDLER_HXX
26 
27 #include "propertyhandler.hxx"
28 
29 /** === begin UNO includes === **/
30 /** === end UNO includes === **/
31 
32 #include <memory>
33 
34 //........................................................................
35 namespace pcr
36 {
37 //........................................................................
38 
39     class EFormsHelper;
40 	//====================================================================
41 	//= EFormsPropertyHandler
42 	//====================================================================
43     class EFormsPropertyHandler;
44     typedef HandlerComponentBase< EFormsPropertyHandler > EFormsPropertyHandler_Base;
45     class EFormsPropertyHandler : public EFormsPropertyHandler_Base
46 	{
47     private:
48         ::std::auto_ptr< EFormsHelper > m_pHelper;
49         /** current value of the Model property, if there is no binding, yet
50         */
51         ::rtl::OUString                 m_sBindingLessModelName;
52         /** are we currently simulating a propertyChange event of the Model property?
53         */
54         bool                            m_bSimulatingModelChange;
55 
56     public:
57         EFormsPropertyHandler(
58             const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext
59         );
60 
61         static ::rtl::OUString SAL_CALL getImplementationName_static(  ) throw (::com::sun::star::uno::RuntimeException);
62         static ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames_static(  ) throw (::com::sun::star::uno::RuntimeException);
63 
64     protected:
65         ~EFormsPropertyHandler();
66 
67     protected:
68         // XPropertyHandler overriables
69         virtual ::com::sun::star::uno::Any          SAL_CALL getPropertyValue( const ::rtl::OUString& _rPropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
70         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);
71         virtual ::com::sun::star::uno::Sequence< ::rtl::OUString >
72                                                     SAL_CALL getActuatingProperties( ) throw (::com::sun::star::uno::RuntimeException);
73         virtual ::com::sun::star::uno::Sequence< ::rtl::OUString >
74                                                     SAL_CALL getSupersededProperties( ) throw (::com::sun::star::uno::RuntimeException);
75         virtual ::com::sun::star::inspection::LineDescriptor
76                                                     SAL_CALL describePropertyLine( const ::rtl::OUString& _rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControlFactory >& _rxControlFactory ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::NullPointerException, ::com::sun::star::uno::RuntimeException);
77         virtual ::com::sun::star::inspection::InteractiveSelectionResult
78                                                     SAL_CALL onInteractivePropertySelection( const ::rtl::OUString& _rPropertyName, sal_Bool _bPrimary, ::com::sun::star::uno::Any& _rData, const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XObjectInspectorUI >& _rxInspectorUI ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::NullPointerException, ::com::sun::star::uno::RuntimeException);
79         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 ) throw (::com::sun::star::lang::NullPointerException, ::com::sun::star::uno::RuntimeException);
80         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);
81         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);
82         virtual void                                SAL_CALL addPropertyChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& _rxListener ) throw (::com::sun::star::uno::RuntimeException);
83         virtual void                                SAL_CALL removePropertyChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& _rxListener ) throw (::com::sun::star::uno::RuntimeException);
84 
85         // PropertyHandler overridables
86         virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >
87                                             SAL_CALL doDescribeSupportedProperties() const;
88         virtual void onNewComponent();
89 
90     protected:
91         /** returns the value of the PROPERTY_XML_DATA_MODEL property.
92 
93             An extra method is necessary here, which respects both the value set at our helper,
94             and <member>m_sBindingLessModelName</member>
95         */
96         ::rtl::OUString getModelNamePropertyValue() const;
97 	};
98 
99 //........................................................................
100 } // namespace pcr
101 //........................................................................
102 
103 #endif // EXTENSIONS_SOURCE_PROPCTRLR_EFORMSPROPERTYHANDLER_HXX
104 
105