gloox 1.0.24
subscription.h
1/*
2 Copyright (c) 2007-2019 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#ifndef SUBSCRIPTION_H__
14#define SUBSCRIPTION_H__
15
16#include "stanza.h"
17
18#include <string>
19
20namespace gloox
21{
22
23 class JID;
24
31 class GLOOX_API Subscription : public Stanza
32 {
33
34 public:
35
36 friend class ClientBase;
37
42 {
47 Invalid
48 };
49
57 Subscription( S10nType type, const JID& to, const std::string& status = EmptyString,
58 const std::string& xmllang = EmptyString );
62 virtual ~Subscription();
63
69 S10nType subtype() const { return m_subtype; }
70
80 const std::string status( const std::string& lang = "default" ) const
81 {
82 return findLang( m_stati, m_status, lang );
83 }
84
85 // reimplemented from Stanza
86 virtual Tag* tag() const;
87
88 private:
89#ifdef SUBSCRIPTION_TEST
90 public:
91#endif
96 Subscription( Tag* tag );
97
98 S10nType m_subtype;
99 StringMap* m_stati;
100 std::string m_status;
101
102 };
103
104}
105
106#endif // SUBSCRIPTION_H__
This is the common base class for a Jabber/XMPP Client and a Jabber Component.
Definition: clientbase.h:79
An abstraction of a JID.
Definition: jid.h:31
This is the base class for XMPP stanza abstractions.
Definition: stanza.h:34
An abstraction of a subscription stanza.
Definition: subscription.h:32
S10nType subtype() const
Definition: subscription.h:69
const std::string status(const std::string &lang="default") const
Definition: subscription.h:80
This is an abstraction of an XML element.
Definition: tag.h:47
The namespace for the gloox library.
Definition: adhoc.cpp:28
const std::string EmptyString
Definition: gloox.cpp:124
std::map< std::string, std::string > StringMap
Definition: gloox.h:1261