Line data Source code
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 : #ifndef INCLUDED_SD_SOURCE_UI_SLIDESHOW_SHOWWINDOW_HXX
21 : #define INCLUDED_SD_SOURCE_UI_SLIDESHOW_SHOWWINDOW_HXX
22 :
23 : #include <rtl/ref.hxx>
24 : #include <sal/types.h>
25 : #include <vcl/timer.hxx>
26 : #include <vcl/graph.hxx>
27 :
28 : #include "Window.hxx"
29 :
30 : #include "slideshowimpl.hxx"
31 :
32 : namespace sd {
33 :
34 : class SlideshowImpl;
35 :
36 : #define SLIDE_NO_TIMEOUT SAL_MAX_INT32
37 :
38 : enum ShowWindowMode
39 : {
40 : SHOWWINDOWMODE_NORMAL = 0,
41 : SHOWWINDOWMODE_PAUSE = 1,
42 : SHOWWINDOWMODE_END = 2,
43 : SHOWWINDOWMODE_BLANK = 3,
44 : SHOWWINDOWMODE_PREVIEW = 4
45 : };
46 :
47 : class ShowWindow
48 : : public ::sd::Window
49 : {
50 :
51 : public:
52 : ShowWindow ( const ::rtl::Reference< ::sd::SlideshowImpl >& xController, vcl::Window* pParent );
53 : virtual ~ShowWindow();
54 : virtual void dispose() SAL_OVERRIDE;
55 :
56 : bool SetEndMode();
57 : bool SetPauseMode( sal_Int32 nPageIndexToRestart, sal_Int32 nTimeoutSec = SLIDE_NO_TIMEOUT, Graphic* pLogo = NULL );
58 : bool SetBlankMode( sal_Int32 nPageIndexToRestart, const Color& rBlankColor );
59 :
60 0 : const Color& GetBlankColor() const { return maShowBackground.GetColor(); }
61 :
62 : void SetPreviewMode();
63 : void SetPresentationArea( const Rectangle& rPresArea );
64 :
65 0 : void SetMouseAutoHide( bool bMouseAutoHide ) { mbMouseAutoHide = bMouseAutoHide; }
66 :
67 0 : ShowWindowMode GetShowWindowMode() const { return meShowWindowMode; }
68 :
69 : void RestartShow( sal_Int32 nPageIndexToRestart );
70 :
71 : virtual void Move() SAL_OVERRIDE;
72 : virtual void Resize() SAL_OVERRIDE;
73 : virtual void GetFocus() SAL_OVERRIDE;
74 : virtual void LoseFocus() SAL_OVERRIDE;
75 :
76 : virtual void KeyInput(const KeyEvent& rKEvt) SAL_OVERRIDE;
77 : virtual void MouseMove(const MouseEvent& rMEvt) SAL_OVERRIDE;
78 : virtual void MouseButtonUp(const MouseEvent& rMEvt) SAL_OVERRIDE;
79 : virtual void MouseButtonDown(const MouseEvent& rMEvt) SAL_OVERRIDE;
80 : virtual void Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect) SAL_OVERRIDE;
81 : /// Override the sd::Window's CreateAccessible to create a different accessible object
82 : virtual ::com::sun::star::uno::Reference<
83 : ::com::sun::star::accessibility::XAccessible>
84 : CreateAccessible() SAL_OVERRIDE;
85 :
86 : void TerminateShow();
87 : void RestartShow();
88 :
89 : private:
90 : void DrawPauseScene( bool bTimeoutOnly );
91 : void DrawEndScene();
92 :
93 : void DeleteWindowFromPaintView();
94 : void AddWindowToPaintView();
95 :
96 : private:
97 : Timer maPauseTimer;
98 : Timer maMouseTimer;
99 : Wallpaper maShowBackground;
100 : Graphic maLogo;
101 : sal_uLong mnPauseTimeout;
102 : sal_Int32 mnRestartPageIndex;
103 : ShowWindowMode meShowWindowMode;
104 : bool mbShowNavigatorAfterSpecialMode;
105 : Rectangle maPresArea;
106 : bool mbMouseAutoHide;
107 : bool mbMouseCursorHidden;
108 : sal_uInt64 mnFirstMouseMove;
109 :
110 : DECL_LINK_TYPED( PauseTimeoutHdl, Timer*, void );
111 : DECL_LINK_TYPED(MouseTimeoutHdl, Timer *, void);
112 : DECL_LINK( EventHdl, VclWindowEvent* pEvent );
113 :
114 : ::rtl::Reference< SlideshowImpl > mxController;
115 : };
116 :
117 : } // end of namespace sd
118 :
119 : #endif
120 :
121 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|