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 SD_PRESENTER_PRESENTER_HELPER_HXX 25 #define SD_PRESENTER_PRESENTER_HELPER_HXX 26 27 #include <com/sun/star/drawing/XPresenterHelper.hpp> 28 #include <com/sun/star/lang/XInitialization.hpp> 29 #include <com/sun/star/uno/XComponentContext.hpp> 30 #include <cppuhelper/basemutex.hxx> 31 #include <cppuhelper/compbase2.hxx> 32 #include <svtools/filter.hxx> 33 #include <boost/noncopyable.hpp> 34 #include <boost/scoped_ptr.hpp> 35 36 namespace css = ::com::sun::star; 37 38 namespace sd { namespace presenter { 39 40 namespace { 41 typedef ::cppu::WeakComponentImplHelper2< 42 css::lang::XInitialization, 43 css::drawing::XPresenterHelper 44 > PresenterHelperInterfaceBase; 45 } 46 47 /** Implementation of the XPresenterHelper interface: functionality that can 48 not be implemented in an extension. 49 */ 50 class PresenterHelper 51 : private ::boost::noncopyable, 52 private ::cppu::BaseMutex, 53 public PresenterHelperInterfaceBase 54 { 55 public: 56 PresenterHelper (const css::uno::Reference<css::uno::XComponentContext>& rxContext); 57 virtual ~PresenterHelper (void); 58 59 // XInitialize 60 61 virtual void SAL_CALL initialize (const css::uno::Sequence<css::uno::Any>& rArguments) 62 throw(css::uno::Exception,css::uno::RuntimeException); 63 64 65 // XPresenterHelper 66 67 virtual css::uno::Reference<css::awt::XWindow> SAL_CALL createWindow ( 68 const css::uno::Reference<css::awt::XWindow>& rxParentWindow, 69 sal_Bool bCreateSystemChildWindow, 70 sal_Bool bInitiallyVisible, 71 sal_Bool bEnableChildTransparentMode, 72 sal_Bool bEnableParentClip) 73 throw (css::uno::RuntimeException); 74 75 virtual css::uno::Reference<css::rendering::XCanvas> SAL_CALL createSharedCanvas ( 76 const css::uno::Reference<css::rendering::XSpriteCanvas>& rxUpdateCanvas, 77 const css::uno::Reference<css::awt::XWindow>& rxUpdateWindow, 78 const css::uno::Reference<css::rendering::XCanvas>& rxSharedCanvas, 79 const css::uno::Reference<css::awt::XWindow>& rxSharedWindow, 80 const css::uno::Reference<css::awt::XWindow>& rxWindow) 81 throw (css::uno::RuntimeException); 82 83 virtual css::uno::Reference<css::rendering::XCanvas> SAL_CALL createCanvas ( 84 const css::uno::Reference<css::awt::XWindow>& rxWindow, 85 sal_Int16 nRequestedCanvasFeatures, 86 const ::rtl::OUString& rsOptionalCanvasServiceName) 87 throw (css::uno::RuntimeException); 88 89 virtual void SAL_CALL toTop ( 90 const css::uno::Reference<css::awt::XWindow>& rxWindow) 91 throw (css::uno::RuntimeException); 92 93 virtual css::uno::Reference<css::rendering::XBitmap> SAL_CALL loadBitmap ( 94 const ::rtl::OUString& rsURL, 95 const css::uno::Reference<css::rendering::XCanvas>& rxCanvas) 96 throw (css::uno::RuntimeException); 97 98 virtual void SAL_CALL captureMouse (const css::uno::Reference<css::awt::XWindow>& rxWindow) 99 throw (css::uno::RuntimeException); 100 101 virtual void SAL_CALL releaseMouse (const css::uno::Reference<css::awt::XWindow>& rxWindow) 102 throw (css::uno::RuntimeException); 103 104 virtual css::awt::Rectangle SAL_CALL getWindowExtentsRelative ( 105 const css::uno::Reference<css::awt::XWindow>& rxChildWindow, 106 const css::uno::Reference<css::awt::XWindow>& rxParentWindow) 107 throw (css::uno::RuntimeException); 108 109 private: 110 css::uno::Reference<css::uno::XComponentContext> mxComponentContext; 111 ::boost::scoped_ptr<GraphicFilter> mpGraphicFilter; 112 }; 113 114 } } // end of namespace ::sd::presenter 115 116 #endif 117