1ce968135Sopenharmony_ci/* 2ce968135Sopenharmony_ci * Copyright (C) 2022 Huawei Device Co., Ltd. 3ce968135Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4ce968135Sopenharmony_ci * you may not use this file except in compliance with the License. 5ce968135Sopenharmony_ci * You may obtain a copy of the License at 6ce968135Sopenharmony_ci * 7ce968135Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8ce968135Sopenharmony_ci * 9ce968135Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10ce968135Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11ce968135Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12ce968135Sopenharmony_ci * See the License for the specific language governing permissions and 13ce968135Sopenharmony_ci * limitations under the License. 14ce968135Sopenharmony_ci */ 15ce968135Sopenharmony_ci#ifndef WALLPAPER_SERVICES_WALLPAPER_COMMON_EVENT_H 16ce968135Sopenharmony_ci#define WALLPAPER_SERVICES_WALLPAPER_COMMON_EVENT_H 17ce968135Sopenharmony_ci 18ce968135Sopenharmony_ci#include <string> 19ce968135Sopenharmony_ci 20ce968135Sopenharmony_ci#include "common_event_manager.h" 21ce968135Sopenharmony_ci#include "common_event_subscriber.h" 22ce968135Sopenharmony_ci#include "common_event_support.h" 23ce968135Sopenharmony_ci 24ce968135Sopenharmony_cinamespace OHOS { 25ce968135Sopenharmony_cinamespace WallpaperMgrService { 26ce968135Sopenharmony_ciusing CommonEventSubscriber = OHOS::EventFwk::CommonEventSubscriber; 27ce968135Sopenharmony_ciusing CommonEventData = OHOS::EventFwk::CommonEventData; 28ce968135Sopenharmony_ciusing CommonEventSubscribeInfo = OHOS::EventFwk::CommonEventSubscribeInfo; 29ce968135Sopenharmony_ciclass WallpaperService; 30ce968135Sopenharmony_ci 31ce968135Sopenharmony_ciclass WallpaperCommonEventSubscriber : public OHOS::EventFwk::CommonEventSubscriber { 32ce968135Sopenharmony_cipublic: 33ce968135Sopenharmony_ci WallpaperCommonEventSubscriber(WallpaperService &wallpaperService) 34ce968135Sopenharmony_ci : CommonEventSubscriber(CreateSubscriberInfo()), wallpaperService_(wallpaperService) 35ce968135Sopenharmony_ci { 36ce968135Sopenharmony_ci } 37ce968135Sopenharmony_ci ~WallpaperCommonEventSubscriber() = default; 38ce968135Sopenharmony_ci 39ce968135Sopenharmony_ci void OnReceiveEvent(const OHOS::EventFwk::CommonEventData &data) override; 40ce968135Sopenharmony_ci 41ce968135Sopenharmony_ciprivate: 42ce968135Sopenharmony_ci OHOS::EventFwk::CommonEventSubscribeInfo CreateSubscriberInfo(); 43ce968135Sopenharmony_ci 44ce968135Sopenharmony_ci WallpaperService &wallpaperService_; 45ce968135Sopenharmony_ci}; 46ce968135Sopenharmony_ci} // namespace WallpaperMgrService 47ce968135Sopenharmony_ci} // namespace OHOS 48ce968135Sopenharmony_ci 49ce968135Sopenharmony_ci#endif