rosteritem.h

00001 /*
00002   Copyright (c) 2004-2005 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 ROSTERITEM_H__
00015 #define ROSTERITEM_H__
00016 
00017 #include "gloox.h"
00018 
00019 #include <string>
00020 #include <list>
00021 
00022 
00023 namespace gloox
00024 {
00025 
00032   class GLOOX_EXPORT RosterItem
00033   {
00034     friend class RosterManager;
00035 
00036     public:
00040       enum SubscriptionEnum
00041       {
00042         S10N_NONE,            
00044         S10N_NONE_OUT,        
00047         S10N_NONE_IN,         
00052         S10N_NONE_OUT_IN,     
00056         S10N_TO,              
00057         S10N_TO_IN,           
00059         S10N_FROM,            
00060         S10N_FROM_OUT,        
00062         S10N_BOTH             
00063       };
00064 
00070       RosterItem( const std::string& jid, const std::string& name = "" );
00071 
00075       virtual ~RosterItem();
00076 
00081       virtual void setName( const std::string& name );
00082 
00087       virtual const std::string name() const { return m_name; };
00088 
00093       virtual const std::string jid() const { return m_jid; };
00094 
00099       virtual SubscriptionEnum subscription() const { return m_subscription; };
00100 
00105       virtual void setGroups( const StringList& groups );
00106 
00111       virtual StringList& groups() { return m_groups; };
00112 
00117       virtual PresenceStatus status() const { return m_status; };
00118 
00123       virtual const std::string statusMsg() const { return m_statusMessage; };
00124 
00129       virtual bool changed() const { return m_changed; };
00130 
00131     protected:
00136       virtual void setStatus( PresenceStatus status );
00137 
00142       virtual void setStatusMsg( const std::string& msg );
00143 
00149       virtual void setSubscription( const std::string& subscription, bool ask );
00150 
00154       virtual void setSynchronized() { m_changed = false; };
00155 
00156     private:
00157       StringList m_groups;
00158       SubscriptionEnum m_subscription;
00159       PresenceStatus m_status;
00160       std::string m_statusMessage;
00161       std::string m_name;
00162       std::string m_jid;
00163       bool m_changed;
00164   };
00165 
00166 }
00167 
00168 #endif // ROSTERITEM_H__

Generated on Mon Jan 16 16:19:54 2006 for gloox by  doxygen 1.4.6