bump product version to 6.3.0.0.beta1
[LibreOffice.git] / sd / source / ui / slideshow / SlideShowRestarter.hxx
blob9cadc0a58189d9d1763b51768946f7241ff89c33
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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_SD_SOURCE_UI_SLIDESHOW_SLIDESHOWRESTARTER_HXX
21 #define INCLUDED_SD_SOURCE_UI_SLIDESHOW_SLIDESHOWRESTARTER_HXX
23 #include <rtl/ref.hxx>
24 #include <tools/link.hxx>
25 #include <memory>
27 namespace sd { class SlideShow; }
28 namespace sd { class ViewShellBase; }
29 class SfxDispatcher;
30 struct ImplSVEvent;
32 namespace sd {
34 /** This class is used when a display is removed or added to restart the
35 slide show. This is necessary at least with DirectX because
36 deactivating a display invalidates DirectX resources. Accessing those
37 leads to a crash.
39 During a restart a possibly installed presenter extension is given the
40 opportunity to show or hide depending on the number of available displays.
42 class SlideShowRestarter
43 : public std::enable_shared_from_this<SlideShowRestarter>
45 public:
46 /** Create a new SlideShowRestarter object.
47 @param rpSlideShow
48 The slide show is used to determine the current slide, which is
49 restored after the restart, and of course to stop and start the
50 slide show.
51 @param pViewShellBase
52 Used to get access to a slot dispatcher.
54 SlideShowRestarter (
55 const ::rtl::Reference<SlideShow>& rpSlideShow,
56 ViewShellBase* pViewShellBase);
57 virtual ~SlideShowRestarter();
59 /** Restarting the slide show is an asynchronous multi step process
60 which is started by calling this method.
61 @param bForce
62 Used to force a re-start, even if the display count is unchanged.
64 void Restart (bool bForce);
66 private:
67 ImplSVEvent * mnEventId;
68 ::rtl::Reference<SlideShow> mpSlideShow;
69 ViewShellBase* mpViewShellBase;
70 ::std::shared_ptr<SlideShowRestarter> mpSelf;
71 sal_Int32 mnDisplayCount;
72 SfxDispatcher* mpDispatcher;
73 sal_Int32 mnCurrentSlideNumber;
75 DECL_LINK(EndPresentation, void*, void);
77 /** Restart the presentation on the slide last shown before the restart
78 was initiated.
80 void StartPresentation();
83 } // end of namespace sd
85 #endif // INCLUDED_SD_SOURCE_UI_SLIDESHOW_SLIDESHOWRESTARTER_HXX
87 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */