1 /* 2 * Copyright (c) 2023 Shenzhen Kaihong Digital Industry Development 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 OHOS_SHARING_SCHEDULER_H 17 #define OHOS_SHARING_SCHEDULER_H 18 19 #include "event/event_base.h" 20 #include "event/handle_event_base.h" 21 #include "singleton.h" 22 23 namespace OHOS { 24 namespace Sharing { 25 26 class SchedulerEventListener : public EventListener { 27 public: SchedulerEventListener()28 SchedulerEventListener() 29 { 30 classType_ = CLASS_TYPE_SCHEDULER; 31 } 32 33 virtual ~SchedulerEventListener() = default; 34 35 int32_t OnEvent(SharingEvent &event) final; 36 }; 37 38 class Scheduler : public Singleton<Scheduler>, 39 public HandleEventBase, 40 public EventEmitter { 41 friend class Singleton<Scheduler>; 42 43 public: 44 virtual ~Scheduler() = default; 45 46 int32_t HandleEvent(SharingEvent &event) final; 47 48 protected: 49 Scheduler(); 50 }; 51 52 } // namespace Sharing 53 } // namespace OHOS 54 #endif