Update ooo320-m1
[ooovba.git] / sd / source / ui / inc / tools / IdleDetection.hxx
blob9ace3d9b54dea7b1489400e95bd8ea2b4c484272
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: IdleDetection.hxx,v $
10 * $Revision: 1.5 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SD_IDLE_DETECTION_HXX
32 #define SD_IDLE_DETECTION_HXX
34 #include <sal/types.h>
36 class Window;
38 namespace sd { namespace tools {
40 /** Detect whether the system is idle and some time consuming operation may
41 be carried out. This class ditinguishes between different states of
42 idle-ness.
44 class IdleDetection
46 public:
47 /** When GetIdleState() returns this value, then the system is idle.
49 static const sal_Int32 IDET_IDLE = 0x0000;
51 /** There are system event pending.
53 static const sal_Int32 IDET_SYSTEM_EVENT_PENDING = 0x0001;
55 /** A full screen slide show is running and is active. In contrast
56 there may be a full screen show be running in an inactive window,
57 i.e. in the background.
59 static const sal_Int32 IDET_FULL_SCREEN_SHOW_ACTIVE = 0x0002;
61 /** A slide show is running in a window.
63 static const sal_Int32 IDET_WINDOW_SHOW_ACTIVE = 0x0004;
65 /** A window is being painted.
67 static const sal_Int32 IDET_WINDOW_PAINTING = 0x0008;
69 /** Determine whether the system is idle.
70 @param pWindow
71 When a valid Window pointer is given then it is checked
72 whether the window is currently being painting.
73 @return
74 This method either returns IDET_IDLE or a combination of
75 IdleStates values or-ed together that describe what the system
76 is currently doing so that the caller can decide what to do.
78 static sal_Int32 GetIdleState (const ::Window* pWindow = NULL);
80 private:
81 /** Check whether there are input events pending.
83 static sal_Int32 CheckInputPending (void);
85 /** Check whether a slide show is running full screen or in a window.
87 static sal_Int32 CheckSlideShowRunning (void);
89 static sal_Int32 CheckWindowPainting (const ::Window& rWindow);
92 } } // end of namespace ::sd::tools
94 #endif