00001
00032 #ifndef LL_LLPANELLOGIN_H
00033 #define LL_LLPANELLOGIN_H
00034
00035 #include "llpanel.h"
00036
00037 #include "lldbstrings.h"
00038 #include "llmemory.h"
00039 #include "llviewerimage.h"
00040 #include "llstring.h"
00041 #include "llmd5.h"
00042
00043 class LLTextBox;
00044 class LLLineEditor;
00045 class LLCheckBoxCtrl;
00046 class LLButton;
00047 class LLComboBox;
00048
00049 class LLPanelLogin
00050 : public LLPanel
00051 {
00052 public:
00053 LLPanelLogin(const LLRect &rect, BOOL show_server,
00054 void (*callback)(S32 option, void* user_data),
00055 void *callback_data);
00056 ~LLPanelLogin();
00057
00058 virtual BOOL handleKeyHere(KEY key, MASK mask, BOOL called_from_parent);
00059 virtual void draw();
00060 virtual void setFocus( BOOL b );
00061
00062 static void show(const LLRect &rect, BOOL show_server,
00063 void (*callback)(S32 option, void* user_data),
00064 void* callback_data);
00065
00066 static void setFields(const std::string& firstname, const std::string& lastname,
00067 const std::string& password, BOOL remember);
00068
00069 static void addServer(const char *server, S32 domain_name);
00070 static void refreshLocation( bool force_visible );
00071
00072 static void getFields(LLString &firstname, LLString &lastname,
00073 LLString &password, BOOL &remember);
00074
00075 static BOOL getServer(LLString &server, S32& domain_name);
00076 static void getLocation(LLString &location);
00077
00078 static void close();
00079
00080 void setSiteIsAlive( bool alive );
00081
00082 static void giveFocus();
00083 static void mungePassword(LLUICtrl* caller, void* user_data);
00084
00085 private:
00086 static void onClickConnect(void*);
00087 static void onClickNewAccount(void*);
00088 static void newAccountAlertCallback(S32 option, void*);
00089 static void onClickQuit(void*);
00090 static void onClickVersion(void*);
00091 static void onPassKey(LLLineEditor* caller, void* user_data);
00092
00093 private:
00094 LLPointer<LLViewerImage> mLogoImage;
00095
00096 void (*mCallback)(S32 option, void *userdata);
00097 void* mCallbackData;
00098
00099 std::string mIncomingPassword;
00100 std::string mMungedPassword;
00101
00102 static LLPanelLogin* sInstance;
00103 static BOOL sCapslockDidNotification;
00104 BOOL mHtmlAvailable;
00105 };
00106
00107 #endif