bump product version to 5.0.4.1
[LibreOffice.git] / sd / source / ui / inc / tools / IdleDetection.hxx
blob63690dc84662894002995aa3113d444aa5aa8876
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_INC_TOOLS_IDLEDETECTION_HXX
21 #define INCLUDED_SD_SOURCE_UI_INC_TOOLS_IDLEDETECTION_HXX
23 #include <sal/types.h>
25 namespace vcl { class Window; }
27 namespace sd { namespace tools {
29 /** Detect whether the system is idle and some time consuming operation may
30 be carried out. This class ditinguishes between different states of
31 idle-ness.
33 class IdleDetection
35 public:
36 /** When GetIdleState() returns this value, then the system is idle.
38 static const sal_Int32 IDET_IDLE = 0x0000;
40 /** There are system event pending.
42 static const sal_Int32 IDET_SYSTEM_EVENT_PENDING = 0x0001;
44 /** A full screen slide show is running and is active. In contrast
45 there may be a full screen show be running in an inactive window,
46 i.e. in the background.
48 static const sal_Int32 IDET_FULL_SCREEN_SHOW_ACTIVE = 0x0002;
50 /** A slide show is running in a window.
52 static const sal_Int32 IDET_WINDOW_SHOW_ACTIVE = 0x0004;
54 /** A window is being painted.
56 static const sal_Int32 IDET_WINDOW_PAINTING = 0x0008;
58 /** Determine whether the system is idle.
59 @param pWindow
60 When a valid Window pointer is given then it is checked
61 whether the window is currently being painting.
62 @return
63 This method either returns IDET_IDLE or a combination of
64 IdleStates values or-ed together that describe what the system
65 is currently doing so that the caller can decide what to do.
67 static sal_Int32 GetIdleState (const vcl::Window* pWindow = NULL);
69 private:
70 /** Check whether there are input events pending.
72 static sal_Int32 CheckInputPending();
74 /** Check whether a slide show is running full screen or in a window.
76 static sal_Int32 CheckSlideShowRunning();
78 static sal_Int32 CheckWindowPainting (const vcl::Window& rWindow);
81 } } // end of namespace ::sd::tools
83 #endif
85 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */