LibreOffice Module sd (master) 1
slideshow.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#pragma once
21
22#include <com/sun/star/presentation/XPresentation2.hpp>
23#include <com/sun/star/lang/XServiceInfo.hpp>
24
25#include <rtl/ref.hxx>
26
27#include <tools/link.hxx>
28
30
31#include <editeng/unoipset.hxx>
32
33#include <memory>
34#include <sddllapi.h>
35
36namespace com::sun::star {
37 namespace drawing {
38 class XDrawPage;
39 }
40 namespace animations {
41 class XAnimationNode;
42 }
43}
44class SdDrawDocument;
45class KeyEvent;
46class OutputDevice;
47class Size;
48namespace vcl { class Window; }
49class SfxRequest;
50class WorkWindow;
53struct ImplSVEvent;
54
55// TODO: Remove
56#define PAGE_NO_END 65535
57
58/* Definition of SlideShow class */
59
60namespace sd
61{
62
63class SlideshowImpl;
64class View;
65class ViewShell;
66class ViewShellBase;
67struct PresentationSettingsEx;
68class FrameView;
69
71{
74};
75
77
78class SlideShow final : public SlideshowBase
79{
80public:
83
84 // static helper api
88
89 static css::uno::Reference< css::presentation::XSlideShowController > GetSlideShowController(ViewShellBase const & rBase );
90
91 static bool StartPreview( ViewShellBase const & rBase,
92 const css::uno::Reference< css::drawing::XDrawPage >& xDrawPage,
93 const css::uno::Reference< css::animations::XAnimationNode >& xAnimationNode );
94
95 static void Stop( ViewShellBase const & rBase );
96
98 static bool IsRunning( ViewShellBase const & rBase );
99
102 static bool IsRunning( const ViewShell& rViewShell );
103
104 // helper api
105
106 void startPreview(
107 const css::uno::Reference< css::drawing::XDrawPage >& xDrawPage,
108 const css::uno::Reference< css::animations::XAnimationNode >& xAnimationNode );
109
110 // uno api
111
112 virtual void disposing(std::unique_lock<std::mutex>&) override;
113
114 // XServiceInfo
115 virtual OUString SAL_CALL getImplementationName( ) override;
116 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
117 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override;
118
119 // XPropertySet
120 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
121 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override;
122 virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override;
123 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
124 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
125 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
126 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
127
128 // XPresentation
129 virtual void SAL_CALL start( ) override;
130 virtual void SAL_CALL end() override;
131 virtual void SAL_CALL rehearseTimings( ) override;
132
133 // XPresentation2
134 virtual void SAL_CALL startWithArguments(const css::uno::Sequence< css::beans::PropertyValue >& Arguments) override;
135 virtual sal_Bool SAL_CALL isRunning( ) override;
136 virtual css::uno::Reference< css::presentation::XSlideShowController > SAL_CALL getController( ) override;
137
138 // legacy api
139
140 // actions
141 void jumpToPageNumber( sal_Int32 nPage ); // a.k.a. FuSlideShow::JumpToPage()
142 void jumpToPageIndex( sal_Int32 nIndex );
143 void jumpToBookmark( const OUString& sBookmark ); // a.k.a. FuSlideShow::JumpToBookmark()
144
147 void pause( bool bPause );
148 bool swipe(const CommandGestureSwipeData &rSwipeData);
149 bool longpress(const CommandGestureLongPressData& rLongPressData);
150
151 // settings
152 bool isFullScreen() const; // a.k.a. FuSlideShow::IsFullScreen()
153 OutputDevice* getShowWindow(); // a.k.a. FuSlideShow::GetShowWindow()
154 int getAnimationMode() const; // a.k.a. FuSlideShow::GetAnimationMode()
155 sal_Int32 getCurrentPageNumber() const; // a.k.a. FuSlideShow::GetCurrentPage()
156
157 // events
158 void resize( const Size &rSize );
159 // return false if the activate failed. callers should call end in response to failure
160 bool activate(ViewShellBase& rBase);
161 void deactivate();
162 void paint();
163
164 bool keyInput(const KeyEvent& rKEvt);
165
166 bool dependsOn( ViewShellBase const * pViewShellBase );
167
168 static sal_Int32 GetDisplay();
169
170 bool IsExitAfterPresenting() const;
171 void SetExitAfterPresenting(bool bExit);
172
173private:
174 SlideShow( SdDrawDocument* pDoc );
175
176 DECL_LINK( StartInPlacePresentationConfigurationHdl, void *, void );
178
181
183 void ThrowIfDisposed() const;
184
185 void CreateController( ViewShell* pViewSh, ::sd::View* pView, vcl::Window* pParentWindow );
187
188 SlideShow(const SlideShow&) = delete;
189 SlideShow& operator=( const SlideShow& ) = delete;
190
192
200
201 std::shared_ptr< PresentationSettingsEx > mxCurrentSettings;
202
207};
208
209namespace slideshowhelp
210{
211 SD_DLLPUBLIC void ShowSlideShow(SfxRequest const& rReq, SdDrawDocument& rDoc);
212}
213
214}
215
216/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
View for MDIFrame.
Definition: FrameView.hxx:36
virtual void disposing(std::unique_lock< std::mutex > &) override
Definition: slideshow.cxx:905
void SetExitAfterPresenting(bool bExit)
Definition: slideshow.cxx:650
static rtl::Reference< SlideShow > Create(SdDrawDocument *pDoc)
used by the model to create a slideshow for it
Definition: slideshow.cxx:152
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override
Definition: slideshow.cxx:538
bool mbIsInStartup
This flag is used together with mxController.is() to prevent multiple instances of the slide show for...
Definition: slideshow.hxx:198
void jumpToBookmark(const OUString &sBookmark)
Definition: slideshow.cxx:965
ImplSVEvent * mnInPlaceConfigEvent
Definition: slideshow.hxx:206
void deactivate()
Definition: slideshow.cxx:1009
virtual sal_Bool SAL_CALL isRunning() override
Definition: slideshow.cxx:890
bool isFullScreen() const
Definition: slideshow.cxx:971
virtual void SAL_CALL start() override
Definition: slideshow.cxx:624
static bool IsRunning(ViewShellBase const &rBase)
returns true if there is a running presentation for the given ViewShellBase
Definition: slideshow.cxx:208
bool swipe(const CommandGestureSwipeData &rSwipeData)
Definition: slideshow.cxx:1036
rtl::Reference< SlideshowImpl > mxController
Definition: slideshow.hxx:193
virtual void SAL_CALL end() override
Definition: slideshow.cxx:657
ViewShellBase * mpCurrentViewShellBase
Definition: slideshow.hxx:203
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
Definition: slideshow.cxx:247
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
Definition: slideshow.cxx:606
static css::uno::Reference< css::presentation::XSlideShowController > GetSlideShowController(ViewShellBase const &rBase)
Definition: slideshow.cxx:178
SlideShow & operator=(const SlideShow &)=delete
std::shared_ptr< PresentationSettingsEx > mxCurrentSettings
Definition: slideshow.hxx:201
SlideShow(const SlideShow &)=delete
void jumpToPageIndex(sal_Int32 nIndex)
Definition: slideshow.cxx:948
bool dependsOn(ViewShellBase const *pViewShellBase)
Definition: slideshow.cxx:1198
virtual void SAL_CALL rehearseTimings() override
Definition: slideshow.cxx:821
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: slideshow.cxx:618
SvxItemPropertySet maPropSet
Definition: slideshow.hxx:191
sal_Int32 getCurrentPageNumber() const
Definition: slideshow.cxx:960
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override
Definition: slideshow.cxx:260
void ThrowIfDisposed() const
Definition: slideshow.cxx:145
virtual OUString SAL_CALL getImplementationName() override
Definition: slideshow.cxx:237
WorkWindow * GetWorkWindow()
Definition: slideshow.cxx:630
void StartInPlacePresentationConfigurationCallback()
Definition: slideshow.cxx:1046
SdDrawDocument * mpDoc
Definition: slideshow.hxx:199
void startPreview(const css::uno::Reference< css::drawing::XDrawPage > &xDrawPage, const css::uno::Reference< css::animations::XAnimationNode > &xAnimationNode)
Definition: slideshow.cxx:926
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
Definition: slideshow.cxx:242
int getAnimationMode() const
Definition: slideshow.cxx:943
void StartInPlacePresentation()
Definition: slideshow.cxx:1060
SlideShow(SdDrawDocument *pDoc)
Definition: slideshow.cxx:134
static sal_Int32 GetDisplay()
convert configuration setting display concept to real screens
Definition: slideshow.cxx:1178
void resize(const Size &rSize)
Definition: slideshow.cxx:976
void StartFullscreenPresentation()
Definition: slideshow.cxx:1131
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
Definition: slideshow.cxx:614
static void Stop(ViewShellBase const &rBase)
Definition: slideshow.cxx:201
OutputDevice * getShowWindow()
Definition: slideshow.cxx:938
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
Definition: slideshow.cxx:610
bool activate(ViewShellBase &rBase)
Definition: slideshow.cxx:982
virtual css::uno::Reference< css::presentation::XSlideShowController > SAL_CALL getController() override
Definition: slideshow.cxx:896
void jumpToPageNumber(sal_Int32 nPage)
Definition: slideshow.cxx:954
DECL_LINK(StartInPlacePresentationConfigurationHdl, void *, void)
static bool StartPreview(ViewShellBase const &rBase, const css::uno::Reference< css::drawing::XDrawPage > &xDrawPage, const css::uno::Reference< css::animations::XAnimationNode > &xAnimationNode)
Definition: slideshow.cxx:189
static rtl::Reference< SlideShow > GetSlideShow(SdDrawDocument const *pDocument)
Definition: slideshow.cxx:157
void pause(bool bPause)
sets or clears the pause state of the running slideshow.
Definition: slideshow.cxx:1025
virtual void SAL_CALL startWithArguments(const css::uno::Sequence< css::beans::PropertyValue > &Arguments) override
Definition: slideshow.cxx:829
bool IsExitAfterPresenting() const
Definition: slideshow.cxx:643
bool longpress(const CommandGestureLongPressData &rLongPressData)
Definition: slideshow.cxx:1041
bool keyInput(const KeyEvent &rKEvt)
Definition: slideshow.cxx:1014
ViewShellBase * mpFullScreenViewShellBase
Definition: slideshow.hxx:204
FrameView * mpFullScreenFrameView
Definition: slideshow.hxx:205
void CreateController(ViewShell *pViewSh, ::sd::View *pView, vcl::Window *pParentWindow)
Definition: slideshow.cxx:220
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
Definition: slideshow.cxx:253
SfxViewShell descendant that the stacked Draw/Impress shells are based on.
Base class of the stacked shell hierarchy.
Definition: ViewShell.hxx:92
sal_Int32 nIndex
SD_DLLPUBLIC void ShowSlideShow(SfxRequest const &rReq, SdDrawDocument &rDoc)
Definition: drviewse.cxx:1656
AnimationMode
Definition: slideshow.hxx:71
@ ANIMATIONMODE_SHOW
Definition: slideshow.hxx:72
@ ANIMATIONMODE_PREVIEW
Definition: slideshow.hxx:73
comphelper::WeakComponentImplHelper< css::presentation::XPresentation2, css::lang::XServiceInfo > SlideshowBase
Definition: slideshow.hxx:76
#define SD_DLLPUBLIC
Definition: sddllapi.h:27
unsigned char sal_Bool