1
0

TwitchAuth.hpp 678 B

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