Coverage Report

Created: 2026-11-06 11:29

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/sd/source/ui/slideshow/showwindow.hxx
Line
Count
Source
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 <rtl/ref.hxx>
23
#include <sal/types.h>
24
#include <vcl/timer.hxx>
25
#include <vcl/graph.hxx>
26
27
#include <Window.hxx>
28
29
namespace sd {
30
31
class SlideShowController;
32
33
0
#define SLIDE_NO_TIMEOUT SAL_MAX_INT32
34
35
enum ShowWindowMode
36
{
37
    SHOWWINDOWMODE_NORMAL = 0,
38
    SHOWWINDOWMODE_PAUSE = 1,
39
    SHOWWINDOWMODE_END = 2,
40
    SHOWWINDOWMODE_BLANK = 3,
41
    SHOWWINDOWMODE_PREVIEW = 4
42
};
43
44
class ShowWindow
45
    : public ::sd::Window
46
{
47
48
public:
49
    ShowWindow(::rtl::Reference<::sd::SlideShowController> xController, vcl::Window* pParent);
50
    virtual ~ShowWindow() override;
51
    virtual void dispose() override;
52
53
    void            SetEndMode();
54
    bool            SetPauseMode( sal_Int32 nTimeoutSec, Graphic const * pLogo = nullptr );
55
    bool            SetBlankMode( sal_Int32 nPageIndexToRestart, const Color& rBlankColor );
56
57
0
    const Color&        GetBlankColor() const { return maShowBackground.GetColor(); }
58
59
    void            SetPreviewMode();
60
61
0
    void            SetMouseAutoHide( bool bMouseAutoHide ) { mbMouseAutoHide = bMouseAutoHide; }
62
63
0
    ShowWindowMode  GetShowWindowMode() const { return meShowWindowMode; }
64
65
    void            RestartShow( sal_Int32 nPageIndexToRestart );
66
67
    virtual void    LoseFocus() override;
68
69
    virtual void    KeyInput(const KeyEvent& rKEvt) override;
70
    virtual void    MouseMove(const MouseEvent& rMEvt) override;
71
    virtual void    MouseButtonUp(const MouseEvent& rMEvt) override;
72
    virtual void    MouseButtonDown(const MouseEvent& rMEvt) override;
73
    virtual void    Paint(vcl::RenderContext& rRenderContext, const ::tools::Rectangle& rRect) override;
74
    /// Override the sd::Window's CreateAccessible to create a different accessible object
75
    rtl::Reference<comphelper::OAccessible> CreateAccessible() override;
76
77
    void            TerminateShow();
78
    void            RestartShow();
79
80
private:
81
    void            DrawPauseScene( bool bTimeoutOnly );
82
    void            DrawEndScene();
83
84
    void            DeleteWindowFromPaintView();
85
    void            AddWindowToPaintView();
86
87
private:
88
    Timer           maPauseTimer;
89
    Timer           maMouseTimer;
90
    Wallpaper       maShowBackground;
91
    Graphic         maLogo;
92
    sal_uLong           mnPauseTimeout;
93
    sal_Int32       mnRestartPageIndex;
94
    ShowWindowMode  meShowWindowMode;
95
    bool            mbShowNavigatorAfterSpecialMode;
96
    bool            mbMouseAutoHide;
97
    bool            mbMouseCursorHidden;
98
    sal_uInt64      mnFirstMouseMove;
99
100
                    DECL_LINK( PauseTimeoutHdl, Timer*, void );
101
                    DECL_LINK(MouseTimeoutHdl, Timer *, void);
102
                    DECL_LINK( EventHdl, VclWindowEvent&, void );
103
104
    rtl::Reference<SlideShowController> mxController;
105
};
106
107
} // end of namespace sd
108
109
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */