1 | //============================================================================ |
2 | // |
3 | // SSSS tt lll lll |
4 | // SS SS tt ll ll |
5 | // SS tttttt eeee ll ll aaaa |
6 | // SSSS tt ee ee ll ll aa |
7 | // SS tt eeeeee ll ll aaaaa -- "An Atari 2600 VCS Emulator" |
8 | // SS SS tt ee ll ll aa aa |
9 | // SSSS ttt eeeee llll llll aaaaa |
10 | // |
11 | // Copyright (c) 1995-2019 by Bradford W. Mott, Stephen Anthony |
12 | // and the Stella Team |
13 | // |
14 | // See the file "License.txt" for information on usage and redistribution of |
15 | // this file, and for a DISCLAIMER OF ALL WARRANTIES. |
16 | //============================================================================ |
17 | |
18 | #ifndef FLASH_WIDGET_HXX |
19 | #define FLASH_WIDGET_HXX |
20 | |
21 | class Controller; |
22 | class ButtonWidget; |
23 | |
24 | #include "ControllerWidget.hxx" |
25 | |
26 | class FlashWidget : public ControllerWidget |
27 | { |
28 | public: |
29 | FlashWidget(GuiObject* boss, const GUI::Font& font, int x, int y, |
30 | Controller& controller); |
31 | virtual ~FlashWidget() = default; |
32 | |
33 | protected: |
34 | void init(GuiObject* boss, const GUI::Font& font, int x, int y); |
35 | |
36 | private: |
37 | ButtonWidget* myEEPROMEraseCurrent; |
38 | enum { kEEPROMEraseCurrent = 'eeEC' }; |
39 | |
40 | static constexpr uInt32 MAX_PAGES = 5; |
41 | StaticTextWidget* myPage[MAX_PAGES]; |
42 | |
43 | private: |
44 | void loadConfig() override; |
45 | void handleCommand(CommandSender* sender, int cmd, int data, int id) override; |
46 | |
47 | /** |
48 | Erase the EEPROM pages used by the current ROM |
49 | */ |
50 | virtual void eraseCurrent() = 0; |
51 | |
52 | /** |
53 | Check if a page is used by the current ROM |
54 | */ |
55 | virtual bool isPageUsed(uInt32 page) = 0; |
56 | |
57 | // Following constructors and assignment operators not supported |
58 | FlashWidget() = delete; |
59 | FlashWidget(const FlashWidget&) = delete; |
60 | FlashWidget(FlashWidget&&) = delete; |
61 | FlashWidget& operator=(const FlashWidget&) = delete; |
62 | FlashWidget& operator=(FlashWidget&&) = delete; |
63 | }; |
64 | |
65 | #endif |
66 | |