bump product version to 4.1.6.2
[LibreOffice.git] / sd / source / ui / slideshow / SlideShowRestarter.hxx
blob928f1d10f3a799f3118ff546d9fb41a5c7017fa5
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 .
21 #include "slideshow.hxx"
22 #include "ViewShellBase.hxx"
23 #include <rtl/ref.hxx>
24 #include <tools/link.hxx>
25 #include <boost/enable_shared_from_this.hpp>
27 namespace sd {
29 /** This class is used when a display is removed or added to restart the
30 slide show. This is necessary at least with DirectX because
31 deactivating a display invalidates DirectX resources. Accessing those
32 leads to a crash.
34 During a restart a possibly installed presenter extension is given the
35 oportunity to show or hide depending on the number of available displays.
37 class SlideShowRestarter
38 : public boost::enable_shared_from_this<SlideShowRestarter>
40 public:
41 /** Create a new SlideShowRestarter object.
42 @param rpSlideShow
43 The slide show is used to determine the current slide, which is
44 restored after the restart, and of course to stop and start the
45 slide show.
46 @param pViewShellBase
47 Used to get access to a slot dispatcher.
49 SlideShowRestarter (
50 const ::rtl::Reference<SlideShow>& rpSlideShow,
51 ViewShellBase* pViewShellBase);
52 virtual ~SlideShowRestarter (void);
54 /** Restarting the slide show is an asynchronous multi step process
55 which is started by calling this method.
56 @param bForce
57 Used to force a re-start, even if the display count is unchanged.
59 void Restart (bool bForce);
61 private:
62 sal_Int32 mnEventId;
63 ::rtl::Reference<SlideShow> mpSlideShow;
64 ViewShellBase* mpViewShellBase;
65 ::boost::shared_ptr<SlideShowRestarter> mpSelf;
66 sal_Int32 mnDisplayCount;
67 SfxDispatcher* mpDispatcher;
68 sal_Int32 mnCurrentSlideNumber;
70 /** The display count is used to determine whether the number of
71 displays has changed and thus whether restarting the slide show is
72 really necessary.
74 sal_Int32 GetDisplayCount (void);
76 DECL_LINK(EndPresentation, void*);
78 /** Restart the presentation on the slide last shown before the restart
79 was initiated.
81 void StartPresentation (void);
84 } // end of namespace sd
86 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */