2005-07-29 11:41:58 +04:00
|
|
|
/*
|
|
|
|
* Copyright 2003, Michael Phipps. All rights reserved.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
|
2004-06-13 02:46:11 +04:00
|
|
|
#ifndef SCREEN_SAVER_PREFS_H
|
|
|
|
#define SCREEN_SAVER_PREFS_H
|
2005-07-29 11:41:58 +04:00
|
|
|
#include <Message.h>
|
|
|
|
#include <Path.h>
|
|
|
|
#include <String.h>
|
2004-06-13 02:46:11 +04:00
|
|
|
|
2005-07-29 11:41:58 +04:00
|
|
|
enum arrowDirection {
|
|
|
|
NONE = -1,
|
|
|
|
UPLEFT,
|
|
|
|
UPRIGHT,
|
|
|
|
DOWNRIGHT,
|
|
|
|
DOWNLEFT,
|
|
|
|
CENTER
|
|
|
|
};
|
2004-06-13 02:46:11 +04:00
|
|
|
|
|
|
|
class ScreenSaverPrefs
|
|
|
|
{
|
|
|
|
public:
|
2005-07-29 11:41:58 +04:00
|
|
|
ScreenSaverPrefs();
|
|
|
|
bool LoadSettings();
|
|
|
|
void Defaults();
|
2004-06-13 02:46:11 +04:00
|
|
|
|
2005-07-29 11:41:58 +04: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(); }
|
|
|
|
bool IsNetworkPassword() {return fIsNetworkPassword;}
|
|
|
|
const char *ModuleName() {return fModuleName.String();}
|
2004-10-10 03:17:47 +04:00
|
|
|
BMessage *GetState(const char *name);
|
2004-06-13 02:46:11 +04:00
|
|
|
|
2005-07-29 11:41:58 +04: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(char *pw) {fPassword = pw;} // Can not set network password from here.
|
|
|
|
void SetModuleName(const char *mn) {fModuleName = mn;}
|
2004-10-10 03:17:47 +04:00
|
|
|
void SetState(const char *name,BMessage *in);
|
2005-07-29 11:41:58 +04:00
|
|
|
void SaveSettings();
|
|
|
|
BMessage * GetSettings();
|
2004-06-13 02:46:11 +04:00
|
|
|
private:
|
2005-07-29 11:41:58 +04: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-10 03:17:47 +04:00
|
|
|
|
2005-07-29 11:41:58 +04:00
|
|
|
bool fIsNetworkPassword;
|
2004-10-10 03:17:47 +04:00
|
|
|
|
2005-07-29 11:41:58 +04:00
|
|
|
BMessage stateMsg, currentMessage;
|
2004-10-10 03:17:47 +04:00
|
|
|
BPath ssPath,networkPath;
|
2004-06-13 02:46:11 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif //SCREEN_SAVER_PREFS_H
|