jinglecontent.h
/*
Copyright (c) 2008-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 JINGLECONTENT_H__
#define JINGLECONTENT_H__
#include "jingleplugin.h"
#include "tag.h"
#include <string>
namespace gloox
{
namespace Jingle
{
class PluginFactory;
class GLOOX_API Content : public Plugin
{
public:
enum Creator
{
CInitiator,
CResponder,
InvalidCreator
};
enum Senders
{
SInitiator,
SResponder,
SBoth,
SNone,
InvalidSender
};
Content( const std::string& name, const PluginList& plugins, Creator creator = CInitiator,
Senders senders = SBoth, const std::string& disposition = "session" );
Content( const Tag* tag = 0, PluginFactory* factory = 0 );
Creator creator() const { return m_creator; }
Senders senders() const { return m_senders; }
const std::string& disposition() const { return m_disposition; }
const std::string& name() const { return m_name; }
virtual ~Content();
// reimplemented from Plugin
virtual const std::string& filterString() const;
// reimplemented from Plugin
virtual Tag* tag() const;
// reimplemented from Plugin
virtual Plugin* newInstance( const Tag* tag ) const { return new Content( tag, m_factory ); }
// reimplemented from Plugin
virtual Plugin* clone() const;
private:
Creator m_creator;
std::string m_disposition;
std::string m_name;
Senders m_senders;
};
}
}
#endif // JINGLECONTENT_H__
gloox::Jingle::Content
An abstraction of a Jingle Content Type. This is part of Jingle (XEP-0166).
Definition jinglecontent.h:42
gloox::Jingle::Content::Creator
Creator
Definition jinglecontent.h:48
gloox::Jingle::Content::CResponder
@ CResponder
Definition jinglecontent.h:50
gloox::Jingle::Content::InvalidCreator
@ InvalidCreator
Definition jinglecontent.h:51
gloox::Jingle::Content::CInitiator
@ CInitiator
Definition jinglecontent.h:49
gloox::Jingle::Content::name
const std::string & name() const
Definition jinglecontent.h:107
gloox::Jingle::Content::creator
Creator creator() const
Definition jinglecontent.h:89
gloox::Jingle::Content::newInstance
virtual Plugin * newInstance(const Tag *tag) const
Definition jinglecontent.h:121
gloox::Jingle::Content::Content
Content(const std::string &name, const PluginList &plugins, Creator creator=CInitiator, Senders senders=SBoth, const std::string &disposition="session")
Definition jinglecontent.cpp:46
gloox::Jingle::Content::senders
Senders senders() const
Definition jinglecontent.h:95
gloox::Jingle::Content::disposition
const std::string & disposition() const
Definition jinglecontent.h:101
gloox::Jingle::Content::Senders
Senders
Definition jinglecontent.h:58
gloox::Jingle::Content::InvalidSender
@ InvalidSender
Definition jinglecontent.h:63
gloox::Jingle::Content::SBoth
@ SBoth
Definition jinglecontent.h:61
gloox::Jingle::Content::SResponder
@ SResponder
Definition jinglecontent.h:60
gloox::Jingle::Content::SInitiator
@ SInitiator
Definition jinglecontent.h:59
gloox::Jingle::Content::SNone
@ SNone
Definition jinglecontent.h:62
gloox::Jingle::Content::tag
virtual Tag * tag() const
Definition jinglecontent.cpp:79
gloox::Jingle::PluginFactory
A factory for which creates Plugin instances based on Tags. This is part of Jingle (XEP-0166).
Definition jinglepluginfactory.h:37
gloox::Jingle::Plugin
An abstraction of a Jingle plugin. This is part of Jingle (XEP-0166 et al.).
Definition jingleplugin.h:68
gloox::Jingle::Plugin::Plugin
Plugin(JinglePluginType type)
Definition jingleplugin.h:76
gloox::Tag
This is an abstraction of an XML element.
Definition tag.h:47
gloox::Jingle
The namespace containing Jingle-related (XEP-0166 et. al.) classes.
Definition jinglecontent.cpp:22
gloox::Jingle::PluginList
std::list< const Plugin * > PluginList
Definition jingleplugin.h:52
gloox
The namespace for the gloox library.
Definition adhoc.cpp:28