merge the formfield patch from ooo-build
[ooovba.git] / extensions / source / propctrlr / formcontroller.hxx
blob39cb115c2b48eab419d3da6435d7f8df69990fc4
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: formcontroller.hxx,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef EXTENSIONS_SOURCE_PROPCTRLR_FORMCONTROLLER_HXX
31 #define EXTENSIONS_SOURCE_PROPCTRLR_FORMCONTROLLER_HXX
33 #include "propcontroller.hxx"
35 /** === begin UNO includes === **/
36 /** === end UNO includes === **/
37 #include <cppuhelper/propshlp.hxx>
38 #include <comphelper/proparrhlp.hxx>
39 #include <comphelper/uno3.hxx>
41 //........................................................................
42 namespace pcr
44 //........................................................................
46 //====================================================================
47 //= ServiceDescriptor
48 //====================================================================
49 struct ServiceDescriptor
51 ::rtl::OUString
52 ( *GetImplementationName )( void );
53 ::com::sun::star::uno::Sequence< ::rtl::OUString >
54 ( *GetSupportedServiceNames )( void );
57 //====================================================================
58 //= FormController
59 //====================================================================
60 class FormController;
61 typedef ::cppu::OPropertySetHelper FormController_PropertyBase1;
62 typedef ::comphelper::OPropertyArrayUsageHelper< FormController > FormController_PropertyBase2;
64 /** Legacy implementation of com.sun.star.form.PropertyBrowserController
66 Nowadays only a wrapper around an ObjectInspector using a
67 DefaultFormComponentInspectorModel.
69 class FormController :public OPropertyBrowserController
70 ,public FormController_PropertyBase1
71 ,public FormController_PropertyBase2
73 private:
74 ServiceDescriptor m_aServiceDescriptor;
75 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
76 m_xCurrentInspectee;
77 bool m_bUseFormComponentHandlers;
78 public:
79 FormController(
80 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext,
81 ServiceDescriptor _aServiceDescriptor,
82 bool _bUseFormFormComponentHandlers
85 // XServiceInfo - static versions
86 static ::rtl::OUString getImplementationName_static( ) throw(::com::sun::star::uno::RuntimeException);
87 static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_static( ) throw(::com::sun::star::uno::RuntimeException);
88 static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
89 Create(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >&);
91 protected:
92 ~FormController();
94 DECLARE_XINTERFACE()
95 DECLARE_XTYPEPROVIDER()
97 // XServiceInfo
98 virtual ::rtl::OUString SAL_CALL getImplementationName( ) throw(::com::sun::star::uno::RuntimeException);
99 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames( ) throw(::com::sun::star::uno::RuntimeException);
101 // XPropertySet and friends
102 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw(::com::sun::star::uno::RuntimeException);
103 virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper();
104 virtual ::cppu::IPropertyArrayHelper* createArrayHelper( ) const;
106 virtual sal_Bool SAL_CALL convertFastPropertyValue(
107 ::com::sun::star::uno::Any & rConvertedValue, ::com::sun::star::uno::Any & rOldValue, sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue
108 ) throw (::com::sun::star::lang::IllegalArgumentException);
109 virtual void SAL_CALL setFastPropertyValue_NoBroadcast(
110 sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue
111 ) throw (::com::sun::star::uno::Exception);
112 virtual void SAL_CALL getFastPropertyValue(
113 ::com::sun::star::uno::Any& rValue, sal_Int32 nHandle
114 ) const;
115 private:
116 using FormController_PropertyBase1::getFastPropertyValue;
119 //====================================================================
120 //= DialogController
121 //====================================================================
122 /** Legacy implementation of com.sun.star.awt.PropertyBrowserController
124 class DialogController
126 public:
127 // XServiceInfo - static versions
128 static ::rtl::OUString getImplementationName_static( ) throw(::com::sun::star::uno::RuntimeException);
129 static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_static( ) throw(::com::sun::star::uno::RuntimeException);
130 static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
131 Create(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >&);
133 private:
134 DialogController(); // never implemented
135 DialogController( const DialogController& ); // never implemented
136 DialogController& operator=( const DialogController& ); // never implemented
138 //........................................................................
139 } // namespace pcr
140 //........................................................................
142 #endif // EXTENSIONS_SOURCE_PROPCTRLR_FORMCONTROLLER_HXX