Tab.hpp 816 B

1234567891011121314151617181920212223242526
  1. #pragma once
  2. #include <vector>
  3. #include <memory>
  4. namespace QuickMedia {
  5. class Body;
  6. class Page;
  7. class SearchBar;
  8. struct LoginInputs {
  9. std::vector<std::unique_ptr<SearchBar>> inputs;
  10. int focused_input = 0;
  11. bool needs_refresh = false;
  12. };
  13. struct Tab {
  14. Tab(std::unique_ptr<Body> body, std::unique_ptr<Page> page, std::unique_ptr<SearchBar> search_bar, LoginInputs login_inputs = {}) :
  15. body(std::move(body)), page(std::move(page)), search_bar(std::move(search_bar)), login_inputs(std::move(login_inputs)) {}
  16. std::unique_ptr<Body> body;
  17. std::unique_ptr<Page> page; // Only null when current page has |is_single_page()| set to true
  18. std::unique_ptr<SearchBar> search_bar; // Nullable
  19. LoginInputs login_inputs;
  20. };
  21. }