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 27 namespace OHOS { 28 namespace Msdp { 29 namespace DeviceStatus { 30 class IntentionService final : public IntentionStub { 31 public: 32 IntentionService(IContext *context); 33 ~IntentionService() = default; 34 DISALLOW_COPY_AND_MOVE(IntentionService); 35 36 private: 37 int32_t Enable(Intention intention, MessageParcel &data, MessageParcel &reply) override; 38 int32_t Disable(Intention intention, MessageParcel &data, MessageParcel &reply) override; 39 int32_t Start(Intention intention, MessageParcel &data, MessageParcel &reply) override; 40 int32_t Stop(Intention intention, MessageParcel &data, MessageParcel &reply) override; 41 int32_t Control(Intention intention, uint32_t id, MessageParcel &data, MessageParcel &reply) override; 42 int32_t AddWatch(Intention intention, uint32_t id, MessageParcel &data, MessageParcel &reply) override; 43 int32_t RemoveWatch(Intention intention, uint32_t id, MessageParcel &data, MessageParcel &reply) override; 44 int32_t SetParam(Intention intention, uint32_t id, MessageParcel &data, MessageParcel &reply) override; 45 int32_t GetParam(Intention intention, uint32_t id, MessageParcel &data, MessageParcel &reply) override; 46 47 IPlugin* LoadPlugin(Intention intention); 48 49 private: 50 IContext *context_ { nullptr }; 51 SocketServer socketServer_; 52 CooperateServer cooperate_; 53 DragServer drag_; 54 }; 55 } // namespace DeviceStatus 56 } // namespace Msdp 57 } // namespace OHOS 58 #endif // INTENTION_SERVICE_H 59