blob: 8b2f68f5d7c292abe0d34b24411639985ef37cd4 [file] [log] [blame]
Tao Bao337db142015-08-20 14:52:57 -07001/*
2 * Copyright (C) 2014 The Android Open Source Project
Tom Marshall820517b2019-01-14 14:28:55 -08003 * Copyright (C) 2019 The LineageOS Project
Tao Bao337db142015-08-20 14:52:57 -07004 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18#ifndef RECOVERY_WEAR_UI_H
19#define RECOVERY_WEAR_UI_H
20
Prashant Malani7d9fd962016-03-08 13:18:45 -080021#include "screen_ui.h"
Tao Bao337db142015-08-20 14:52:57 -070022
Prashant Malani7d9fd962016-03-08 13:18:45 -080023class WearRecoveryUI : public ScreenRecoveryUI {
Tao Bao5d2e3bd2017-06-23 22:23:50 -070024 public:
25 WearRecoveryUI();
Tao Bao337db142015-08-20 14:52:57 -070026
Tao Bao5d2e3bd2017-06-23 22:23:50 -070027 void SetStage(int current, int max) override;
Tao Bao337db142015-08-20 14:52:57 -070028
Tao Bao5d2e3bd2017-06-23 22:23:50 -070029 // menu display
Tom Marshall820517b2019-01-14 14:28:55 -080030 void StartMenu(bool is_main, menu_type_t type, const char* const* headers,
31 const MenuItemVector& items, int initial_selection) override;
Tao Bao5d2e3bd2017-06-23 22:23:50 -070032 int SelectMenu(int sel) override;
Tom Marshall820517b2019-01-14 14:28:55 -080033 int SelectMenu(const Point& point) override;
Tao Bao337db142015-08-20 14:52:57 -070034
Tao Bao5d2e3bd2017-06-23 22:23:50 -070035 protected:
36 // progress bar vertical position, it's centered horizontally
Tao Bao0470cee2017-08-02 17:11:04 -070037 const int kProgressBarBaseline;
Tao Bao337db142015-08-20 14:52:57 -070038
Tao Bao99b2d772017-06-23 22:47:03 -070039 // Unusable rows when displaying the recovery menu, including the lines for headers (Android
40 // Recovery, build id and etc) and the bottom lines that may otherwise go out of the screen.
Tao Baoeea3af32017-08-11 13:50:24 -070041 const int kMenuUnusableRows;
Tao Bao337db142015-08-20 14:52:57 -070042
Tao Bao99b2d772017-06-23 22:47:03 -070043 int GetProgressBaseline() const override;
Tao Bao337db142015-08-20 14:52:57 -070044
Tao Bao5d2e3bd2017-06-23 22:23:50 -070045 void update_progress_locked() override;
Damien Bargiacchiad8b5a62016-09-09 08:18:06 -070046
Tao Bao5d2e3bd2017-06-23 22:23:50 -070047 private:
Tao Bao5d2e3bd2017-06-23 22:23:50 -070048 void draw_background_locked() override;
49 void draw_screen_locked() override;
Damien Bargiacchi5e7cfb92016-08-24 18:28:43 -070050
Tao Bao79127102017-08-30 15:23:34 -070051 int menu_start, menu_end;
Tao Bao337db142015-08-20 14:52:57 -070052};
53
54#endif // RECOVERY_WEAR_UI_H