haiku/headers/private/screen_saver/ScreenSaverPrefs.h
beveloper bce41d865a Moved here from current/headers/os/add-ons/screen_saver
Original checkin by michaelphipps

Old commit messages:

Revision 1.3
Re-styled and (hopefully) finalized.

Revision 1.2
Minor changes to support code sharing.

Revision 1.1
Promoted to libscreensaver from (what will be) screen_blanker.


git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7940 a95241bf-73f2-0310-859d-f6bbb57e9c96
2004-06-12 22:46:11 +00:00

69 lines
2.3 KiB
C++

#ifndef SCREEN_SAVER_PREFS_H
#define SCREEN_SAVER_PREFS_H
#include "Message.h"
#include <string.h>
enum arrowDirection {NONE=-1,UPLEFT,UPRIGHT,DOWNRIGHT,DOWNLEFT};
class ScreenSaverPrefs
{
public:
ScreenSaverPrefs(void);
bool LoadSettings(void);
BRect WindowFrame(void) {return windowFrame;}
int WindowTab(void) {return windowTab;}
int TimeFlags(void) {return timeFlags;}
int BlankTime(void) {return blankTime;}
int StandbyTime(void) {return standbyTime;}
int SuspendTime(void) {return suspendTime;}
int OffTime(void) {return offTime;}
arrowDirection GetBlankCorner(void) {return blank;}
arrowDirection GetNeverBlankCorner(void) {return neverBlank;}
bool LockEnable(void) {return lockenable;}
int PasswordTime(void) {return passwordTime;}
char *Password(void) {return password;}
bool IsNetworkPassword(void) {return isNetworkPWD;}
char *ModuleName(void) {return moduleName;}
BMessage *GetState(void) {return &stateMsg;}
void SetWindowFrame(const BRect &fr) {windowFrame=fr;}
void SetWindowTab(int tab) {windowTab=tab;}
void SetTimeFlags(int tf) {timeFlags=tf;}
void SetBlankTime(int bt) {blankTime=bt;}
void SetStandbyTime(int time) {standbyTime=time;}
void SetSuspendTime(int time) {suspendTime=time;}
void SetOffTime(int intime) {offTime=intime;}
void SetBlankCorner(arrowDirection in) {blank=in;}
void SetNeverBlankCorner(arrowDirection in){neverBlank=in;}
void SetLockEnable(bool en) {lockenable=en;}
void SetPasswordTime(int pt) {passwordTime=pt;}
void SetPassword(char *pw){strncpy(password,pw,B_PATH_NAME_LENGTH-1);}
void SetNetworkPassword(bool np) {isNetworkPWD=np;}
void SetModuleName(const char *mn) {strncpy(moduleName,mn,B_PATH_NAME_LENGTH-1);}
void SetState(BMessage *in) {stateMsg=*in;}
BMessage *GetSettings(void);
void SaveSettings (void);
private:
bool parseSettings(BMessage *newSSMessage);
BRect windowFrame;
int windowTab;
int timeFlags;
int blankTime; // AKA timefade
int standbyTime; // AKA timestandby
int suspendTime; // AKA timesuspend
int offTime; // AKA timeoff
arrowDirection blank; // AKA cornernow
arrowDirection neverBlank; // AKA cornernever
bool lockenable;
int passwordTime; // AKA lockdelay
char password[B_PATH_NAME_LENGTH]; // aka lockpassword
bool isNetworkPWD;
char moduleName[B_PATH_NAME_LENGTH];
BMessage stateMsg, msg;
};
#endif //SCREEN_SAVER_PREFS_H