gloox
1.0.28
src
privacyitem.h
1
/*
2
Copyright (c) 2005-2023 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 PRIVACYITEM_H__
15
#define PRIVACYITEM_H__
16
17
#include "macros.h"
18
#include "gloox.h"
19
20
#include <string>
21
22
namespace
gloox
23
{
24
32
class
GLOOX_API
PrivacyItem
33
{
34
public
:
35
39
enum
ItemType
40
{
41
TypeUndefined
,
43
TypeJid
,
44
TypeGroup
,
46
TypeSubscription
48
};
49
53
enum
ItemAction
54
{
55
ActionAllow
,
56
ActionDeny
57
};
58
62
enum
ItemPacketType
63
{
64
PacketMessage
= 1,
65
PacketPresenceIn
= 2,
66
PacketPresenceOut
= 4,
67
PacketIq
= 8,
68
PacketAll
= 15
69
};
70
78
PrivacyItem
(
const
ItemType type = TypeUndefined,
const
ItemAction action = ActionAllow,
79
const
int
packetType = 0,
const
std::string& value =
EmptyString
);
80
84
virtual
~PrivacyItem
();
85
90
ItemType
type
()
const
{
return
m_type; }
91
96
ItemAction
action
()
const
{
return
m_action; }
97
102
int
packetType
()
const
{
return
m_packetType; }
103
108
const
std::string
value
()
const
{
return
m_value; }
109
115
bool
operator==(
const
PrivacyItem
& item )
const
;
116
117
private
:
118
ItemType m_type;
119
ItemAction m_action;
120
int
m_packetType;
121
std::string m_value;
122
};
123
124
}
125
126
#endif
// PRIVACYITEM_H__
gloox::PrivacyItem
This is an abstraction of a single item of a privacy list, describing an allowed or forbidden action.
Definition
privacyitem.h:33
gloox::PrivacyItem::ItemPacketType
ItemPacketType
Definition
privacyitem.h:63
gloox::PrivacyItem::PacketIq
@ PacketIq
Definition
privacyitem.h:67
gloox::PrivacyItem::PacketPresenceOut
@ PacketPresenceOut
Definition
privacyitem.h:66
gloox::PrivacyItem::PacketPresenceIn
@ PacketPresenceIn
Definition
privacyitem.h:65
gloox::PrivacyItem::PacketAll
@ PacketAll
Definition
privacyitem.h:68
gloox::PrivacyItem::PacketMessage
@ PacketMessage
Definition
privacyitem.h:64
gloox::PrivacyItem::PrivacyItem
PrivacyItem(const ItemType type=TypeUndefined, const ItemAction action=ActionAllow, const int packetType=0, const std::string &value=EmptyString)
Definition
privacyitem.cpp:20
gloox::PrivacyItem::ItemAction
ItemAction
Definition
privacyitem.h:54
gloox::PrivacyItem::ActionDeny
@ ActionDeny
Definition
privacyitem.h:56
gloox::PrivacyItem::ActionAllow
@ ActionAllow
Definition
privacyitem.h:55
gloox::PrivacyItem::ItemType
ItemType
Definition
privacyitem.h:40
gloox::PrivacyItem::TypeSubscription
@ TypeSubscription
Definition
privacyitem.h:46
gloox::PrivacyItem::TypeUndefined
@ TypeUndefined
Definition
privacyitem.h:41
gloox::PrivacyItem::TypeJid
@ TypeJid
Definition
privacyitem.h:43
gloox::PrivacyItem::TypeGroup
@ TypeGroup
Definition
privacyitem.h:44
gloox::PrivacyItem::type
ItemType type() const
Definition
privacyitem.h:90
gloox::PrivacyItem::action
ItemAction action() const
Definition
privacyitem.h:96
gloox::PrivacyItem::value
const std::string value() const
Definition
privacyitem.h:108
gloox::PrivacyItem::packetType
int packetType() const
Definition
privacyitem.h:102
gloox
The namespace for the gloox library.
Definition
adhoc.cpp:28
gloox::EmptyString
const std::string EmptyString
Definition
gloox.cpp:124
Generated on
for gloox by
1.15.0