Changeset View
Changeset View
Standalone View
Standalone View
libraries/win32/gloox/include/gloox/registrationhandler.h
/* | /* | ||||
Copyright (c) 2005-2019 by Jakob Schröter <js@camaya.net> | Copyright (c) 2005-2019 by Jakob Schröter <js@camaya.net> | ||||
This file is part of the gloox library. http://camaya.net/gloox | This file is part of the gloox library. http://camaya.net/gloox | ||||
This software is distributed under a license. The full license | This software is distributed under a license. The full license | ||||
agreement can be found in the file LICENSE in this distribution. | agreement can be found in the file LICENSE in this distribution. | ||||
This software may not be copied, modified, sold or distributed | This software may not be copied, modified, sold or distributed | ||||
other than expressed in the named license agreement. | other than expressed in the named license agreement. | ||||
This software is distributed without any warranty. | This software is distributed without any warranty. | ||||
*/ | */ | ||||
#if !defined( GLOOX_MINIMAL ) || defined( WANT_REGISTRATION ) | |||||
#ifndef REGISTRATIONHANDLER_H__ | #ifndef REGISTRATIONHANDLER_H__ | ||||
#define REGISTRATIONHANDLER_H__ | #define REGISTRATIONHANDLER_H__ | ||||
#include "oob.h" | #include "oob.h" | ||||
#include <string> | #include <string> | ||||
namespace gloox | namespace gloox | ||||
{ | { | ||||
class OOB; | class OOB; | ||||
class JID; | class JID; | ||||
class DataForm; | class DataForm; | ||||
class Error; | |||||
/** | /** | ||||
* Possible results of a @xep{0077} operation. | * Possible results of a @xep{0077} operation. | ||||
*/ | */ | ||||
enum RegistrationResult | enum RegistrationResult | ||||
{ | { | ||||
RegistrationSuccess = 0, /**< The last operation (account registration, account | RegistrationSuccess = 0, /**< The last operation (account registration, account | ||||
* deletion or password change) was successful. */ | * deletion or password change) was successful. */ | ||||
▲ Show 20 Lines • Show All 64 Lines • ▼ Show 20 Lines | public: | ||||
* stream and the server lets us know about this. | * stream and the server lets us know about this. | ||||
*/ | */ | ||||
virtual void handleAlreadyRegistered( const JID& from ) = 0; | virtual void handleAlreadyRegistered( const JID& from ) = 0; | ||||
/** | /** | ||||
* This funtion is called to notify about the result of an operation. | * This funtion is called to notify about the result of an operation. | ||||
* @param from The server or service the result came from. | * @param from The server or service the result came from. | ||||
* @param regResult The result of the last operation. | * @param regResult The result of the last operation. | ||||
* @param error If registration failed, this is the Error object sent by the server (if any), 0 otherwise. @since 1.1 | |||||
*/ | */ | ||||
virtual void handleRegistrationResult( const JID& from, RegistrationResult regResult ) = 0; | virtual void handleRegistrationResult( const JID& from, RegistrationResult regResult, const Error* error ) = 0; | ||||
/** | /** | ||||
* This function is called additionally to @ref handleRegistrationFields() if the server | * This function is called additionally to @ref handleRegistrationFields() if the server | ||||
* supplied a data form together with legacy registration fields. | * supplied a data form together with legacy registration fields. | ||||
* @param from The server or service the data form came from. | * @param from The server or service the data form came from. | ||||
* @param form The DataForm containing registration information. | * @param form The DataForm containing registration information. | ||||
*/ | */ | ||||
virtual void handleDataForm( const JID& from, const DataForm& form ) = 0; | virtual void handleDataForm( const JID& from, const DataForm& form ) = 0; | ||||
/** | /** | ||||
* This function is called if the server does not offer in-band registration | * This function is called if the server does not offer in-band registration | ||||
* but wants to refer the user to an external URL. | * but wants to refer the user to an external URL. | ||||
* @param from The server or service the referal came from. | * @param from The server or service the referal came from. | ||||
* @param oob The OOB object describing the external URL. | * @param oob The OOB object describing the external URL. | ||||
*/ | */ | ||||
virtual void handleOOB( const JID& from, const OOB& oob ) = 0; | virtual void handleOOB( const JID& from, const OOB& oob ) = 0; | ||||
}; | }; | ||||
} | } | ||||
#endif // REGISTRATIONHANDLER_H__ | #endif // REGISTRATIONHANDLER_H__ | ||||
#endif // GLOOX_MINIMAL |
Wildfire Games · Phabricator