PageRenderTime 263ms CodeModel.GetById 141ms app.highlight 8ms RepoModel.GetById 112ms app.codeStats 0ms

/indra/newview/llpanellogin.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 115 lines | 67 code | 20 blank | 28 comment | 0 complexity | 271fb41bc341f70d65ce57ca842d2365 MD5 | raw file
  1/** 
  2 * @file llpanellogin.h
  3 * @brief Login username entry fields.
  4 *
  5 * $LicenseInfo:firstyear=2002&license=viewerlgpl$
  6 * Second Life Viewer Source Code
  7 * Copyright (C) 2010, Linden Research, Inc.
  8 * 
  9 * This library is free software; you can redistribute it and/or
 10 * modify it under the terms of the GNU Lesser General Public
 11 * License as published by the Free Software Foundation;
 12 * version 2.1 of the License only.
 13 * 
 14 * This library is distributed in the hope that it will be useful,
 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 17 * Lesser General Public License for more details.
 18 * 
 19 * You should have received a copy of the GNU Lesser General Public
 20 * License along with this library; if not, write to the Free Software
 21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 22 * 
 23 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
 24 * $/LicenseInfo$
 25 */
 26
 27#ifndef LL_LLPANELLOGIN_H
 28#define LL_LLPANELLOGIN_H
 29
 30#include "llpanel.h"
 31#include "llpointer.h"			// LLPointer<>
 32#include "llmediactrl.h"	// LLMediaCtrlObserver
 33#include <boost/scoped_ptr.hpp>
 34
 35class LLLineEditor;
 36class LLUIImage;
 37class LLPanelLoginListener;
 38class LLSLURL;
 39class LLCredential;
 40
 41class LLPanelLogin:	
 42	public LLPanel,
 43	public LLViewerMediaObserver
 44{
 45	LOG_CLASS(LLPanelLogin);
 46public:
 47	LLPanelLogin(const LLRect &rect, BOOL show_server, 
 48				void (*callback)(S32 option, void* user_data),
 49				void *callback_data);
 50	~LLPanelLogin();
 51
 52	virtual BOOL handleKeyHere(KEY key, MASK mask);
 53	virtual void draw();
 54	virtual void setFocus( BOOL b );
 55
 56	// Show the XUI first name, last name, and password widgets.  They are
 57	// hidden on startup for reg-in-client
 58	static void showLoginWidgets();
 59
 60	static void show(const LLRect &rect, BOOL show_server, 
 61		void (*callback)(S32 option, void* user_data), 
 62		void* callback_data);
 63
 64	static void setFields(LLPointer<LLCredential> credential, BOOL remember);
 65
 66	static void getFields(LLPointer<LLCredential>& credential, BOOL& remember);
 67
 68	static BOOL isGridComboDirty();
 69	static BOOL areCredentialFieldsDirty();
 70	static void setLocation(const LLSLURL& slurl);
 71	
 72	static void updateLocationCombo(bool force_visible);  // simply update the combo box
 73	static void closePanel();
 74
 75	void setSiteIsAlive( bool alive );
 76
 77	static void loadLoginPage();	
 78	static void giveFocus();
 79	static void setAlwaysRefresh(bool refresh); 
 80	
 81	// inherited from LLViewerMediaObserver
 82	/*virtual*/ void handleMediaEvent(LLPluginClassMedia* self, EMediaEvent event);
 83	static void updateServer();  // update the combo box, change the login page to the new server, clear the combo
 84
 85private:
 86	friend class LLPanelLoginListener;
 87	void reshapeBrowser();
 88	void addFavoritesToStartLocation();
 89	void addUsersWithFavoritesToUsername();
 90	static void onClickConnect(void*);
 91	static void onClickNewAccount(void*);
 92	static void onClickVersion(void*);
 93	static void onClickForgotPassword(void*);
 94	static void onClickHelp(void*);
 95	static void onPassKey(LLLineEditor* caller, void* user_data);
 96	static void onSelectServer(LLUICtrl*, void*);
 97	static void onServerComboLostFocus(LLFocusableElement*);
 98	static void updateServerCombo();
 99	static void updateStartSLURL();
100	static void updateLoginPanelLinks();
101
102private:
103	LLPointer<LLUIImage> mLogoImage;
104	boost::scoped_ptr<LLPanelLoginListener> mListener;
105
106	void			(*mCallback)(S32 option, void *userdata);
107	void*			mCallbackData;
108
109	BOOL            mPasswordModified;
110
111	static LLPanelLogin* sInstance;
112	static BOOL		sCapslockDidNotification;
113};
114
115#endif