Version 6.1.0.2, tag libreoffice-6.1.0.2
[LibreOffice.git] / sd / source / ui / slideshow / showwindow.hxx
blob80f8d14bef2caf1464a62d4a049ff87a878b0604
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_SHOWWINDOW_HXX
21 #define INCLUDED_SD_SOURCE_UI_SLIDESHOW_SHOWWINDOW_HXX
23 #include <rtl/ref.hxx>
24 #include <sal/types.h>
25 #include <vcl/timer.hxx>
26 #include <vcl/graph.hxx>
28 #include <Window.hxx>
30 #include "slideshowimpl.hxx"
32 namespace sd {
34 class SlideshowImpl;
36 #define SLIDE_NO_TIMEOUT SAL_MAX_INT32
38 enum ShowWindowMode
40 SHOWWINDOWMODE_NORMAL = 0,
41 SHOWWINDOWMODE_PAUSE = 1,
42 SHOWWINDOWMODE_END = 2,
43 SHOWWINDOWMODE_BLANK = 3,
44 SHOWWINDOWMODE_PREVIEW = 4
47 class ShowWindow
48 : public ::sd::Window
51 public:
52 ShowWindow ( const ::rtl::Reference< ::sd::SlideshowImpl >& xController, vcl::Window* pParent );
53 virtual ~ShowWindow() override;
54 virtual void dispose() override;
56 void SetEndMode();
57 bool SetPauseMode( sal_Int32 nTimeoutSec, Graphic const * pLogo = nullptr );
58 bool SetBlankMode( sal_Int32 nPageIndexToRestart, const Color& rBlankColor );
60 const Color& GetBlankColor() const { return maShowBackground.GetColor(); }
62 void SetPreviewMode();
63 void SetPresentationArea( const ::tools::Rectangle& rPresArea );
65 void SetMouseAutoHide( bool bMouseAutoHide ) { mbMouseAutoHide = bMouseAutoHide; }
67 ShowWindowMode GetShowWindowMode() const { return meShowWindowMode; }
69 void RestartShow( sal_Int32 nPageIndexToRestart );
71 virtual void LoseFocus() override;
73 virtual void KeyInput(const KeyEvent& rKEvt) override;
74 virtual void MouseMove(const MouseEvent& rMEvt) override;
75 virtual void MouseButtonUp(const MouseEvent& rMEvt) override;
76 virtual void MouseButtonDown(const MouseEvent& rMEvt) override;
77 virtual void Paint(vcl::RenderContext& rRenderContext, const ::tools::Rectangle& rRect) override;
78 /// Override the sd::Window's CreateAccessible to create a different accessible object
79 virtual css::uno::Reference<css::accessibility::XAccessible>
80 CreateAccessible() override;
82 void TerminateShow();
83 void RestartShow();
85 private:
86 void DrawPauseScene( bool bTimeoutOnly );
87 void DrawEndScene();
89 void DeleteWindowFromPaintView();
90 void AddWindowToPaintView();
92 private:
93 Timer maPauseTimer;
94 Timer maMouseTimer;
95 Wallpaper maShowBackground;
96 Graphic maLogo;
97 sal_uLong mnPauseTimeout;
98 sal_Int32 mnRestartPageIndex;
99 ShowWindowMode meShowWindowMode;
100 bool mbShowNavigatorAfterSpecialMode;
101 ::tools::Rectangle maPresArea;
102 bool mbMouseAutoHide;
103 bool mbMouseCursorHidden;
104 sal_uInt64 mnFirstMouseMove;
106 DECL_LINK( PauseTimeoutHdl, Timer*, void );
107 DECL_LINK(MouseTimeoutHdl, Timer *, void);
108 DECL_LINK( EventHdl, VclWindowEvent&, void );
110 ::rtl::Reference< SlideshowImpl > mxController;
113 } // end of namespace sd
115 #endif
117 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */