1
0

Cloud.h 844 B

1234567891011121314151617181920212223242526272829303132333435
  1. #ifndef NULLSOFT_CLOUDH
  2. #define NULLSOFT_CLOUDH
  3. #include <windows.h>
  4. #include "Feeds.h"
  5. #include "../nu/threadpool/api_threadpool.h"
  6. #include "../nu/threadpool/timerhandle.hpp"
  7. #include "../nu/AutoLock.h"
  8. class Cloud
  9. {
  10. public:
  11. Cloud();
  12. ~Cloud();
  13. void Init();
  14. void Quit();
  15. void Refresh( Channel &channel );
  16. void GetStatus( wchar_t *status, size_t len );
  17. void RefreshAll();
  18. void Pulse() { SetEvent( cloudEvent ); }
  19. private:
  20. static DWORD WINAPI CloudThread( void *param );
  21. void SetStatus( const wchar_t *newStatus );
  22. void Callback();
  23. ThreadID *cloudThread;
  24. wchar_t *statusText;
  25. Nullsoft::Utility::LockGuard statusGuard;
  26. HANDLE cloudEvent, cloudDone;
  27. TimerHandle cloudTimerEvent;
  28. static int CloudThreadPoolFunc( HANDLE handle, void *user_data, intptr_t param );
  29. };
  30. #endif