gloox  1.0.16
jinglecontent.h
1 /*
2  Copyright (c) 2008-2015 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__
An abstraction of a Jingle plugin. This is part of Jingle (XEP-0166 et al.)
Definition: jingleplugin.h:64
A factory for which creates Plugin instances based on Tags. This is part of Jingle (XEP-0166)...
virtual Plugin * newInstance(const Tag *tag) const
const std::string & name() const
The namespace for the gloox library.
Definition: adhoc.cpp:27
const std::string & disposition() const
Creator creator() const
Definition: jinglecontent.h:89
Senders senders() const
Definition: jinglecontent.h:95
std::list< const Plugin * > PluginList
Definition: jingleplugin.h:49
This is an abstraction of an XML element.
Definition: tag.h:46
An abstraction of a Jingle Content Type. This is part of Jingle (XEP-0166).
Definition: jinglecontent.h:41