Files
haiku-beta6/headers/private/screen_saver/ScreenSaverPrefs.h
T

87 lines
2.7 KiB
C++
Raw Normal View History

2005-07-29 07:41:58 +00:00
/*
* Copyright 2003, Michael Phipps. All rights reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef SCREEN_SAVER_PREFS_H
#define SCREEN_SAVER_PREFS_H
2005-07-29 07:41:58 +00:00
#include <Message.h>
#include <Path.h>
#include <String.h>
2005-07-29 07:41:58 +00:00
enum arrowDirection {
NONE = -1,
UPLEFT,
UPRIGHT,
DOWNRIGHT,
DOWNLEFT,
CENTER
};
2005-08-18 15:31:06 +00:00
#define SCREEN_BLANKER_SIG "application/x-vnd.Haiku.screenblanker"
2005-08-01 12:53:23 +00:00
class ScreenSaverPrefs
{
public:
2005-07-29 07:41:58 +00:00
ScreenSaverPrefs();
bool LoadSettings();
void Defaults();
2005-08-01 12:53:23 +00:00
BPath & GetPath() { return fSSPath;}
2005-07-29 07:41:58 +00:00
BRect WindowFrame() {return fWindowFrame;}
int32 WindowTab() {return fWindowTab;}
int32 TimeFlags() {return fTimeFlags;}
bigtime_t BlankTime() {return fBlankTime;}
bigtime_t StandbyTime() {return fStandByTime;}
bigtime_t SuspendTime() {return fSuspendTime;}
bigtime_t OffTime() {return fOffTime;}
arrowDirection GetBlankCorner() {return fBlankCorner;}
arrowDirection GetNeverBlankCorner() {return fNeverBlankCorner;}
bool LockEnable() {return fLockEnabled;}
bigtime_t PasswordTime() {return fPasswordTime;}
const char *Password() { return fPassword.String(); }
const char *LockMethod() { return fLockMethod.String(); }
2005-09-01 15:04:18 +00:00
bool IsNetworkPassword() {return (strcmp(fLockMethod.String(), "custom") != 0);}
2005-07-29 07:41:58 +00:00
const char *ModuleName() {return fModuleName.String();}
2005-07-29 12:05:22 +00:00
status_t GetState(const char *name, BMessage *stateMsg);
2005-07-29 07:41:58 +00:00
void SetWindowFrame(const BRect &fr) { fWindowFrame = fr;}
void SetWindowTab(int32 tab) { fWindowTab = tab;}
void SetTimeFlags(int32 tf) {fTimeFlags = tf;}
void SetBlankTime(bigtime_t bt) {fBlankTime = bt;}
void SetStandbyTime(bigtime_t time) {fStandByTime = time;}
void SetSuspendTime(bigtime_t time) {fSuspendTime = time;}
void SetOffTime(bigtime_t intime) {fOffTime = intime;}
void SetBlankCorner(arrowDirection in) {fBlankCorner = in;}
void SetNeverBlankCorner(arrowDirection in) {fNeverBlankCorner = in;}
void SetLockEnable(bool en) {fLockEnabled = en;}
void SetPasswordTime(bigtime_t pt) {fPasswordTime = pt;}
void SetPassword(const char *pw) {fPassword = pw;} // Can not set network password from here.
void SetLockMethod(const char *method) {fLockMethod = method;}
2005-07-29 07:41:58 +00:00
void SetModuleName(const char *mn) {fModuleName = mn;}
2005-07-29 12:05:22 +00:00
void SetState(const char *name, BMessage *stateMsg);
2005-07-29 07:41:58 +00:00
void SaveSettings();
2005-07-29 12:05:22 +00:00
BMessage & GetSettings();
private:
2005-07-29 07:41:58 +00:00
BRect fWindowFrame;
int32 fWindowTab;
int32 fTimeFlags;
bigtime_t fBlankTime;
bigtime_t fStandByTime;
bigtime_t fSuspendTime;
bigtime_t fOffTime;
arrowDirection fBlankCorner;
arrowDirection fNeverBlankCorner;
bool fLockEnabled;
bigtime_t fPasswordTime;
BString fPassword;
BString fModuleName;
BString fLockMethod;
2004-10-09 23:17:47 +00:00
2005-07-29 12:05:22 +00:00
BMessage fSettings;
2005-08-01 12:53:23 +00:00
BPath fSSPath, fNetworkPath;
};
#endif //SCREEN_SAVER_PREFS_H