1
0

auth-twitch.hpp 793 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. friend class TwitchLogin;
  12. bool uiLoaded = false;
  13. std::string name;
  14. std::string uuid;
  15. virtual bool RetryLogin() override;
  16. virtual void SaveInternal() override;
  17. virtual bool LoadInternal() override;
  18. bool MakeApiRequest(const char *path, json11::Json &json_out);
  19. bool GetChannelInfo();
  20. virtual void LoadUI() override;
  21. public:
  22. TwitchAuth(const Def &d);
  23. ~TwitchAuth();
  24. static std::shared_ptr<Auth> Login(QWidget *parent,
  25. const std::string &service_name);
  26. QTimer uiLoadTimer;
  27. public slots:
  28. void TryLoadSecondaryUIPanes();
  29. void LoadSecondaryUIPanes();
  30. };