RegistrationHandler Class Reference

A virtual interface that receives events from an Registration object. More...

#include <registrationhandler.h>

List of all members.

Public Types

enum  resultEnum {
  REGISTRATION_SUCCESS = 0, REGISTRATION_NOT_ACCEPTABLE, REGISTRATION_CONFLICT, REGISTRATION_NOT_AUTHORIZED,
  REGISTRATION_BAD_REQUEST, REGISTRATION_FORBIDDEN, REGISTRATION_REGISTRATION_REQUIRED, REGISTRATION_UNEXPECTED_REQUEST,
  REGISTRATION_NOT_ALLOWED, UNKNOWN_ERROR
}

Public Member Functions

virtual ~RegistrationHandler ()
virtual void handleRegistrationFields (const JID &from, int fields, std::string instructions)=0
virtual void handleAlreadyRegistered (const JID &from)=0
virtual void handleRegistrationResult (const JID &from, resultEnum result)=0
virtual void handleDataForm (const JID &from, const DataForm &form)=0
virtual void handleOOB (const JID &from, const std::string &url, const std::string &desc)=0


Detailed Description

A virtual interface that receives events from an Registration object.

Derived classes can be registered as RegistrationHandlers with an Registration object. Incoming results for operations initiated through the Registration object are forwarded to this handler.

Author:
Jakob Schroeter <js@camaya.net>
Since:
0.2

Definition at line 35 of file registrationhandler.h.


Member Enumeration Documentation

enum resultEnum

Possible results of a JEP-0077 operation.

Enumerator:
REGISTRATION_SUCCESS  The last operation (account registration, account deletion or password change) was successful.
REGISTRATION_NOT_ACCEPTABLE  406: Not all necessary information provided
REGISTRATION_CONFLICT  409: Username already exists.
REGISTRATION_NOT_AUTHORIZED  Account removal: Unregistered entity waits too long before authentication or performs tasks other than authentication after registration.
Password change: The server or service does not consider the channel safe enough to enable a password change.
REGISTRATION_BAD_REQUEST  Account removal: The <remove/> element was not the only child element of the <query/> element. Should not happen when only gloox functions are being used.
Password change: The password change request does not contain complete information (both <username/> and <password/> are required).
REGISTRATION_FORBIDDEN  Account removal: The sender does not have sufficient permissions to cancel the registration.
REGISTRATION_REGISTRATION_REQUIRED  Account removal: The entity sending the remove request was not previously registered.
REGISTRATION_UNEXPECTED_REQUEST  Account removal: The host is an instant messaging server and the IQ get does not contain a 'from' address because the entity is not registered with the server.
Password change: The host is an instant messaging server and the IQ set does not contain a 'from' address because the entity is not registered with the server.
REGISTRATION_NOT_ALLOWED  Password change: The server or service does not allow password changes.
UNKNOWN_ERROR  An unknown error condition occured.

Definition at line 41 of file registrationhandler.h.


Constructor & Destructor Documentation

virtual ~RegistrationHandler (  )  [inline, virtual]

Virtual Destructor.

Definition at line 79 of file registrationhandler.h.


Member Function Documentation

virtual void handleRegistrationFields ( const JID from,
int  fields,
std::string  instructions 
) [pure virtual]

Reimplement this function to receive results of the Registration::fetchRegistrationFields() function.

Parameters:
from The server or service the registration fields came from.
fields The OR'ed fields the server requires. From Registration::fieldEnum.
instructions Any additional information the server sends along.

Referenced by Registration::handleIqID().

virtual void handleAlreadyRegistered ( const JID from  )  [pure virtual]

This function is called if Registration::createAccount() was called on an authenticated stream and the server lets us know about this.

Referenced by Registration::handleIqID().

virtual void handleRegistrationResult ( const JID from,
resultEnum  result 
) [pure virtual]

This funtion is called to notify about the result of an operation.

Parameters:
from The server or service the result came from.
result The result of the last operation.

Referenced by Registration::handleIq(), and Registration::handleIqID().

virtual void handleDataForm ( const JID from,
const DataForm form 
) [pure virtual]

This function is called additionally to handleRegistrationFields() if the server supplied a data form together with legacy registration fields.

Parameters:
from The server or service the data form came from.
form The DataForm conataining registration information.

Referenced by Registration::handleIqID().

virtual void handleOOB ( const JID from,
const std::string &  url,
const std::string &  desc 
) [pure virtual]

This function is called if the server does not offer in-band registration but wants to refer the user to an external URL.

Parameters:
from The server or service the referal came from.
url The external URL where registration is possible (or where more information can be found).
desc Some descriptive text.

Referenced by Registration::handleIqID().


The documentation for this class was generated from the following file:
Generated on Tue May 1 14:20:26 2007 for gloox by  doxygen 1.5.1