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 #ifndef SYSTEM_EVENT_HANDLER_H 16 #define SYSTEM_EVENT_HANDLER_H 17 18 #include <functional> 19 #include <map> 20 #include "singleton.h" 21 #include "proto.h" 22 #include "msg_handler.h" 23 24 namespace OHOS { 25 namespace MMI { 26 class SystemEventHandler : public DelayedSingleton<SystemEventHandler>, public MsgHandler<std::function<void()>> { 27 public: 28 SystemEventHandler(); 29 virtual ~SystemEventHandler(); 30 31 int32_t OnSystemEventHandler(MmiMessageId idMsg); 32 33 protected: 34 void OnGotoDesktop(); 35 void OnScreenShot(); 36 void OnScreenSplit(); 37 void OnStopScreenRecord(); 38 void OnStartScreenRecord(); 39 void OnShowNotification(); 40 void OnRecent(); 41 void OnLockScreen(); 42 void OnSearch(); 43 void OnClosePage(); 44 void OnLaunchVoiceAssistant(); 45 void OnMute(); 46 void OnBack(); 47 }; 48 } // namespace MMI 49 } // namespace OHOS 50 #define SysEveHdl OHOS::MMI::SystemEventHandler::GetInstance() 51 52 #endif // SYSTEM_EVENT_HANDLER_H