1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 #ifndef SD_IDLE_DETECTION_HXX
29 #define SD_IDLE_DETECTION_HXX
31 #include <sal/types.h>
35 namespace sd
{ namespace tools
{
37 /** Detect whether the system is idle and some time consuming operation may
38 be carried out. This class ditinguishes between different states of
44 /** When GetIdleState() returns this value, then the system is idle.
46 static const sal_Int32 IDET_IDLE
= 0x0000;
48 /** There are system event pending.
50 static const sal_Int32 IDET_SYSTEM_EVENT_PENDING
= 0x0001;
52 /** A full screen slide show is running and is active. In contrast
53 there may be a full screen show be running in an inactive window,
54 i.e. in the background.
56 static const sal_Int32 IDET_FULL_SCREEN_SHOW_ACTIVE
= 0x0002;
58 /** A slide show is running in a window.
60 static const sal_Int32 IDET_WINDOW_SHOW_ACTIVE
= 0x0004;
62 /** A window is being painted.
64 static const sal_Int32 IDET_WINDOW_PAINTING
= 0x0008;
66 /** Determine whether the system is idle.
68 When a valid Window pointer is given then it is checked
69 whether the window is currently being painting.
71 This method either returns IDET_IDLE or a combination of
72 IdleStates values or-ed together that describe what the system
73 is currently doing so that the caller can decide what to do.
75 static sal_Int32
GetIdleState (const ::Window
* pWindow
= NULL
);
78 /** Check whether there are input events pending.
80 static sal_Int32
CheckInputPending (void);
82 /** Check whether a slide show is running full screen or in a window.
84 static sal_Int32
CheckSlideShowRunning (void);
86 static sal_Int32
CheckWindowPainting (const ::Window
& rWindow
);
89 } } // end of namespace ::sd::tools