## Summary * If going to sleep was from the Reader view, wake up to the same book. Otherwise, wakeup to the Home view
28 lines
851 B
C++
28 lines
851 B
C++
#pragma once
|
|
|
|
#include <HardwareSerial.h>
|
|
|
|
#include <string>
|
|
#include <utility>
|
|
|
|
class MappedInputManager;
|
|
class GfxRenderer;
|
|
|
|
class Activity {
|
|
protected:
|
|
std::string name;
|
|
GfxRenderer& renderer;
|
|
MappedInputManager& mappedInput;
|
|
|
|
public:
|
|
explicit Activity(std::string name, GfxRenderer& renderer, MappedInputManager& mappedInput)
|
|
: name(std::move(name)), renderer(renderer), mappedInput(mappedInput) {}
|
|
virtual ~Activity() = default;
|
|
virtual void onEnter() { Serial.printf("[%lu] [ACT] Entering activity: %s\n", millis(), name.c_str()); }
|
|
virtual void onExit() { Serial.printf("[%lu] [ACT] Exiting activity: %s\n", millis(), name.c_str()); }
|
|
virtual void loop() {}
|
|
virtual bool skipLoopDelay() { return false; }
|
|
virtual bool preventAutoSleep() { return false; }
|
|
virtual bool isReaderActivity() const { return false; }
|
|
};
|