1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SDEXT_SOURCE_PRESENTER_PRESENTERSPRITEPANE_HXX
21 #define INCLUDED_SDEXT_SOURCE_PRESENTER_PRESENTERSPRITEPANE_HXX
23 #include "PresenterPaneBase.hxx"
24 #include "PresenterSprite.hxx"
25 #include <com/sun/star/awt/Size.hpp>
26 #include <com/sun/star/awt/XMouseListener.hpp>
27 #include <com/sun/star/awt/XMouseMotionListener.hpp>
28 #include <com/sun/star/awt/XWindowListener.hpp>
29 #include <com/sun/star/container/XChild.hpp>
30 #include <com/sun/star/drawing/XPresenterHelper.hpp>
31 #include <com/sun/star/drawing/framework/XPane.hpp>
32 #include <com/sun/star/drawing/framework/XPaneBorderPainter.hpp>
33 #include <com/sun/star/lang/XInitialization.hpp>
34 #include <com/sun/star/uno/XComponentContext.hpp>
35 #include <com/sun/star/rendering/XCanvas.hpp>
36 #include <com/sun/star/rendering/XSpriteCanvas.hpp>
37 #include <cppuhelper/basemutex.hxx>
38 #include <cppuhelper/compbase1.hxx>
39 #include <rtl/ref.hxx>
40 #include <boost/shared_ptr.hpp>
42 namespace sdext
{ namespace presenter
{
44 /** Use a sprite to display the contents and the border of a pane. Windows
45 are still used to define the locations and sizes of both the border and
46 the pane content. Note that every resize results in a disposed canvas.
47 Therefore call getCanvas in every repaint or at least after every resize.
49 class PresenterSpritePane
: public PresenterPaneBase
53 const css::uno::Reference
<css::uno::XComponentContext
>& rxContext
,
54 const ::rtl::Reference
<PresenterController
>& rpPresenterController
);
55 virtual ~PresenterSpritePane();
57 virtual void SAL_CALL
disposing() SAL_OVERRIDE
;
59 using PresenterPaneBase::disposing
;
61 ::boost::shared_ptr
<PresenterSprite
> GetSprite();
63 static OUString
getImplementationName_static();
64 static css::uno::Sequence
< OUString
> getSupportedServiceNames_static();
65 static css::uno::Reference
<css::uno::XInterface
> Create(
66 const css::uno::Reference
<css::uno::XComponentContext
>& rxContext
);
70 virtual css::uno::Reference
<css::awt::XWindow
> SAL_CALL
getWindow()
71 throw (css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
73 virtual css::uno::Reference
<css::rendering::XCanvas
> SAL_CALL
getCanvas()
74 throw (css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
78 virtual void SAL_CALL
windowResized (const css::awt::WindowEvent
& rEvent
)
79 throw (css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
81 virtual void SAL_CALL
windowMoved (const css::awt::WindowEvent
& rEvent
)
82 throw (css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
84 virtual void SAL_CALL
windowShown (const css::lang::EventObject
& rEvent
)
85 throw (css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
87 virtual void SAL_CALL
windowHidden (const css::lang::EventObject
& rEvent
)
88 throw (css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
92 virtual void SAL_CALL
windowPaint (const css::awt::PaintEvent
& rEvent
)
93 throw (css::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
96 css::uno::Reference
<css::awt::XWindow
> mxParentWindow
;
97 css::uno::Reference
<css::rendering::XSpriteCanvas
> mxParentCanvas
;
98 ::boost::shared_ptr
<PresenterSprite
> mpSprite
;
100 virtual void CreateCanvases (
101 const css::uno::Reference
<css::awt::XWindow
>& rxParentWindow
,
102 const css::uno::Reference
<css::rendering::XSpriteCanvas
>& rxParentCanvas
) SAL_OVERRIDE
;
103 void UpdateCanvases();
106 } } // end of namespace ::sd::presenter
110 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */