summaryrefslogtreecommitdiffstats
path: root/ui.h
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2017-01-04 20:27:17 +0100
committerandroid-build-merger <android-build-merger@google.com>2017-01-04 20:27:17 +0100
commit74e0ecb25bda6a1c01355d22e3e20bdb3226f3ea (patch)
tree2993d4b32a868c0c7d45fc293508f8a25de11b56 /ui.h
parentMerge "updater: Refactor parse_range()." am: 466e1b396a am: 6502c50e4b (diff)
parentMerge "recovery: Fix the broken UI text." am: 56fc8fa376 (diff)
downloadandroid_bootable_recovery-74e0ecb25bda6a1c01355d22e3e20bdb3226f3ea.tar
android_bootable_recovery-74e0ecb25bda6a1c01355d22e3e20bdb3226f3ea.tar.gz
android_bootable_recovery-74e0ecb25bda6a1c01355d22e3e20bdb3226f3ea.tar.bz2
android_bootable_recovery-74e0ecb25bda6a1c01355d22e3e20bdb3226f3ea.tar.lz
android_bootable_recovery-74e0ecb25bda6a1c01355d22e3e20bdb3226f3ea.tar.xz
android_bootable_recovery-74e0ecb25bda6a1c01355d22e3e20bdb3226f3ea.tar.zst
android_bootable_recovery-74e0ecb25bda6a1c01355d22e3e20bdb3226f3ea.zip
Diffstat (limited to 'ui.h')
-rw-r--r--ui.h21
1 files changed, 14 insertions, 7 deletions
diff --git a/ui.h b/ui.h
index be95a4e23..8493c6f0a 100644
--- a/ui.h
+++ b/ui.h
@@ -21,6 +21,8 @@
#include <pthread.h>
#include <time.h>
+#include <string>
+
// Abstract class for controlling the user interface during recovery.
class RecoveryUI {
public:
@@ -28,14 +30,13 @@ class RecoveryUI {
virtual ~RecoveryUI() { }
- // Initialize the object; called before anything else. Returns true on success.
- virtual bool Init();
+ // Initialize the object; called before anything else. UI texts will be
+ // initialized according to the given locale. Returns true on success.
+ virtual bool Init(const std::string& locale);
+
// Show a stage indicator. Call immediately after Init().
virtual void SetStage(int current, int max) = 0;
- // After calling Init(), you can tell the UI what locale it is operating in.
- virtual void SetLocale(const char* locale) = 0;
-
// Set the overall recovery state ("background image").
enum Icon { NONE, INSTALLING_UPDATE, ERASING, NO_COMMAND, ERROR };
virtual void SetBackground(Icon icon) = 0;
@@ -122,10 +123,14 @@ class RecoveryUI {
// statements will be displayed.
virtual void EndMenu() = 0;
-protected:
+ protected:
void EnqueueKey(int key_code);
-private:
+ // The locale that's used to show the rendered texts.
+ std::string locale_;
+ bool rtl_locale_;
+
+ private:
// Key event input queue
pthread_mutex_t key_queue_mutex;
pthread_cond_t key_queue_cond;
@@ -162,6 +167,8 @@ private:
static void* time_key_helper(void* cookie);
void time_key(int key_code, int count);
+
+ void SetLocale(const std::string&);
};
#endif // RECOVERY_UI_H