1#include "Window.h"
2#include "View.h"
3#include "TextControl.h"
4#include "Button.h"
5#include "Bitmap.h"
6
7#include "betalk.h"
8
9const uint32 MSG_LOGIN_OK = 'LgOK';
10const uint32 MSG_LOGIN_CANCEL = 'LgCn';
11
12#define LOGIN_PANEL_WIDTH		300
13#define LOGIN_PANEL_HEIGHT		158
14
15
16// ----- LoginView -----------------------------------------------------
17
18class LoginView : public BView
19{
20	public:
21		LoginView(BRect rect, char *server, char *share);
22		~LoginView();
23
24		void Draw(BRect rect);
25
26		const char *GetUser()		{ return user->Text(); }
27		const char *GetPassword()	{ return password->Text(); }
28
29	private:
30		BBitmap *icon;
31		BTextControl *user;
32		BTextControl *password;
33		char resource[256];
34};
35
36
37// ----- LoginPanel ----------------------------------------------------------------------
38
39class LoginPanel : public BWindow
40{
41	public:
42		LoginPanel(BRect frame, char *server, char *share, bool show);
43		~LoginPanel();
44
45		void Center();
46		void MessageReceived(BMessage *msg);
47		bool IsCancelled()		{ return cancelled; }
48
49		char user[MAX_NAME_LENGTH];
50		char password[MAX_NAME_LENGTH];
51		char md5passwd[MAX_NAME_LENGTH];
52
53		sem_id loginSem;
54
55	private:
56		LoginView *loginView;
57		bool cancelled;
58};
59
60
61// ----- Utilities ----------------------------------------------------------------------
62
63void safeStringCopy(char *dest, const char *source, int destSize);
64