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 #ifndef EXTENSIONS_SOURCE_PROPCTRLR_FORMCONTROLLER_HXX
28 #define EXTENSIONS_SOURCE_PROPCTRLR_FORMCONTROLLER_HXX
29 
30 #include "propcontroller.hxx"
31 
32 /** === begin UNO includes === **/
33 /** === end UNO includes === **/
34 #include <cppuhelper/propshlp.hxx>
35 #include <comphelper/proparrhlp.hxx>
36 #include <comphelper/uno3.hxx>
37 
38 //........................................................................
39 namespace pcr
40 {
41 //........................................................................
42 
43 	//====================================================================
44 	//= ServiceDescriptor
45 	//====================================================================
46     struct ServiceDescriptor
47     {
48         ::rtl::OUString
49             ( *GetImplementationName )( void );
50         ::com::sun::star::uno::Sequence< ::rtl::OUString >
51             ( *GetSupportedServiceNames )( void );
52     };
53 
54 	//====================================================================
55 	//= FormController
56 	//====================================================================
57 	class FormController;
58 	typedef ::cppu::OPropertySetHelper                                  FormController_PropertyBase1;
59 	typedef ::comphelper::OPropertyArrayUsageHelper< FormController >   FormController_PropertyBase2;
60 
61     /** Legacy implementation of com.sun.star.form.PropertyBrowserController
62 
63         Nowadays only a wrapper around an ObjectInspector using a
64         DefaultFormComponentInspectorModel.
65     */
66     class FormController    :public OPropertyBrowserController
67 				            ,public FormController_PropertyBase1
68 				            ,public FormController_PropertyBase2
69 	{
70     private:
71         ServiceDescriptor           m_aServiceDescriptor;
72         ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
73                                     m_xCurrentInspectee;
74         bool                        m_bUseFormComponentHandlers;
75     public:
76 		FormController(
77 			const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext,
78             ServiceDescriptor _aServiceDescriptor,
79             bool _bUseFormFormComponentHandlers
80         );
81 
82 		// XServiceInfo - static versions
83 		static ::rtl::OUString getImplementationName_static(  ) throw(::com::sun::star::uno::RuntimeException);
84 		static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_static(  ) throw(::com::sun::star::uno::RuntimeException);
85 		static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
86 						Create(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >&);
87 
88     protected:
89         ~FormController();
90 
91         DECLARE_XINTERFACE()
92         DECLARE_XTYPEPROVIDER()
93 
94         // XServiceInfo
95 		virtual ::rtl::OUString SAL_CALL getImplementationName(  ) throw(::com::sun::star::uno::RuntimeException);
96 		virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames(  ) throw(::com::sun::star::uno::RuntimeException);
97 
98         // XPropertySet and friends
99 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo(  ) throw(::com::sun::star::uno::RuntimeException);
100 		virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
101 		virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const;
102 
103         virtual sal_Bool SAL_CALL convertFastPropertyValue(
104                 ::com::sun::star::uno::Any & rConvertedValue, ::com::sun::star::uno::Any & rOldValue, sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue
105             )   throw (::com::sun::star::lang::IllegalArgumentException);
106 		virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
107                 sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue
108             ) throw (::com::sun::star::uno::Exception);
109 	    virtual void SAL_CALL getFastPropertyValue(
110 		        ::com::sun::star::uno::Any& rValue, sal_Int32 nHandle
111             ) const;
112     private:
113         using FormController_PropertyBase1::getFastPropertyValue;
114 	};
115 
116 	//====================================================================
117 	//= DialogController
118 	//====================================================================
119     /** Legacy implementation of com.sun.star.awt.PropertyBrowserController
120     */
121     class DialogController
122     {
123     public:
124 		// XServiceInfo - static versions
125 		static ::rtl::OUString getImplementationName_static(  ) throw(::com::sun::star::uno::RuntimeException);
126 		static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_static(  ) throw(::com::sun::star::uno::RuntimeException);
127 		static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
128 						Create(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >&);
129 
130     private:
131         DialogController();                                     // never implemented
132         DialogController( const DialogController& );            // never implemented
133         DialogController& operator=( const DialogController& ); // never implemented
134     };
135 //........................................................................
136 } // namespace pcr
137 //........................................................................
138 
139 #endif // EXTENSIONS_SOURCE_PROPCTRLR_FORMCONTROLLER_HXX
140 
141