1 /* 2 * Copyright 2008, François Revol, <revol@free.fr>. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 */ 5 #ifndef _LOGINAPP_H_ 6 #define _LOGINAPP_H_ 7 8 #include <Application.h> 9 10 /* try loging in a user */ 11 const uint32 kAttemptLogin = 'logi'; 12 const uint32 kHaltAction = 'halt'; 13 const uint32 kRebootAction = 'rebo'; 14 const uint32 kSuspendAction = 'susp'; 15 const uint32 kLoginBad = 'lgba'; 16 const uint32 kLoginOk = 'lgok'; 17 18 class LoginWindow; 19 class DesktopWindow; 20 21 class LoginApp : public BApplication { 22 public: 23 LoginApp(); 24 virtual ~LoginApp(); 25 void ReadyToRun(); 26 void MessageReceived(BMessage *message); 27 void ArgvReceived(int32 argc, char **argv); 28 29 private: 30 void TryLogin(BMessage *message); 31 status_t ValidateLogin(const char *login, const char *password); 32 int getpty(char *pty, char *tty); 33 34 DesktopWindow* fDesktopWindow; 35 LoginWindow* fLoginWindow; 36 bool fEditShelfMode; 37 bool fModalMode; 38 }; 39 40 #endif // _LOGINAPP_H_ 41