gloox 1.0
privacyitem.h
00001 /*
00002   Copyright (c) 2005-2009 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 #include "gloox.h"
00019 
00020 #include <string>
00021 
00022 namespace gloox
00023 {
00024 
00032   class GLOOX_API PrivacyItem
00033   {
00034     public:
00035 
00039       enum ItemType
00040       {
00041         TypeUndefined,              
00043         TypeJid,                    
00044         TypeGroup,                  
00046         TypeSubscription            
00048       };
00049 
00053       enum ItemAction
00054       {
00055         ActionAllow,                
00056         ActionDeny                  
00057       };
00058 
00062       enum ItemPacketType
00063       {
00064         PacketMessage        =  1,  
00065         PacketPresenceIn     =  2,  
00066         PacketPresenceOut    =  4,  
00067         PacketIq             =  8,  
00068         PacketAll            = 15   
00069       };
00070 
00078       PrivacyItem( const ItemType type = TypeUndefined, const ItemAction action = ActionAllow,
00079                    const int packetType = 0, const std::string& value = EmptyString );
00080 
00084       virtual ~PrivacyItem();
00085 
00090       ItemType type() const { return m_type; }
00091 
00096       ItemAction action() const { return m_action; }
00097 
00102       int packetType() const { return m_packetType; }
00103 
00108       const std::string value() const { return m_value; }
00109 
00115       bool operator==( const PrivacyItem& item ) const;
00116 
00117     private:
00118       ItemType m_type;
00119       ItemAction m_action;
00120       int m_packetType;
00121       std::string m_value;
00122   };
00123 
00124 }
00125 
00126 #endif // PRIVACYITEM_H__