#ifndef CLIENT_H #define CLIENT_H #include #include #include "Config.h" #include "HTTP.h" #include "search/Thumbnail.h" #include "search/Save.h" #include "Singleton.h" #include "User.h" enum LoginStatus { LoginOkay, LoginError }; class Client: public Singleton { private: std::string lastError; int thumbnailCacheNextID; Thumbnail * thumbnailCache[THUMB_CACHE_SIZE]; void * activeThumbRequests[IMGCONNS]; int activeThumbRequestTimes[IMGCONNS]; int activeThumbRequestCompleteTimes[IMGCONNS]; std::string activeThumbRequestIDs[IMGCONNS]; public: Client(); ~Client(); LoginStatus Login(string username, string password, User & user); void ClearThumbnailRequests(); std::vector * SearchSaves(int start, int count, string query, string sort, int & resultCount); Thumbnail * GetPreview(int saveID, int saveDate); Thumbnail * GetThumbnail(int saveID, int saveDate); Save * GetSave(int saveID, int saveDate); std::string GetLastError() { return lastError; } }; #endif // CLIENT_H