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