nonsaslauth.h
/*
Copyright (c) 2005-2023 by Jakob Schröter <js@camaya.net>
This file is part of the gloox library. http://camaya.net/gloox
This software is distributed under a license. The full license
agreement can be found in the file LICENSE in this distribution.
This software may not be copied, modified, sold or distributed
other than expressed in the named license agreement.
This software is distributed without any warranty.
*/
#ifndef NONSASLAUTH_H__
#define NONSASLAUTH_H__
#include "iqhandler.h"
#include <string>
namespace gloox
{
class Client;
class Stanza;
class Tag;
class GLOOX_API NonSaslAuth : public IqHandler
{
public:
NonSaslAuth( Client* parent );
virtual ~NonSaslAuth();
void doAuth( const std::string& sid );
// reimplemented from IqHandler
virtual bool handleIq( const IQ& iq ) { (void)iq; return false; }
// reimplemented from IqHandler
virtual void handleIqID( const IQ& iq, int context );
private:
#ifdef NONSASLAUTH_TEST
public:
#endif
class Query : public StanzaExtension
{
public:
Query( const std::string& user );
Query( const Tag* tag = 0 );
Query* newInstance( const std::string& user, const std::string& sid,
const std::string& pwd, const std::string& resource ) const;
virtual ~Query() {}
// reimplemented from StanzaExtension
virtual const std::string& filterString() const;
// reimplemented from StanzaExtension
virtual StanzaExtension* newInstance( const Tag* tag ) const
{
return new Query( tag );
}
// reimplemented from StanzaExtension
virtual Tag* tag() const;
// reimplemented from StanzaExtension
virtual StanzaExtension* clone() const
{
return new Query( *this );
}
private:
std::string m_user;
std::string m_pwd;
std::string m_resource;
bool m_digest;
};
enum NonSaslAuthTrack
{
TrackRequestAuthFields,
TrackSendAuth
};
Client* m_parent;
std::string m_sid;
};
}
#endif // NONSASLAUTH_H__
gloox::Client
This class implements a basic Jabber/XMPP Client.
Definition client.h:117
gloox::IQ
An abstraction of an IQ stanza.
Definition iq.h:34
gloox::IqHandler
A virtual interface which can be reimplemented to receive IQ stanzas.
Definition iqhandler.h:32
gloox::NonSaslAuth::doAuth
void doAuth(const std::string &sid)
Definition nonsaslauth.cpp:106
gloox::NonSaslAuth::handleIq
virtual bool handleIq(const IQ &iq)
Definition nonsaslauth.h:61
gloox::NonSaslAuth::NonSaslAuth
NonSaslAuth(Client *parent)
Definition nonsaslauth.cpp:86
gloox::StanzaExtension
This class abstracts a stanza extension, which is usually an XML child element in a specific namespac...
Definition stanzaextension.h:204
gloox::Stanza
This is the base class for XMPP stanza abstractions.
Definition stanza.h:34
gloox::Tag
This is an abstraction of an XML element.
Definition tag.h:47
gloox
The namespace for the gloox library.
Definition adhoc.cpp:28