chatstate.h
/*
Copyright (c) 2007-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 CHATSTATE_H__
#define CHATSTATE_H__
#include "gloox.h"
#include "stanzaextension.h"
#include <string>
namespace gloox
{
class Tag;
class GLOOX_API ChatState : public StanzaExtension
{
public:
ChatState( const Tag* tag );
ChatState( ChatStateType state )
: StanzaExtension( ExtChatState ), m_state( state )
{}
virtual ~ChatState() {}
ChatStateType state() const { return m_state; }
// reimplemented from StanzaExtension
virtual const std::string& filterString() const;
// reimplemented from StanzaExtension
virtual StanzaExtension* newInstance( const Tag* tag ) const
{
return new ChatState( tag );
}
// reimplemented from StanzaExtension
Tag* tag() const;
// reimplemented from StanzaExtension
virtual StanzaExtension* clone() const
{
return new ChatState( *this );
}
private:
ChatStateType m_state;
};
}
#endif // CHATSTATE_H__
gloox::ChatState::ChatState
ChatState(ChatStateType state)
Definition chatstate.h:47
gloox::ChatState::clone
virtual StanzaExtension * clone() const
Definition chatstate.h:75
gloox::ChatState::ChatState
ChatState(const Tag *tag)
Definition chatstate.cpp:34
gloox::ChatState::newInstance
virtual StanzaExtension * newInstance(const Tag *tag) const
Definition chatstate.h:66
gloox::ChatState::state
ChatStateType state() const
Definition chatstate.h:60
gloox::ChatState::~ChatState
virtual ~ChatState()
Definition chatstate.h:54
gloox::ChatState::tag
Tag * tag() const
Definition chatstate.cpp:53
gloox::StanzaExtension::StanzaExtension
StanzaExtension(int type)
Definition stanzaextension.h:211
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
gloox::ChatStateType
ChatStateType
Definition gloox.h:1105
gloox::ExtChatState
@ ExtChatState
Definition stanzaextension.h:50