Bumping manifests a=b2g-bump
[gecko.git] / widget / qt / nsIdleServiceQt.h
blobeb0e5ae0957d3e1e099a6ec6d5e4b0f4e214b0b6
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* vim:expandtab:shiftwidth=4:tabstop=4:
3 */
4 /* This Source Code Form is subject to the terms of the Mozilla Public
5 * License, v. 2.0. If a copy of the MPL was not distributed with this
6 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
8 #ifndef nsIdleServiceQt_h__
9 #define nsIdleServiceQt_h__
11 #include "nsIdleService.h"
13 #if defined(MOZ_X11)
14 #include <X11/Xlib.h>
15 #include <X11/Xutil.h>
17 typedef struct {
18 Window window; // Screen saver window
19 int state; // ScreenSaver(Off,On,Disabled)
20 int kind; // ScreenSaver(Blanked,Internal,External)
21 unsigned long til_or_since; // milliseconds since/til screensaver kicks in
22 unsigned long idle; // milliseconds idle
23 unsigned long event_mask; // event stuff
24 } XScreenSaverInfo;
25 #endif
27 class nsIdleServiceQt : public nsIdleService
29 public:
30 NS_DECL_ISUPPORTS_INHERITED
32 bool PollIdleTime(uint32_t* aIdleTime);
34 static already_AddRefed<nsIdleServiceQt> GetInstance()
36 nsRefPtr<nsIdleServiceQt> idleService =
37 nsIdleService::GetInstance().downcast<nsIdleServiceQt>();
38 if (!idleService) {
39 idleService = new nsIdleServiceQt();
42 return idleService.forget();
45 private:
46 #if defined(MOZ_X11)
47 XScreenSaverInfo* mXssInfo;
48 #endif
50 protected:
51 nsIdleServiceQt();
52 virtual ~nsIdleServiceQt();
53 bool UsePollMode();
56 #endif // nsIdleServiceQt_h__