privacyitem.h

00001 /*
00002   Copyright (c) 2005-2006 by Jakob Schroeter <js@camaya.net>
00003   This file is part of the gloox library. http://camaya.net/gloox
00004 
00005   This software is distributed under a license. The full license
00006   agreement can be found in the file LICENSE in this distribution.
00007   This software may not be copied, modified, sold or distributed
00008   other than expressed in the named license agreement.
00009 
00010   This software is distributed without any warranty.
00011 */
00012 
00013 
00014 #ifndef PRIVACYITEM_H__
00015 #define PRIVACYITEM_H__
00016 
00017 #include "macros.h"
00018 
00019 #include <string>
00020 
00021 namespace gloox
00022 {
00023 
00031   class GLOOX_API PrivacyItem
00032   {
00033     public:
00034 
00038       enum ItemType
00039       {
00040         TYPE_UNDEFINED,        
00042         TYPE_JID,              
00043         TYPE_GROUP,            
00045         TYPE_SUBSCRIPTION      
00047       };
00048 
00052       enum ItemAction
00053       {
00054         ACTION_ALLOW,          
00055         ACTION_DENY            
00056       };
00057 
00061       enum ItemPacketType
00062       {
00063         PACKET_MESSAGE        =  1,  
00064         PACKET_PRESENCE_IN    =  2,  
00065         PACKET_PRESENCE_OUT   =  4,  
00066         PACKET_IQ             =  8,  
00067         PACKET_ALL            = 15   
00068       };
00069 
00077       PrivacyItem( const ItemType type = TYPE_UNDEFINED, const ItemAction action = ACTION_ALLOW,
00078                    const int packetType = 0, const std::string& value = "" );
00079 
00083       virtual ~PrivacyItem();
00084 
00089       const ItemType type() const { return m_type; };
00090 
00095       const ItemAction action() const { return m_action; };
00096 
00101       const int packetType() const { return m_packetType; };
00102 
00107       const std::string value() const { return m_value; };
00108 
00114       bool operator==( PrivacyItem& item ) const;
00115 
00116     private:
00117       ItemType m_type;
00118       ItemAction m_action;
00119       int m_packetType;
00120       std::string m_value;
00121   };
00122 
00123 }
00124 
00125 #endif // PRIVACYITEM_H__

Generated on Tue May 1 14:20:20 2007 for gloox by  doxygen 1.5.1