1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef SDEXT_PRESENTER_PRESENTER_PROTOCOL_HANDLER_HXX 25 #define SDEXT_PRESENTER_PRESENTER_PROTOCOL_HANDLER_HXX 26 27 #include <cppuhelper/compbase2.hxx> 28 #include <cppuhelper/basemutex.hxx> 29 #include <com/sun/star/frame/XDispatchProvider.hpp> 30 #include <com/sun/star/frame/XDispatch.hpp> 31 #include <com/sun/star/lang/XInitialization.hpp> 32 #include <com/sun/star/uno/XComponentContext.hpp> 33 #include <hash_map> 34 #include <rtl/ref.hxx> 35 #include <boost/scoped_ptr.hpp> 36 37 namespace css = ::com::sun::star; 38 39 namespace sdext { namespace presenter { 40 41 42 namespace { 43 typedef ::cppu::WeakComponentImplHelper2 < 44 css::lang::XInitialization, 45 css::frame::XDispatchProvider 46 > PresenterProtocolHandlerInterfaceBase; 47 } 48 49 class PresenterController; 50 51 class PresenterProtocolHandler 52 : protected ::cppu::BaseMutex, 53 public PresenterProtocolHandlerInterfaceBase 54 { 55 public: 56 PresenterProtocolHandler (const css::uno::Reference<css::uno::XComponentContext>& rxContext); 57 virtual ~PresenterProtocolHandler (void); 58 59 void SAL_CALL disposing (void); 60 61 static ::rtl::OUString getImplementationName_static (void); 62 static css::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_static (void); 63 static css::uno::Reference<css::uno::XInterface> Create( 64 const css::uno::Reference<css::uno::XComponentContext>& rxContext) 65 SAL_THROW((css::uno::Exception)); 66 67 68 // XInitialization 69 70 virtual void SAL_CALL initialize( 71 const css::uno::Sequence<css::uno::Any>& aArguments) 72 throw (css::uno::Exception, css::uno::RuntimeException); 73 74 75 // XDispatchProvider 76 77 virtual css::uno::Reference<css::frame::XDispatch > SAL_CALL 78 queryDispatch ( 79 const css::util::URL& aURL, 80 const rtl::OUString& aTargetFrameName, 81 sal_Int32 nSearchFlags ) 82 throw(css::uno::RuntimeException); 83 84 virtual css::uno::Sequence<css::uno::Reference<css::frame::XDispatch> > SAL_CALL 85 queryDispatches( 86 const css::uno::Sequence< css::frame::DispatchDescriptor>& rDescriptors) 87 throw(css::uno::RuntimeException); 88 89 90 private: 91 class Dispatch; 92 ::rtl::Reference<PresenterController> mpPresenterController; 93 94 void ThrowIfDisposed (void) const throw (css::lang::DisposedException); 95 }; 96 97 } } 98 99 #endif 100