Skip to content
Repos

DevPlaceApp

C++ 664 B30 lines Opens in site

Directory Raw Download

#pragma once
// Spec: FR-SET-01, PG-09, INV-shell 14. Settings form.
#include <memory>

#include "ui/Navigation.hpp"

namespace dp {

class SettingsScreen : public ui::Screen {
 public:
  ~SettingsScreen() override { *alive_ = false; }

  ui::ViewPtr body() override;
  std::string title() const override;
  ui::ViewPtr toolbarTrailing() override;
  bool busy() const override { return isWorking_; }

  void logOut();
  void deleteAccount(const std::string& password);

 private:
  void askSignOut();
  void askDeleteAccount();
  void askPassword();

  std::shared_ptr<bool> alive_ = std::make_shared<bool>(true);
  bool isWorking_ = false;
};

}  // namespace dp
44.9ms