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 .
22 #include <rtl/ref.hxx>
23 #include <tools/link.hxx>
39 /** This class is used when a display is removed or added to restart the
40 slide show. This is necessary at least with DirectX because
41 deactivating a display invalidates DirectX resources. Accessing those
44 During a restart a possibly installed presenter extension is given the
45 opportunity to show or hide depending on the number of available displays.
47 class SlideShowRestarter
: public std::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.
58 SlideShowRestarter(::rtl::Reference
<SlideShow
> pSlideShow
, ViewShellBase
* pViewShellBase
);
59 virtual ~SlideShowRestarter();
61 /** Restarting the slide show is an asynchronous multi step process
62 which is started by calling this method.
64 Used to force a re-start, even if the display count is unchanged.
66 void Restart(bool bForce
);
69 ImplSVEvent
* mnEventId
;
70 ::rtl::Reference
<SlideShow
> mpSlideShow
;
71 ViewShellBase
* mpViewShellBase
;
72 ::std::shared_ptr
<SlideShowRestarter
> mpSelf
;
73 sal_Int32 mnDisplayCount
;
74 SfxDispatcher
* mpDispatcher
;
75 sal_Int32 mnCurrentSlideNumber
;
77 DECL_LINK(EndPresentation
, void*, void);
79 /** Restart the presentation on the slide last shown before the restart
82 void StartPresentation();
85 } // end of namespace sd
87 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */