Add setting toggle that allows status bar display options in EpubReader. Supported options would be as follows: - FULL: display as is today - PROGRESS: display progress bar only - BATTERY: display battery only - NONE: hide status bar --------- Co-authored-by: Dave Allie <dave@daveallie.com>
46 lines
1.2 KiB
C++
46 lines
1.2 KiB
C++
#pragma once
|
|
#include <cstdint>
|
|
#include <iosfwd>
|
|
|
|
class CrossPointSettings {
|
|
private:
|
|
// Private constructor for singleton
|
|
CrossPointSettings() = default;
|
|
|
|
// Static instance
|
|
static CrossPointSettings instance;
|
|
|
|
public:
|
|
// Delete copy constructor and assignment
|
|
CrossPointSettings(const CrossPointSettings&) = delete;
|
|
CrossPointSettings& operator=(const CrossPointSettings&) = delete;
|
|
|
|
// Should match with SettingsActivity text
|
|
enum SLEEP_SCREEN_MODE { DARK = 0, LIGHT = 1, CUSTOM = 2, COVER = 3 };
|
|
|
|
// Status bar display type enum
|
|
enum STATUS_BAR_MODE { NONE = 0, NO_PROGRESS = 1, FULL = 2 };
|
|
|
|
// Sleep screen settings
|
|
uint8_t sleepScreen = DARK;
|
|
// Status bar settings
|
|
uint8_t statusBar = FULL;
|
|
// Text rendering settings
|
|
uint8_t extraParagraphSpacing = 1;
|
|
// Duration of the power button press
|
|
uint8_t shortPwrBtn = 0;
|
|
|
|
~CrossPointSettings() = default;
|
|
|
|
// Get singleton instance
|
|
static CrossPointSettings& getInstance() { return instance; }
|
|
|
|
uint16_t getPowerButtonDuration() const { return shortPwrBtn ? 10 : 500; }
|
|
|
|
bool saveToFile() const;
|
|
bool loadFromFile();
|
|
};
|
|
|
|
// Helper macro to access settings
|
|
#define SETTINGS CrossPointSettings::getInstance()
|