2 * Copyright 2003-2006, Michael Phipps. All rights reserved.
3 * Distributed under the terms of the MIT License.
5 #ifndef SCREEN_SAVER_SETTINGS_H
6 #define SCREEN_SAVER_SETTINGS_H
26 ENABLE_DPMS_STAND_BY
= 0x02,
27 ENABLE_DPMS_SUSPEND
= 0x04,
28 ENABLE_DPMS_OFF
= 0x08,
31 = ENABLE_DPMS_STAND_BY
| ENABLE_DPMS_SUSPEND
| ENABLE_DPMS_OFF
34 #define SCREEN_BLANKER_SIG "application/x-vnd.Haiku.screenblanker"
37 class ScreenSaverSettings
{
39 ScreenSaverSettings();
44 BPath
& Path() { return fSettingsPath
; }
46 // General screen saver settings
47 int32
TimeFlags() const { return fTimeFlags
; }
48 bigtime_t
BlankTime() const { return fBlankTime
; }
49 bigtime_t
StandByTime() const { return fStandByTime
; }
50 bigtime_t
SuspendTime() const { return fSuspendTime
; }
51 bigtime_t
OffTime() const { return fOffTime
; }
53 screen_corner
BlankCorner() const { return fBlankCorner
; }
54 screen_corner
NeverBlankCorner() const { return fNeverBlankCorner
; }
55 bool LockEnable() const { return fLockEnabled
; }
56 bigtime_t
PasswordTime() const { return fPasswordTime
; }
57 const char* Password() { return fPassword
.String(); }
58 const char* LockMethod() { return fLockMethod
.String(); }
59 bool IsNetworkPassword()
60 { return strcmp(fLockMethod
.String(), "custom")
63 const char* ModuleName() { return fModuleName
.String(); }
64 status_t
GetModuleState(const char* name
,
65 BMessage
* stateMessage
);
67 void SetTimeFlags(uint32 flags
)
68 { fTimeFlags
= flags
; }
69 void SetBlankTime(bigtime_t time
)
70 { fBlankTime
= time
; }
71 void SetStandByTime(bigtime_t time
)
72 { fStandByTime
= time
; }
73 void SetSuspendTime(bigtime_t time
)
74 { fSuspendTime
= time
; }
75 void SetOffTime(bigtime_t intime
)
76 { fOffTime
= intime
; }
77 void SetBlankCorner(screen_corner in
)
78 { fBlankCorner
= in
; }
79 void SetNeverBlankCorner(screen_corner in
)
80 { fNeverBlankCorner
= in
; }
81 void SetLockEnable(bool enable
)
82 { fLockEnabled
= enable
; }
83 void SetPasswordTime(bigtime_t time
)
84 { fPasswordTime
= time
; }
85 void SetPassword(const char* password
)
86 { fPassword
= password
; }
87 // Cannot set network password from here.
88 void SetLockMethod(const char* method
)
89 { fLockMethod
= method
; }
90 void SetModuleName(const char* name
)
91 { fModuleName
= name
; }
92 void SetModuleState(const char* name
,
93 BMessage
* stateMessage
);
95 // ScreenSaver preferences settings
96 BRect
WindowFrame() const { return fWindowFrame
; }
97 int32
WindowTab() const { return fWindowTab
; }
99 void SetWindowFrame(const BRect
& frame
)
100 { fWindowFrame
= frame
; }
101 void SetWindowTab(int32 tab
)
102 { fWindowTab
= tab
; }
108 bigtime_t fBlankTime
;
109 bigtime_t fStandByTime
;
110 bigtime_t fSuspendTime
;
112 screen_corner fBlankCorner
;
113 screen_corner fNeverBlankCorner
;
115 bigtime_t fPasswordTime
;
127 #endif // SCREEN_SAVER_SETTINGS_H