summaryrefslogtreecommitdiffstats
path: root/screen_ui.h
diff options
context:
space:
mode:
authorandroid-build-prod (mdb) <android-build-team-robot@google.com>2018-05-03 07:09:22 +0200
committerandroid-build-merger <android-build-merger@google.com>2018-05-03 07:09:22 +0200
commit5ba2fa1c4e1aad50557e51320721b0d8a23714dc (patch)
tree1d43eaa24ff5811e00b210ff2aee92473ca460af /screen_ui.h
parentMerge "updater_sample: Add streaming to PayloadSpec" am: 3a79b36377 am: 98837bdcd1 (diff)
parentMerge "screen_ui: Merge Menu::Start() into its ctor." am: 0cabcd0126 (diff)
downloadandroid_bootable_recovery-5ba2fa1c4e1aad50557e51320721b0d8a23714dc.tar
android_bootable_recovery-5ba2fa1c4e1aad50557e51320721b0d8a23714dc.tar.gz
android_bootable_recovery-5ba2fa1c4e1aad50557e51320721b0d8a23714dc.tar.bz2
android_bootable_recovery-5ba2fa1c4e1aad50557e51320721b0d8a23714dc.tar.lz
android_bootable_recovery-5ba2fa1c4e1aad50557e51320721b0d8a23714dc.tar.xz
android_bootable_recovery-5ba2fa1c4e1aad50557e51320721b0d8a23714dc.tar.zst
android_bootable_recovery-5ba2fa1c4e1aad50557e51320721b0d8a23714dc.zip
Diffstat (limited to 'screen_ui.h')
-rw-r--r--screen_ui.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/screen_ui.h b/screen_ui.h
index b0cbbdb90..3b309fb13 100644
--- a/screen_ui.h
+++ b/screen_ui.h
@@ -33,7 +33,10 @@ struct GRSurface;
// This class maintains the menu selection and display of the screen ui.
class Menu {
public:
- Menu(bool scrollable, size_t max_items, size_t max_length);
+ // Constructs a Menu instance with the given |headers|, |items| and properties. Sets the initial
+ // selection to |initial_selection|.
+ Menu(bool scrollable, size_t max_items, size_t max_length, const char* const* headers,
+ const char* const* items, int initial_selection);
bool scrollable() const {
return scrollable_;
@@ -45,8 +48,10 @@ class Menu {
// Returns count of menu items.
size_t ItemsCount() const;
+
// Returns the index of the first menu item.
size_t MenuStart() const;
+
// Returns the index of the last menu item + 1.
size_t MenuEnd() const;
@@ -68,10 +73,6 @@ class Menu {
// |cur_selection_str| if the items exceed the screen limit.
bool ItemsOverflow(std::string* cur_selection_str) const;
- // Starts the menu with |headers| and |items| in text. Sets the default selection to
- // |initial_selection|.
- void Start(const char* const* headers, const char* const* items, int initial_selection);
-
// Sets the current selection to |sel|. Handle the overflow cases depending on if the menu is
// scrollable.
int Select(int sel);