• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 "boomerang_dumper.h"
22 #include "boomerang_server.h"
23 #include "cooperate_server.h"
24 #include "drag_server.h"
25 #include "intention_dumper.h"
26 #include "intention_stub.h"
27 #include "i_context.h"
28 #include "socket_server.h"
29 #include "stationary_server.h"
30 
31 namespace OHOS {
32 namespace Msdp {
33 namespace DeviceStatus {
34 class IntentionService final : public IntentionStub {
35 public:
36     IntentionService(IContext *context);
37     ~IntentionService() = default;
38     DISALLOW_COPY_AND_MOVE(IntentionService);
39 
40     int32_t Dump(int32_t  fd, const std::vector<std::u16string> &args) override;
41 
42 private:
43     int32_t Enable(Intention intention, MessageParcel &data, MessageParcel &reply) override;
44     int32_t Disable(Intention intention, MessageParcel &data, MessageParcel &reply) override;
45     int32_t Start(Intention intention, MessageParcel &data, MessageParcel &reply) override;
46     int32_t Stop(Intention intention, MessageParcel &data, MessageParcel &reply) override;
47     int32_t Control(Intention intention, uint32_t id, MessageParcel &data, MessageParcel &reply) override;
48     int32_t AddWatch(Intention intention, uint32_t id, MessageParcel &data, MessageParcel &reply) override;
49     int32_t RemoveWatch(Intention intention, uint32_t id, MessageParcel &data, MessageParcel &reply) override;
50     int32_t SetParam(Intention intention, uint32_t id, MessageParcel &data, MessageParcel &reply) override;
51     int32_t GetParam(Intention intention, uint32_t id, MessageParcel &data, MessageParcel &reply) override;
52 
53     IPlugin* LoadPlugin(Intention intention);
54 
55 private:
56     IContext *context_ { nullptr };
57     SocketServer socketServer_;
58     StationaryServer stationary_;
59     CooperateServer cooperate_;
60     DragServer drag_;
61     IntentionDumper dumper_;
62     BoomerangServer boomerang_;
63     BoomerangDumper boomerangDumper_;
64 };
65 } // namespace DeviceStatus
66 } // namespace Msdp
67 } // namespace OHOS
68 #endif // INTENTION_SERVICE_H
69