blob: 429af69d239a64d554512a341ccf8dff3c18ba3a [file] [log] [blame]
Tao Bao337db142015-08-20 14:52:57 -07001/*
2 * Copyright (C) 2014 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17#ifndef RECOVERY_WEAR_UI_H
18#define RECOVERY_WEAR_UI_H
19
Tao Bao1fe1afe2018-05-01 15:56:05 -070020#include <string>
21#include <vector>
22
Prashant Malani7d9fd962016-03-08 13:18:45 -080023#include "screen_ui.h"
Tao Bao337db142015-08-20 14:52:57 -070024
Prashant Malani7d9fd962016-03-08 13:18:45 -080025class WearRecoveryUI : public ScreenRecoveryUI {
Tao Bao5d2e3bd2017-06-23 22:23:50 -070026 public:
27 WearRecoveryUI();
Tao Bao337db142015-08-20 14:52:57 -070028
Tao Bao5d2e3bd2017-06-23 22:23:50 -070029 void SetStage(int current, int max) override;
Tao Bao337db142015-08-20 14:52:57 -070030
Tao Bao5d2e3bd2017-06-23 22:23:50 -070031 protected:
32 // progress bar vertical position, it's centered horizontally
Tao Bao0bc88de2018-07-31 14:53:16 -070033 const int progress_bar_baseline_;
Tao Bao337db142015-08-20 14:52:57 -070034
Tao Bao99b2d772017-06-23 22:47:03 -070035 // Unusable rows when displaying the recovery menu, including the lines for headers (Android
36 // Recovery, build id and etc) and the bottom lines that may otherwise go out of the screen.
Tao Bao0bc88de2018-07-31 14:53:16 -070037 const int menu_unusable_rows_;
Tao Bao337db142015-08-20 14:52:57 -070038
Tianjie Xub99e6062018-10-16 15:13:09 -070039 std::unique_ptr<Menu> CreateMenu(const std::vector<std::string>& text_headers,
40 const std::vector<std::string>& text_items,
41 size_t initial_selection) const override;
Tao Bao3aec6962018-04-20 09:24:58 -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;
Tao Bao337db142015-08-20 14:52:57 -070050};
51
52#endif // RECOVERY_WEAR_UI_H