00001
00002
00003
00004
00005
00006
00007 #pragma once
00008
00009 #include <vector>
00010 #include <map>
00011
00012 #include <Swiften/Base/API.h>
00013 #include <Swiften/Avatars/AvatarProvider.h>
00014 #include <Swiften/JID/JID.h>
00015
00016 namespace Swift {
00017 class SWIFTEN_API CombinedAvatarProvider : public AvatarProvider {
00018 public:
00019 virtual std::string getAvatarHash(const JID&) const;
00020
00021 void addProvider(AvatarProvider*);
00022 void removeProvider(AvatarProvider*);
00023
00024 private:
00025 void handleAvatarChanged(const JID&);
00026 std::string getCombinedAvatarAndCache(const JID&) const;
00027
00028 private:
00029 std::vector<AvatarProvider*> providers;
00030 mutable std::map<JID, std::string> avatars;
00031 };
00032 }