1 /* 2 * Copyright (c) 2023 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 INTENTION_SERVICE_H 17 #define INTENTION_SERVICE_H 18 19 #include "nocopyable.h" 20 21 #include "cooperate_server.h" 22 #include "drag_server.h" 23 #include "intention_stub.h" 24 #include "i_context.h" 25 #include "socket_server.h" 26 #include "stationary_server.h" 27 28 namespace OHOS { 29 namespace Msdp { 30 namespace DeviceStatus { 31 class IntentionService final : public IntentionStub { 32 public: 33 IntentionService(IContext *context); 34 ~IntentionService() = default; 35 DISALLOW_COPY_AND_MOVE(IntentionService); 36 37 private: 38 int32_t Enable(Intention intention, MessageParcel &data, MessageParcel &reply) override; 39 int32_t Disable(Intention intention, MessageParcel &data, MessageParcel &reply) override; 40 int32_t Start(Intention intention, MessageParcel &data, MessageParcel &reply) override; 41 int32_t Stop(Intention intention, MessageParcel &data, MessageParcel &reply) override; 42 int32_t Control(Intention intention, uint32_t id, MessageParcel &data, MessageParcel &reply) override; 43 int32_t AddWatch(Intention intention, uint32_t id, MessageParcel &data, MessageParcel &reply) override; 44 int32_t RemoveWatch(Intention intention, uint32_t id, MessageParcel &data, MessageParcel &reply) override; 45 int32_t SetParam(Intention intention, uint32_t id, MessageParcel &data, MessageParcel &reply) override; 46 int32_t GetParam(Intention intention, uint32_t id, MessageParcel &data, MessageParcel &reply) override; 47 48 IPlugin* LoadPlugin(Intention intention); 49 50 private: 51 IContext *context_ { nullptr }; 52 SocketServer socketServer_; 53 StationaryServer stationary_; 54 CooperateServer cooperate_; 55 DragServer drag_; 56 }; 57 } // namespace DeviceStatus 58 } // namespace Msdp 59 } // namespace OHOS 60 #endif // INTENTION_SERVICE_H 61