1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
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.
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).
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.
26 ************************************************************************/
28 #include "precompiled_sd.hxx"
30 #include "slideshow.hxx"
31 #include "ViewShellBase.hxx"
32 #include <rtl/ref.hxx>
33 #include <tools/link.hxx>
34 #include <boost/enable_shared_from_this.hpp>
38 /** This class is used when a display is removed or added to restart the
39 slide show. This is necessary at least with DirectX because
40 deactivating a display invalidates DirectX resources. Accessing those
43 During a restart a possibly installed presenter extension is given the
44 oportunity to show or hide depending on the number of available displays.
46 class SlideShowRestarter
47 : public boost::enable_shared_from_this
<SlideShowRestarter
>
50 /** Create a new SlideShowRestarter object.
52 The slide show is used to determine the current slide, which is
53 restored after the restart, and of course to stop and start the
56 Used to get access to a slot dispatcher.
59 const ::rtl::Reference
<SlideShow
>& rpSlideShow
,
60 ViewShellBase
* pViewShellBase
);
61 virtual ~SlideShowRestarter (void);
63 /** Restarting the slide show is an asynchronous multi step process
64 which is started by calling this method.
70 ::rtl::Reference
<SlideShow
> mpSlideShow
;
71 ViewShellBase
* mpViewShellBase
;
72 ::boost::shared_ptr
<SlideShowRestarter
> mpSelf
;
73 sal_Int32 mnDisplayCount
;
74 SfxDispatcher
* mpDispatcher
;
75 sal_Int32 mnCurrentSlideNumber
;
77 /** The display count is used to determine whether the number of
78 displays has changed and thus whether restarting the slide show is
81 sal_Int32
GetDisplayCount (void);
83 DECL_LINK(EndPresentation
, void*);
85 /** Restart the presentation on the slide last shown before the restart
88 void StartPresentation (void);
91 } // end of namespace sd