gloox  1.0.22
jinglecontent.h
1 /*
2  Copyright (c) 2008-2017 by Jakob Schröter <js@camaya.net>
3  This file is part of the gloox library. http://camaya.net/gloox
4 
5  This software is distributed under a license. The full license
6  agreement can be found in the file LICENSE in this distribution.
7  This software may not be copied, modified, sold or distributed
8  other than expressed in the named license agreement.
9 
10  This software is distributed without any warranty.
11 */
12 
13 
14 #ifndef JINGLECONTENT_H__
15 #define JINGLECONTENT_H__
16 
17 
18 #include "jingleplugin.h"
19 #include "tag.h"
20 
21 #include <string>
22 
23 namespace gloox
24 {
25 
26  namespace Jingle
27  {
28 
29  class PluginFactory;
30 
41  class GLOOX_API Content : public Plugin
42  {
43  public:
47  enum Creator
48  {
51  InvalidCreator
52  };
53 
57  enum Senders
58  {
63  InvalidSender
64  };
65 
75  Content( const std::string& name, const PluginList& plugins, Creator creator = CInitiator,
76  Senders senders = SBoth, const std::string& disposition = "session" );
77 
83  Content( const Tag* tag = 0, PluginFactory* factory = 0 );
84 
89  Creator creator() const { return m_creator; }
90 
95  Senders senders() const { return m_senders; }
96 
101  const std::string& disposition() const { return m_disposition; }
102 
107  const std::string& name() const { return m_name; }
108 
112  virtual ~Content();
113 
114  // reimplemented from Plugin
115  virtual const std::string& filterString() const;
116 
117  // reimplemented from Plugin
118  virtual Tag* tag() const;
119 
120  // reimplemented from Plugin
121  virtual Plugin* newInstance( const Tag* tag ) const { return new Content( tag, m_factory ); }
122 
123  // reimplemented from Plugin
124  virtual Plugin* clone() const;
125 
126  private:
127  Creator m_creator;
128  std::string m_disposition;
129  std::string m_name;
130  Senders m_senders;
131 
132  };
133 
134  }
135 
136 }
137 
138 #endif // JINGLECONTENT_H__
gloox::Jingle::Content::SBoth
@ SBoth
Definition: jinglecontent.h:61
gloox::Jingle::Content::Senders
Senders
Definition: jinglecontent.h:58
gloox::Jingle::Content::CResponder
@ CResponder
Definition: jinglecontent.h:50
gloox::Jingle::Content::creator
Creator creator() const
Definition: jinglecontent.h:89
gloox::Jingle::Content::SInitiator
@ SInitiator
Definition: jinglecontent.h:59
gloox::Jingle::Content::SNone
@ SNone
Definition: jinglecontent.h:62
gloox::Jingle::Plugin
An abstraction of a Jingle plugin. This is part of Jingle (XEP-0166 et al.)
Definition: jingleplugin.h:68
gloox::Jingle::Content
An abstraction of a Jingle Content Type. This is part of Jingle (XEP-0166).
Definition: jinglecontent.h:42
gloox::Jingle::PluginList
std::list< const Plugin * > PluginList
Definition: jingleplugin.h:52
gloox::Jingle::Content::name
const std::string & name() const
Definition: jinglecontent.h:107
gloox
The namespace for the gloox library.
Definition: adhoc.cpp:28
gloox::Tag
This is an abstraction of an XML element.
Definition: tag.h:47
gloox::Jingle::Content::Creator
Creator
Definition: jinglecontent.h:48
gloox::Jingle::Content::disposition
const std::string & disposition() const
Definition: jinglecontent.h:101
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::Content::newInstance
virtual Plugin * newInstance(const Tag *tag) const
Definition: jinglecontent.h:121
gloox::Jingle::Content::senders
Senders senders() const
Definition: jinglecontent.h:95
gloox::Jingle::Content::SResponder
@ SResponder
Definition: jinglecontent.h:60
gloox::Jingle::Content::CInitiator
@ CInitiator
Definition: jinglecontent.h:49