auth-twitch.hpp 765 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #pragma once
  2. #include <QDialog>
  3. #include <QTimer>
  4. #include <string>
  5. #include <memory>
  6. #include <json11.hpp>
  7. #include "auth-oauth.hpp"
  8. class BrowserDock;
  9. class TwitchAuth : public OAuthStreamKey {
  10. Q_OBJECT
  11. bool uiLoaded = false;
  12. std::string name;
  13. std::string uuid;
  14. virtual bool RetryLogin() override;
  15. virtual void SaveInternal() override;
  16. virtual bool LoadInternal() override;
  17. bool MakeApiRequest(const char *path, json11::Json &json_out);
  18. bool GetChannelInfo();
  19. virtual void LoadUI() override;
  20. public:
  21. TwitchAuth(const Def &d);
  22. ~TwitchAuth();
  23. static std::shared_ptr<Auth> Login(QWidget *parent,
  24. const std::string &service_name);
  25. QTimer uiLoadTimer;
  26. public slots:
  27. void TryLoadSecondaryUIPanes();
  28. void LoadSecondaryUIPanes();
  29. };