merge the formfield patch from ooo-build
[ooovba.git] / sdext / source / presenter / PresenterProtocolHandler.hxx
blobd5ea08d3e99586cf37674ff193dcaec1ab1b1f8a
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: PresenterProtocolHandler.hxx,v $
11 * $Revision: 1.4 $
13 * This file is part of OpenOffice.org.
15 * OpenOffice.org is free software: you can redistribute it and/or modify
16 * it under the terms of the GNU Lesser General Public License version 3
17 * only, as published by the Free Software Foundation.
19 * OpenOffice.org is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU Lesser General Public License version 3 for more details
23 * (a copy is included in the LICENSE file that accompanied this code).
25 * You should have received a copy of the GNU Lesser General Public License
26 * version 3 along with OpenOffice.org. If not, see
27 * <http://www.openoffice.org/license.html>
28 * for a copy of the LGPLv3 License.
30 ************************************************************************/
32 #ifndef SDEXT_PRESENTER_PRESENTER_PROTOCOL_HANDLER_HXX
33 #define SDEXT_PRESENTER_PRESENTER_PROTOCOL_HANDLER_HXX
35 #include <cppuhelper/compbase2.hxx>
36 #include <cppuhelper/basemutex.hxx>
37 #include <com/sun/star/frame/XDispatchProvider.hpp>
38 #include <com/sun/star/frame/XDispatch.hpp>
39 #include <com/sun/star/lang/XInitialization.hpp>
40 #include <com/sun/star/uno/XComponentContext.hpp>
41 #include <hash_map>
42 #include <rtl/ref.hxx>
43 #include <boost/scoped_ptr.hpp>
45 namespace css = ::com::sun::star;
47 namespace sdext { namespace presenter {
50 namespace {
51 typedef ::cppu::WeakComponentImplHelper2 <
52 css::lang::XInitialization,
53 css::frame::XDispatchProvider
54 > PresenterProtocolHandlerInterfaceBase;
57 class PresenterController;
59 class PresenterProtocolHandler
60 : protected ::cppu::BaseMutex,
61 public PresenterProtocolHandlerInterfaceBase
63 public:
64 PresenterProtocolHandler (const css::uno::Reference<css::uno::XComponentContext>& rxContext);
65 virtual ~PresenterProtocolHandler (void);
67 void SAL_CALL disposing (void);
69 static ::rtl::OUString getImplementationName_static (void);
70 static css::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_static (void);
71 static css::uno::Reference<css::uno::XInterface> Create(
72 const css::uno::Reference<css::uno::XComponentContext>& rxContext)
73 SAL_THROW((css::uno::Exception));
76 // XInitialization
78 virtual void SAL_CALL initialize(
79 const css::uno::Sequence<css::uno::Any>& aArguments)
80 throw (css::uno::Exception, css::uno::RuntimeException);
83 // XDispatchProvider
85 virtual css::uno::Reference<css::frame::XDispatch > SAL_CALL
86 queryDispatch (
87 const css::util::URL& aURL,
88 const rtl::OUString& aTargetFrameName,
89 sal_Int32 nSearchFlags )
90 throw(css::uno::RuntimeException);
92 virtual css::uno::Sequence<css::uno::Reference<css::frame::XDispatch> > SAL_CALL
93 queryDispatches(
94 const css::uno::Sequence< css::frame::DispatchDescriptor>& rDescriptors)
95 throw(css::uno::RuntimeException);
98 private:
99 class Dispatch;
100 ::rtl::Reference<PresenterController> mpPresenterController;
102 void ThrowIfDisposed (void) const throw (css::lang::DisposedException);
107 #endif