1 
2 /*
3  * Copyright (c) 2022 Huawei Device Co., Ltd.
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 UPDATER_UI_UPDATER_UI_EMPTY
18 #define UPDATER_UI_UPDATER_UI_EMPTY
19 
20 #include <string>
21 #include "updater_ui_const.h"
22 
23 namespace Updater {
24 class UpdaterUiEmpty {
25 public:
GetInstance()26     static UpdaterUiEmpty &GetInstance()
27     {
28         static UpdaterUiEmpty instance;
29         return instance;
30     }
InitEnv()31     void InitEnv() const {}
SetMode(std::string mode)32     [[nodiscard]] bool SetMode(std::string mode)
33     {
34         return true;
35     }
GetMode()36     std::string GetMode() const
37     {
38         return "";
39     }
40     void ShowLog(const std::string &tag, bool isClear = false) const {}
41     void ShowLogRes(const std::string &tag, bool isClear = false) const {}
42     void ShowUpdInfo(const std::string &tag, bool isClear = false) const {}
ClearText()43     void ClearText() const {}
ClearLog()44     void ClearLog() const {}
ShowProgress(float value)45     void ShowProgress(float value) const {}
ShowProgressPage()46     void ShowProgressPage() const {}
ShowSuccessPage()47     void ShowSuccessPage() const {}
ShowFailedPage()48     void ShowFailedPage() const {}
ShowFactoryConfirmPage()49     void ShowFactoryConfirmPage() {}
ShowMainpage()50     void ShowMainpage() const {}
ShowProgressWarning(bool isShow)51     void ShowProgressWarning(bool isShow) const {}
IsInProgress()52     bool IsInProgress() const
53     {
54         return false;
55     }
Sleep(int ms)56     void Sleep(int ms) const {}
SaveScreen()57     void SaveScreen() const {}
GetCurrentPercent()58     float GetCurrentPercent()
59     {
60         return 0;
61     }
62 };
63 } // namespace Updater
64 #endif