PageRenderTime 37ms CodeModel.GetById 27ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 0ms

/indra/viewer_components/login/lllogin.h

https://bitbucket.org/lindenlab/viewer-beta/
C++ Header | 127 lines | 18 code | 10 blank | 99 comment | 0 complexity | 58d2b86a79d55794c06de2a642f31701 MD5 | raw file
  1/** 
  2 * @file lllogin.h
  3 *
  4 * $LicenseInfo:firstyear=2009&license=viewerlgpl$
  5 * Second Life Viewer Source Code
  6 * Copyright (C) 2010, Linden Research, Inc.
  7 * 
  8 * This library is free software; you can redistribute it and/or
  9 * modify it under the terms of the GNU Lesser General Public
 10 * License as published by the Free Software Foundation;
 11 * version 2.1 of the License only.
 12 * 
 13 * This library is distributed in the hope that it will be useful,
 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 16 * Lesser General Public License for more details.
 17 * 
 18 * You should have received a copy of the GNU Lesser General Public
 19 * License along with this library; if not, write to the Free Software
 20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 21 * 
 22 * Linden Research, Inc., 945 Battery Street, San Francisco, CA  94111  USA
 23 * $/LicenseInfo$
 24 */
 25
 26#ifndef LL_LLLOGIN_H
 27#define LL_LLLOGIN_H
 28
 29#include <boost/scoped_ptr.hpp>
 30
 31class LLSD;
 32class LLEventPump;
 33
 34/**
 35 * @class LLLogin
 36 * @brief Class to encapsulate the action and state of grid login.
 37 */
 38class LLLogin
 39{
 40public:
 41	LLLogin();
 42	~LLLogin();
 43
 44	/** 
 45	 * Make a connection to a grid.
 46	 * @param uri The 'well known and published' authentication URL.
 47	 * @param credentials LLSD data that contians the credentials.
 48	 * *NOTE:Mani The credential data can vary depending upon the authentication
 49	 * method used. The current interface matches the values passed to
 50	 * the XMLRPC login request.
 51	 {
 52		method			:	string, 
 53		first			:	string,
 54		last			:	string,
 55		passwd			:	string,
 56		start			:	string,
 57		skipoptional	:	bool,
 58		agree_to_tos	:	bool,
 59		read_critical	:	bool,
 60		last_exec_event	:	int,
 61		version			:	string,
 62		channel			:	string,
 63		mac				:	string,
 64		id0				:	string,
 65		options			:   [ strings ]
 66	 }
 67	 
 68	 */
 69	void connect(const std::string& uri, const LLSD& credentials);
 70	
 71    /** 
 72	 * Disconnect from a the current connection.
 73	 */
 74	void disconnect();
 75
 76    /** 
 77	 * Retrieve the event pump from this login class.
 78	 */
 79	LLEventPump& getEventPump();
 80
 81	/*
 82	Event API
 83
 84	LLLogin will issue multiple events to it pump to indicate the 
 85	progression of states through login. The most important 
 86	states are "offline" and "online" which indicate auth failure 
 87	and auth success respectively.
 88
 89	pump: login (tweaked)
 90	These are the events posted to the 'login' 
 91	event pump from the login module.
 92	{
 93		state		:	string, // See below for the list of states.
 94		progress	:   real // for progress bar.
 95		data		:   LLSD // Dependent upon state.
 96	}
 97	
 98	States for method 'login_to_simulator'
 99	offline - set initially state and upon failure. data is the server response.
100	srvrequest - upon uri rewrite request. no data.
101	authenticating - upon auth request. data, 'attempt' number and 'request' llsd.
102	downloading - upon ack from auth server, before completion. no data
103	online - upon auth success. data is server response.
104
105
106	Dependencies:
107	pump: LLAres 
108	LLLogin makes a request for a SRV record from the uri provided by the connect method.
109	The following event pump should exist to service that request.
110	pump name: LLAres
111	request = {
112		op : "rewriteURI"
113		uri : string
114		reply : string
115
116	pump: LLXMLRPCListener
117	The request merely passes the credentials LLSD along, with one additional 
118	member, 'reply', which is the string name of the event pump to reply on. 
119	
120	*/
121
122private:
123	class Impl;
124	boost::scoped_ptr<Impl> mImpl;
125};
126
127#endif // LL_LLLOGIN_H