Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | Related Pages

rosteritem.h

00001 /*
00002   Copyright (c) 2004-2008 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 #include "resource.h"
00019 #include "presence.h"
00020 
00021 #include <string>
00022 #include <list>
00023 
00024 
00025 namespace gloox
00026 {
00027 
00028   class RosterItemData;
00029 
00039   class GLOOX_API RosterItem
00040   {
00041     friend class RosterManager;
00042 
00043     public:
00047       typedef std::map<std::string, Resource*> ResourceMap;
00048 
00054       RosterItem( const std::string& jid, const std::string& name = EmptyString );
00055 
00061       RosterItem( const RosterItemData& data );
00062 
00066       virtual ~RosterItem();
00067 
00072       void setName( const std::string& name );
00073 
00078       const std::string& name() const;
00079 
00084       const std::string& jid() const;
00085 
00091       void setSubscription( const std::string& subscription, const std::string& ask );
00092 
00097       SubscriptionType subscription() const;
00098 
00103       void setGroups( const StringList& groups );
00104 
00109       const StringList groups() const;
00110 
00115       bool changed() const;
00116 
00121       bool online() const;
00122 
00127       const ResourceMap& resources() const { return m_resources; }
00128 
00134       const Resource* resource( const std::string& res ) const;
00135 
00136     protected:
00142       void setPresence( const std::string& resource, Presence::PresenceType presence );
00143 
00149       void setStatus( const std::string& resource, const std::string& msg );
00150 
00156       void setPriority( const std::string& resource, int priority );
00157 
00164       void setExtensions( const std::string& resource, const StanzaExtensionList& exts );
00165 
00169       void setSynchronized();
00170 
00175       void removeResource( const std::string& resource );
00176 
00181       void setData( const RosterItemData& rid );
00182 
00183     private:
00184       RosterItemData* m_data;
00185       ResourceMap m_resources;
00186 
00187   };
00188 
00189 }
00190 
00191 #endif // ROSTERITEM_H__

Generated on Mon Nov 17 02:45:12 2008 for gloox by  doxygen 1.4.1