15ccb8f90Sopenharmony_ci/*
25ccb8f90Sopenharmony_ci * Copyright (c) 2021-2022 Huawei Device Co., Ltd.
35ccb8f90Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
45ccb8f90Sopenharmony_ci * you may not use this file except in compliance with the License.
55ccb8f90Sopenharmony_ci * You may obtain a copy of the License at
65ccb8f90Sopenharmony_ci *
75ccb8f90Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
85ccb8f90Sopenharmony_ci *
95ccb8f90Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
105ccb8f90Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
115ccb8f90Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
125ccb8f90Sopenharmony_ci * See the License for the specific language governing permissions and
135ccb8f90Sopenharmony_ci * limitations under the License.
145ccb8f90Sopenharmony_ci */
155ccb8f90Sopenharmony_ci
165ccb8f90Sopenharmony_ci#ifndef POWER_SHELL_COMMAND_H
175ccb8f90Sopenharmony_ci#define POWER_SHELL_COMMAND_H
185ccb8f90Sopenharmony_ci
195ccb8f90Sopenharmony_ci#include <functional>
205ccb8f90Sopenharmony_ci#include <getopt.h>
215ccb8f90Sopenharmony_ci#include <map>
225ccb8f90Sopenharmony_ci#include "shell_command.h"
235ccb8f90Sopenharmony_ci
245ccb8f90Sopenharmony_ci#include "power_mgr_client.h"
255ccb8f90Sopenharmony_ci
265ccb8f90Sopenharmony_cinamespace OHOS {
275ccb8f90Sopenharmony_cinamespace PowerMgr {
285ccb8f90Sopenharmony_ciclass PowerShellCommand : public OHOS::AAFwk::ShellCommand {
295ccb8f90Sopenharmony_cipublic:
305ccb8f90Sopenharmony_ci    PowerShellCommand(int argc, char *argv[]);
315ccb8f90Sopenharmony_ci    ~PowerShellCommand() override {};
325ccb8f90Sopenharmony_ci
335ccb8f90Sopenharmony_ciprivate:
345ccb8f90Sopenharmony_ci    static bool IsDeveloperMode();
355ccb8f90Sopenharmony_ci    ErrCode CreateCommandMap() override;
365ccb8f90Sopenharmony_ci    ErrCode CreateMessageMap() override;
375ccb8f90Sopenharmony_ci    ErrCode init() override;
385ccb8f90Sopenharmony_ci    ErrCode RunAsHelpCommand();
395ccb8f90Sopenharmony_ci    ErrCode RunAsDumpCommand();
405ccb8f90Sopenharmony_ci    ErrCode RunAsSetModeCommand();
415ccb8f90Sopenharmony_ci    ErrCode RunAsWakeupCommand();
425ccb8f90Sopenharmony_ci    ErrCode RunAsSuspendCommand();
435ccb8f90Sopenharmony_ci    ErrCode RunAsHibernateCommand();
445ccb8f90Sopenharmony_ci    ErrCode RunAsQueryLockCommand();
455ccb8f90Sopenharmony_ci    ErrCode RunAsProxyLockCommand();
465ccb8f90Sopenharmony_ci    ErrCode RunAsForceTimeOutCommand();
475ccb8f90Sopenharmony_ci    ErrCode RunAsTimeOutScreenLockCommand();
485ccb8f90Sopenharmony_ci#ifdef HAS_DISPLAY_MANAGER_PART
495ccb8f90Sopenharmony_ci    ErrCode RunAsDisplayCommand();
505ccb8f90Sopenharmony_ci    bool DisplayOptargEmpty();
515ccb8f90Sopenharmony_ci    ErrCode RunAsDisplayCommandHelp();
525ccb8f90Sopenharmony_ci    ErrCode RunAsDisplayCommandOverride();
535ccb8f90Sopenharmony_ci    ErrCode RunAsDisplayCommandRestore();
545ccb8f90Sopenharmony_ci    ErrCode RunAsDisplayCommandBoost();
555ccb8f90Sopenharmony_ci    ErrCode RunAsDisplayCommandCancelBoost();
565ccb8f90Sopenharmony_ci    ErrCode RunAsDisplayCommandSetValue();
575ccb8f90Sopenharmony_ci    ErrCode RunAsDisplayCommandDiscount();
585ccb8f90Sopenharmony_ci    std::map<char, std::function<int32_t()>> commandDisplay_;
595ccb8f90Sopenharmony_ci#endif
605ccb8f90Sopenharmony_ci    ErrCode RunAsTimeOutCommand();
615ccb8f90Sopenharmony_ci};
625ccb8f90Sopenharmony_ci}  // namespace PowerMgr
635ccb8f90Sopenharmony_ci}  // namespace OHOS
645ccb8f90Sopenharmony_ci#endif  // POWER_SHELL_COMMAND_H
65