privacyitem.h
/*
Copyright (c) 2005-2023 by Jakob Schröter <js@camaya.net>
This file is part of the gloox library. http://camaya.net/gloox
This software is distributed under a license. The full license
agreement can be found in the file LICENSE in this distribution.
This software may not be copied, modified, sold or distributed
other than expressed in the named license agreement.
This software is distributed without any warranty.
*/
#ifndef PRIVACYITEM_H__
#define PRIVACYITEM_H__
#include "macros.h"
#include "gloox.h"
#include <string>
namespace gloox
{
class GLOOX_API PrivacyItem
{
public:
enum ItemType
{
TypeUndefined,
TypeJid,
TypeGroup,
TypeSubscription
};
enum ItemAction
{
ActionAllow,
ActionDeny
};
enum ItemPacketType
{
PacketMessage = 1,
PacketPresenceIn = 2,
PacketPresenceOut = 4,
PacketIq = 8,
PacketAll = 15
};
PrivacyItem( const ItemType type = TypeUndefined, const ItemAction action = ActionAllow,
const int packetType = 0, const std::string& value = EmptyString );
virtual ~PrivacyItem();
ItemType type() const { return m_type; }
ItemAction action() const { return m_action; }
int packetType() const { return m_packetType; }
const std::string value() const { return m_value; }
bool operator==( const PrivacyItem& item ) const;
private:
ItemType m_type;
ItemAction m_action;
int m_packetType;
std::string m_value;
};
}
#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