• Main Page
  • Classes
  • Files
  • File List

Swiften/Avatars/VCardUpdateAvatarManager.h

00001 /*
00002  * Copyright (c) 2010 Remko Tronçon
00003  * Licensed under the GNU General Public License v3.
00004  * See Documentation/Licenses/GPLv3.txt for more information.
00005  */
00006 
00007 #pragma once
00008 
00009 #include <boost/shared_ptr.hpp>
00010 #include <map>
00011 
00012 #include <Swiften/Base/API.h>
00013 #include <Swiften/Avatars/AvatarProvider.h>
00014 #include <Swiften/JID/JID.h>
00015 #include <Swiften/Elements/Presence.h>
00016 #include <Swiften/Elements/VCard.h>
00017 #include <Swiften/Elements/ErrorPayload.h>
00018 
00019 namespace Swift {
00020   class MUCRegistry;
00021   class AvatarStorage;
00022   class StanzaChannel;
00023   class VCardManager;
00024 
00025   class SWIFTEN_API VCardUpdateAvatarManager : public AvatarProvider, public boost::bsignals::trackable {
00026     public:
00027       VCardUpdateAvatarManager(VCardManager*, StanzaChannel*, AvatarStorage*, MUCRegistry* = NULL);
00028 
00029       std::string getAvatarHash(const JID&) const;
00030 
00031     private:
00032       void handlePresenceReceived(boost::shared_ptr<Presence>);
00033       void handleStanzaChannelAvailableChanged(bool);
00034       void handleVCardChanged(const JID& from, VCard::ref);
00035       void setAvatarHash(const JID& from, const std::string& hash);
00036       JID getAvatarJID(const JID& o) const;
00037 
00038     private:
00039       VCardManager* vcardManager_;
00040       AvatarStorage* avatarStorage_;
00041       MUCRegistry* mucRegistry_;
00042       std::map<JID, std::string> avatarHashes_;
00043   };
00044 }

Generated on Fri Oct 12 2012 21:00:19 for Swiften by  doxygen 1.7.1