gloox
1.0.22
src
subscription.h
1
/*
2
Copyright (c) 2007-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
#ifndef SUBSCRIPTION_H__
14
#define SUBSCRIPTION_H__
15
16
#include "stanza.h"
17
18
#include <string>
19
20
namespace
gloox
21
{
22
23
class
JID;
24
31
class
GLOOX_API
Subscription
:
public
Stanza
32
{
33
34
public
:
35
36
friend
class
ClientBase
;
37
41
enum
S10nType
42
{
43
Subscribe
,
44
Subscribed
,
45
Unsubscribe
,
46
Unsubscribed
,
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
92
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__
gloox::Stanza
This is the base class for XMPP stanza abstractions.
Definition:
stanza.h:33
gloox::Subscription::Unsubscribed
@ Unsubscribed
Definition:
subscription.h:46
gloox::Subscription::status
const std::string status(const std::string &lang="default") const
Definition:
subscription.h:80
gloox::Subscription::Unsubscribe
@ Unsubscribe
Definition:
subscription.h:45
gloox::Subscription::S10nType
S10nType
Definition:
subscription.h:41
gloox::Subscription::subtype
S10nType subtype() const
Definition:
subscription.h:69
gloox::EmptyString
const std::string EmptyString
Definition:
gloox.cpp:124
gloox::Subscription::Subscribe
@ Subscribe
Definition:
subscription.h:43
gloox::JID
An abstraction of a JID.
Definition:
jid.h:30
gloox
The namespace for the gloox library.
Definition:
adhoc.cpp:27
gloox::Tag
This is an abstraction of an XML element.
Definition:
tag.h:46
gloox::ClientBase
This is the common base class for a Jabber/XMPP Client and a Jabber Component.
Definition:
clientbase.h:76
gloox::Subscription
An abstraction of a subscription stanza.
Definition:
subscription.h:31
gloox::Subscription::Subscribed
@ Subscribed
Definition:
subscription.h:44
gloox::StringMap
std::map< std::string, std::string > StringMap
Definition:
gloox.h:1261
Generated on Tue Mar 24 2020 14:04:23 for gloox by
1.8.17