1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef EXTENSIONS_SOURCE_PROPCTRLR_EFORMSPROPERTYHANDLER_HXX
29 #define EXTENSIONS_SOURCE_PROPCTRLR_EFORMSPROPERTYHANDLER_HXX
30 
31 #include "propertyhandler.hxx"
32 
33 /** === begin UNO includes === **/
34 /** === end UNO includes === **/
35 
36 #include <memory>
37 
38 //........................................................................
39 namespace pcr
40 {
41 //........................................................................
42 
43     class EFormsHelper;
44 	//====================================================================
45 	//= EFormsPropertyHandler
46 	//====================================================================
47     class EFormsPropertyHandler;
48     typedef HandlerComponentBase< EFormsPropertyHandler > EFormsPropertyHandler_Base;
49     class EFormsPropertyHandler : public EFormsPropertyHandler_Base
50 	{
51     private:
52         ::std::auto_ptr< EFormsHelper > m_pHelper;
53         /** current value of the Model property, if there is no binding, yet
54         */
55         ::rtl::OUString                 m_sBindingLessModelName;
56         /** are we currently simulating a propertyChange event of the Model property?
57         */
58         bool                            m_bSimulatingModelChange;
59 
60     public:
61         EFormsPropertyHandler(
62             const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext
63         );
64 
65         static ::rtl::OUString SAL_CALL getImplementationName_static(  ) throw (::com::sun::star::uno::RuntimeException);
66         static ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames_static(  ) throw (::com::sun::star::uno::RuntimeException);
67 
68     protected:
69         ~EFormsPropertyHandler();
70 
71     protected:
72         // XPropertyHandler overriables
73         virtual ::com::sun::star::uno::Any          SAL_CALL getPropertyValue( const ::rtl::OUString& _rPropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
74         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);
75         virtual ::com::sun::star::uno::Sequence< ::rtl::OUString >
76                                                     SAL_CALL getActuatingProperties( ) throw (::com::sun::star::uno::RuntimeException);
77         virtual ::com::sun::star::uno::Sequence< ::rtl::OUString >
78                                                     SAL_CALL getSupersededProperties( ) throw (::com::sun::star::uno::RuntimeException);
79         virtual ::com::sun::star::inspection::LineDescriptor
80                                                     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);
81         virtual ::com::sun::star::inspection::InteractiveSelectionResult
82                                                     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);
83         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);
84         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);
85         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);
86         virtual void                                SAL_CALL addPropertyChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& _rxListener ) throw (::com::sun::star::uno::RuntimeException);
87         virtual void                                SAL_CALL removePropertyChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& _rxListener ) throw (::com::sun::star::uno::RuntimeException);
88 
89         // PropertyHandler overridables
90         virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >
91                                             SAL_CALL doDescribeSupportedProperties() const;
92         virtual void onNewComponent();
93 
94     protected:
95         /** returns the value of the PROPERTY_XML_DATA_MODEL property.
96 
97             An extra method is necessary here, which respects both the value set at our helper,
98             and <member>m_sBindingLessModelName</member>
99         */
100         ::rtl::OUString getModelNamePropertyValue() const;
101 	};
102 
103 //........................................................................
104 } // namespace pcr
105 //........................................................................
106 
107 #endif // EXTENSIONS_SOURCE_PROPCTRLR_EFORMSPROPERTYHANDLER_HXX
108 
109