xref: /haiku/src/bin/screen_blanker/PasswordWindow.h (revision d3d8b26997fac34a84981e6d2b649521de2cc45a)
1 /*
2  * Copyright 2003-2005, Haiku.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Michael Phipps
7  *		Jérôme Duval, jerome.duval@free.fr
8  */
9 
10 #ifndef PASSWORDWINDOW_H
11 #define PASSWORDWINDOW_H
12 
13 #include <Window.h>
14 #include <Box.h>
15 #include <TextControl.h>
16 #include <Button.h>
17 
18 const static int32 UNLOCK_MESSAGE = 'ULMS';
19 
20 class PasswordWindow : public BWindow
21 {
22 	public:
23 		PasswordWindow() : BWindow(BRect(100,100,400,230),"pwView",B_NO_BORDER_WINDOW_LOOK, B_FLOATING_ALL_WINDOW_FEEL  ,
24 				B_NOT_MOVABLE | B_NOT_CLOSABLE |B_NOT_ZOOMABLE | B_NOT_MINIMIZABLE | B_NOT_RESIZABLE | B_ASYNCHRONOUS_CONTROLS ,
25 				B_ALL_WORKSPACES), fDie(false) { Setup(); }
26 
27 		void Setup(void);
28 		const char *GetPassword(void) {return fPassword->Text();}
29 		void SetPassword(const char* text) { if (Lock()) { fPassword->SetText(text); fPassword->MakeFocus(true); Unlock();} }
30 
31 		bool fDie;
32 	private:
33 		BView *fBgd;
34 		BBox *fCustomBox;
35 		BTextControl *fPassword;
36 		BButton *fUnlock;
37 };
38 
39 #endif // PASSWORDWINDOW_H
40