1 /* 2 * Copyright (C) 2010 Stephan Aßmus <superstippi@gmx.de> 3 * 4 * All rights reserved. Distributed under the terms of the MIT License. 5 */ 6 #ifndef AuthenticationPanel_h 7 #define AuthenticationPanel_h 8 9 #include <String.h> 10 #include <Window.h> 11 12 class BCheckBox; 13 class BTextControl; 14 15 class AuthenticationPanel : public BWindow { 16 public: 17 AuthenticationPanel(BRect parentFrame = BRect()); 18 virtual ~AuthenticationPanel(); 19 20 virtual bool QuitRequested(); 21 22 virtual void MessageReceived(BMessage *message); 23 24 bool getAuthentication(const BString& text, const BString& previousUser, 25 const BString& previousPass, bool previousRememberCredentials, 26 bool badPassword, BString& user, BString& pass, 27 bool* rememberCredentials); 28 29 private: 30 BRect m_parentWindowFrame; 31 BTextControl* m_usernameTextControl; 32 BTextControl* m_passwordTextControl; 33 BCheckBox* m_hidePasswordCheckBox; 34 BCheckBox* m_rememberCredentialsCheckBox; 35 BButton* m_okButton; 36 BButton* m_cancelButton; 37 38 bool m_cancelled; 39 40 sem_id m_exitSemaphore; 41 }; 42 43 #endif // AuthenticationPanel_h 44