1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: dispatchinformationprovider.hxx,v $
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 //_________________________________________________________________________________________________________________
36 //_________________________________________________________________________________________________________________
38 #include <threadhelp/threadhelpbase.hxx>
39 #include <macros/generic.hxx>
40 #include <macros/debug.hxx>
41 #include <macros/xinterface.hxx>
44 //_________________________________________________________________________________________________________________
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 //_________________________________________________________________________________________________________________
53 //_________________________________________________________________________________________________________________
54 #include <cppuhelper/weakref.hxx>
55 #include <rtl/ustring.hxx>
56 #include <cppuhelper/weak.hxx>
57 #include <vcl/svapp.hxx>
59 //_________________________________________________________________________________________________________________
61 //_________________________________________________________________________________________________________________
65 //_________________________________________________________________________________________________________________
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 //_______________________
84 css::uno::Reference
< css::lang::XMultiServiceFactory
> m_xSMGR
;
85 css::uno::WeakReference
< css::frame::XFrame
> m_xFrame
;
87 //_______________________
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 //_______________________
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_