merge the formfield patch from ooo-build
[ooovba.git] / extensions / source / propctrlr / inspectormodelbase.hxx
blobbfba449979d6e28eb7e68c72a745380a9a56d6b3
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: inspectormodelbase.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 ************************************************************************/
31 #ifndef INSPECTORMODELBASE_HXX
32 #define INSPECTORMODELBASE_HXX
34 /** === begin UNO includes === **/
35 #include <com/sun/star/inspection/XObjectInspectorModel.hpp>
36 #include <com/sun/star/lang/XInitialization.hpp>
37 #include <com/sun/star/lang/XServiceInfo.hpp>
38 /** === end UNO includes === **/
40 #include <cppuhelper/implbase3.hxx>
41 #include <cppuhelper/propshlp.hxx>
43 #include <comphelper/broadcasthelper.hxx>
44 #include <comphelper/componentcontext.hxx>
45 #include <comphelper/uno3.hxx>
47 #include <memory>
49 //........................................................................
50 namespace pcr
52 //........................................................................
54 class InspectorModelProperties;
55 //====================================================================
56 //= ImplInspectorModel
57 //====================================================================
58 typedef ::cppu::WeakImplHelper3 < ::com::sun::star::inspection::XObjectInspectorModel
59 , ::com::sun::star::lang::XInitialization
60 , ::com::sun::star::lang::XServiceInfo
61 > ImplInspectorModel_Base;
62 typedef ::cppu::OPropertySetHelper ImplInspectorModel_PBase;
64 class ImplInspectorModel
65 :public ::comphelper::OMutexAndBroadcastHelper
66 ,public ImplInspectorModel_Base
67 ,public ImplInspectorModel_PBase
69 protected:
70 ::comphelper::ComponentContext m_aContext;
71 ::std::auto_ptr< InspectorModelProperties > m_pProperties;
73 protected:
74 ~ImplInspectorModel();
76 public:
77 ImplInspectorModel( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext );
79 DECLARE_XINTERFACE()
80 DECLARE_XTYPEPROVIDER()
82 // ::com::sun::star::beans::XPropertySet and friends
83 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw (::com::sun::star::uno::RuntimeException);
84 virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper();
85 virtual sal_Bool SAL_CALL convertFastPropertyValue( ::com::sun::star::uno::Any & rConvertedValue, ::com::sun::star::uno::Any & rOldValue, sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::lang::IllegalArgumentException);
86 virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue ) throw (::com::sun::star::uno::Exception);
87 virtual void SAL_CALL getFastPropertyValue( ::com::sun::star::uno::Any& rValue, sal_Int32 nHandle ) const;
89 // ::com::sun::star::inspection::XObjectInspectorModel
90 virtual ::sal_Bool SAL_CALL getHasHelpSection() throw (::com::sun::star::uno::RuntimeException);
91 virtual ::sal_Int32 SAL_CALL getMinHelpTextLines() throw (::com::sun::star::uno::RuntimeException);
92 virtual ::sal_Int32 SAL_CALL getMaxHelpTextLines() throw (::com::sun::star::uno::RuntimeException);
93 virtual ::sal_Bool SAL_CALL getIsReadOnly() throw (::com::sun::star::uno::RuntimeException);
94 virtual void SAL_CALL setIsReadOnly( ::sal_Bool _IsReadOnly ) throw (::com::sun::star::uno::RuntimeException);
96 // ::com::sun::star::lang::XServiceInfo
97 virtual ::sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) throw (::com::sun::star::uno::RuntimeException);
99 protected:
100 void enableHelpSectionProperties( sal_Int32 _nMinHelpTextLines, sal_Int32 _nMaxHelpTextLines );
102 private:
103 using ImplInspectorModel_PBase::getFastPropertyValue;
106 //........................................................................
107 } // namespace pcr
108 //........................................................................
110 #endif // INSPECTORMODELBASE_HXX