1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef __FRAMEWORK_DISPATCH_DISPATCHINFORMATIONPROVIDER_HXX_
29 #define __FRAMEWORK_DISPATCH_DISPATCHINFORMATIONPROVIDER_HXX_
30 
31 //_________________________________________________________________________________________________________________
32 //	my own includes
33 //_________________________________________________________________________________________________________________
34 
35 #include <threadhelp/threadhelpbase.hxx>
36 #include <macros/generic.hxx>
37 #include <macros/debug.hxx>
38 #include <macros/xinterface.hxx>
39 #include <general.h>
40 
41 //_________________________________________________________________________________________________________________
42 //	interface includes
43 //_________________________________________________________________________________________________________________
44 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
45 #include <com/sun/star/frame/XFrame.hpp>
46 #include <com/sun/star/frame/XDispatchInformationProvider.hpp>
47 
48 //_________________________________________________________________________________________________________________
49 //	other includes
50 //_________________________________________________________________________________________________________________
51 #include <cppuhelper/weakref.hxx>
52 #include <rtl/ustring.hxx>
53 #include <cppuhelper/weak.hxx>
54 #include <vcl/svapp.hxx>
55 
56 //_________________________________________________________________________________________________________________
57 //	namespace
58 //_________________________________________________________________________________________________________________
59 
60 namespace framework{
61 
62 //_________________________________________________________________________________________________________________
63 //	exported const
64 //_________________________________________________________________________________________________________________
65 
66 //_________________________________________________________________________________________________________________
67 //	exported definitions
68 //_________________________________________________________________________________________________________________
69 
70 /*-************************************************************************************************************//**
71     @short          a helper to merge dispatch informations of different sources together.
72 *//*-*************************************************************************************************************/
73 class DispatchInformationProvider : public  css::frame::XDispatchInformationProvider
74                                   , private ThreadHelpBase
75                                   , public  ::cppu::OWeakObject
76 {
77     //_______________________
78     // member
79     private:
80 
81         css::uno::Reference< css::lang::XMultiServiceFactory > m_xSMGR;
82         css::uno::WeakReference< css::frame::XFrame > m_xFrame;
83 
84     //_______________________
85     // interface
86 	public:
87 
88         DispatchInformationProvider(const css::uno::Reference< css::lang::XMultiServiceFactory >& xSMGR ,
89                                     const css::uno::Reference< css::frame::XFrame >&              xFrame);
90 
91         virtual ~DispatchInformationProvider();
92 
93         FWK_DECLARE_XINTERFACE
94 
95         virtual css::uno::Sequence< sal_Int16 > SAL_CALL getSupportedCommandGroups()
96             throw (css::uno::RuntimeException);
97 
98         virtual css::uno::Sequence< css::frame::DispatchInformation > SAL_CALL getConfigurableDispatchInformation(sal_Int16 nCommandGroup)
99             throw (css::uno::RuntimeException);
100 
101     //_______________________
102     // helper
103 	private:
104 
105         css::uno::Sequence< css::uno::Reference< css::frame::XDispatchInformationProvider > > implts_getAllSubProvider();
106 
107 }; // class DispatchInformationProvider
108 
109 } // namespace framework
110 
111 #endif // #ifndef __FRAMEWORK_DISPATCH_DISPATCHINFORMATIONPROVIDER_HXX_
112