messageevent.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 MESSAGEEVENT_H__
#define MESSAGEEVENT_H__
#include "gloox.h"
#include "stanzaextension.h"
#include <string>
namespace gloox
{
class Tag;
class GLOOX_API MessageEvent : public StanzaExtension
{
public:
MessageEvent( const Tag* tag );
MessageEvent( int type, const std::string& id = EmptyString )
: StanzaExtension( ExtMessageEvent ), m_id( id ), m_event( type )
{}
virtual ~MessageEvent() {}
int event() const { return m_event; }
std::string id() const { return m_id; }
// reimplemented from StanzaExtension
virtual const std::string& filterString() const;
// reimplemented from StanzaExtension
virtual StanzaExtension* newInstance( const Tag* tag ) const
{
return new MessageEvent( tag );
}
// reimplemented from StanzaExtension
Tag* tag() const;
// reimplemented from StanzaExtension
virtual StanzaExtension* clone() const
{
return new MessageEvent( *this );
}
private:
std::string m_id;
int m_event;
};
}
#endif // MESSAGEEVENT_H__
gloox::MessageEvent::MessageEvent
MessageEvent(int type, const std::string &id=EmptyString)
Definition messageevent.h:47
gloox::MessageEvent::clone
virtual StanzaExtension * clone() const
Definition messageevent.h:81
gloox::MessageEvent::MessageEvent
MessageEvent(const Tag *tag)
Definition messageevent.cpp:28
gloox::MessageEvent::id
std::string id() const
Definition messageevent.h:66
gloox::MessageEvent::newInstance
virtual StanzaExtension * newInstance(const Tag *tag) const
Definition messageevent.h:72
gloox::MessageEvent::~MessageEvent
virtual ~MessageEvent()
Definition messageevent.h:54
gloox::MessageEvent::event
int event() const
Definition messageevent.h:60
gloox::MessageEvent::tag
Tag * tag() const
Definition messageevent.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::EmptyString
const std::string EmptyString
Definition gloox.cpp:124
gloox::ExtMessageEvent
@ ExtMessageEvent
Definition stanzaextension.h:51