update dev300-m58
[ooovba.git] / extensions / source / propctrlr / defaulthelpprovider.hxx
blob977c0e4ab266b509ab1d7266cd94fe907cf1c858
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: defaulthelpprovider.hxx,v $
10 * $Revision: 1.3 $
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 EXTENSIONS_DEFAULTHELPPROVIDER_HXX
32 #define EXTENSIONS_DEFAULTHELPPROVIDER_HXX
34 /** === begin UNO includes === **/
35 #include <com/sun/star/inspection/XPropertyControlObserver.hpp>
36 #include <com/sun/star/lang/XInitialization.hpp>
37 #include <com/sun/star/inspection/XObjectInspectorUI.hpp>
38 /** === end UNO includes === **/
40 #include <cppuhelper/implbase2.hxx>
41 #include <comphelper/componentcontext.hxx>
43 class Window;
45 //........................................................................
46 namespace pcr
48 //........................................................................
50 //====================================================================
51 //= DefaultHelpProvider
52 //====================================================================
53 typedef ::cppu::WeakImplHelper2 < ::com::sun::star::inspection::XPropertyControlObserver
54 , ::com::sun::star::lang::XInitialization
55 > DefaultHelpProvider_Base;
56 class DefaultHelpProvider : public DefaultHelpProvider_Base
58 private:
59 ::comphelper::ComponentContext m_aContext;
60 bool m_bConstructed;
61 ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XObjectInspectorUI >
62 m_xInspectorUI;
64 public:
65 DefaultHelpProvider( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext );
67 // XServiceInfo - static versions
68 static ::rtl::OUString getImplementationName_static( ) throw(::com::sun::star::uno::RuntimeException);
69 static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_static( ) throw(::com::sun::star::uno::RuntimeException);
70 static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL
71 Create(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >&);
73 protected:
74 ~DefaultHelpProvider();
76 // XPropertyControlObserver
77 virtual void SAL_CALL focusGained( const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControl >& Control ) throw (::com::sun::star::uno::RuntimeException);
78 virtual void SAL_CALL valueChanged( const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControl >& Control ) throw (::com::sun::star::uno::RuntimeException);
80 // XInitialization
81 virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException);
83 protected:
84 // Service constructors
85 void create( const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XObjectInspectorUI >& _rxUI );
87 private:
88 Window* impl_getVclControlWindow_nothrow( const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControl >& _rxControl );
89 ::rtl::OUString impl_getHelpText_nothrow( const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControl >& _rxControl );
92 //........................................................................
93 } // namespace pcr
94 //........................................................................
96 #endif // EXTENSIONS_DEFAULTHELPPROVIDER_HXX