1 /* 2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 16 #ifndef POWER_SHELL_COMMAND_H 17 #define POWER_SHELL_COMMAND_H 18 19 #include "shell_command.h" 20 21 #include "power_mgr_client.h" 22 23 namespace OHOS { 24 namespace PowerMgr { 25 class PowerShellCommand : public OHOS::AAFwk::ShellCommand { 26 public: 27 PowerShellCommand(int argc, char *argv[]); ~PowerShellCommand()28 ~PowerShellCommand() override {}; 29 30 private: 31 ErrCode CreateCommandMap() override; 32 ErrCode CreateMessageMap() override; 33 ErrCode init() override; 34 ErrCode RunAsHelpCommand(); 35 ErrCode RunAsDumpCommand(); 36 ErrCode RunAsSetModeCommand(); 37 ErrCode RunAsWakeupCommand(); 38 ErrCode RunAsSuspendCommand(); 39 #ifdef HAS_DISPLAY_MANAGER_PART 40 ErrCode RunAsDisplayCommand(); 41 #endif 42 ErrCode RunAsTimeOutCommand(); 43 }; 44 } // namespace PowerMgr 45 } // namespace OHOS 46 #endif // POWER_SHELL_COMMAND_H