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