merge the formfield patch from ooo-build
[ooovba.git] / framework / inc / dispatch / dispatchinformationprovider.hxx
blob6790d094602c8030c287146a997e0142bbc80939
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: dispatchinformationprovider.hxx,v $
10 * $Revision: 1.5 $
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 __FRAMEWORK_DISPATCH_DISPATCHINFORMATIONPROVIDER_HXX_
32 #define __FRAMEWORK_DISPATCH_DISPATCHINFORMATIONPROVIDER_HXX_
34 //_________________________________________________________________________________________________________________
35 // my own includes
36 //_________________________________________________________________________________________________________________
38 #include <threadhelp/threadhelpbase.hxx>
39 #include <macros/generic.hxx>
40 #include <macros/debug.hxx>
41 #include <macros/xinterface.hxx>
42 #include <general.h>
44 //_________________________________________________________________________________________________________________
45 // interface includes
46 //_________________________________________________________________________________________________________________
47 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
48 #include <com/sun/star/frame/XFrame.hpp>
49 #include <com/sun/star/frame/XDispatchInformationProvider.hpp>
51 //_________________________________________________________________________________________________________________
52 // other includes
53 //_________________________________________________________________________________________________________________
54 #include <cppuhelper/weakref.hxx>
55 #include <rtl/ustring.hxx>
56 #include <cppuhelper/weak.hxx>
57 #include <vcl/svapp.hxx>
59 //_________________________________________________________________________________________________________________
60 // namespace
61 //_________________________________________________________________________________________________________________
63 namespace framework{
65 //_________________________________________________________________________________________________________________
66 // exported const
67 //_________________________________________________________________________________________________________________
69 //_________________________________________________________________________________________________________________
70 // exported definitions
71 //_________________________________________________________________________________________________________________
73 /*-************************************************************************************************************//**
74 @short a helper to merge dispatch informations of different sources together.
75 *//*-*************************************************************************************************************/
76 class DispatchInformationProvider : public css::frame::XDispatchInformationProvider
77 , private ThreadHelpBase
78 , public ::cppu::OWeakObject
80 //_______________________
81 // member
82 private:
84 css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR;
85 css::uno::WeakReference< css::frame::XFrame > m_xFrame;
87 //_______________________
88 // interface
89 public:
91 DispatchInformationProvider(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR ,
92 const css::uno::Reference< css::frame::XFrame >& xFrame);
94 virtual ~DispatchInformationProvider();
96 FWK_DECLARE_XINTERFACE
98 virtual css::uno::Sequence< sal_Int16 > SAL_CALL getSupportedCommandGroups()
99 throw (css::uno::RuntimeException);
101 virtual css::uno::Sequence< css::frame::DispatchInformation > SAL_CALL getConfigurableDispatchInformation(sal_Int16 nCommandGroup)
102 throw (css::uno::RuntimeException);
104 //_______________________
105 // helper
106 private:
108 css::uno::Sequence< css::uno::Reference< css::frame::XDispatchInformationProvider > > implts_getAllSubProvider();
110 }; // class DispatchInformationProvider
112 } // namespace framework
114 #endif // #ifndef __FRAMEWORK_DISPATCH_DISPATCHINFORMATIONPROVIDER_HXX_