1 /*
2  * Copyright (c) 2022 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 UDMF_SERVICE_H
17 #define UDMF_SERVICE_H
18 
19 #include <string>
20 #include <vector>
21 
22 #include "iremote_broker.h"
23 
24 #include "error_code.h"
25 #include "unified_data.h"
26 #include "unified_meta.h"
27 #include "unified_types.h"
28 
29 namespace OHOS {
30 namespace UDMF {
31 /*
32  * UDMF service interface
33  */
34 class UdmfService {
35 public:
36     DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.UDMF.UdmfService");
37     UdmfService() = default;
38     virtual ~UdmfService() = default;
39 
40     virtual int32_t SetData(CustomOption &option, UnifiedData &unifiedData, std::string &key) = 0;
41     virtual int32_t GetData(const QueryOption &query, UnifiedData &unifiedData) = 0;
42     virtual int32_t GetBatchData(const QueryOption &query, std::vector<UnifiedData> &unifiedDataSet) = 0;
43     virtual int32_t UpdateData(const QueryOption &query, UnifiedData &unifiedData) = 0;
44     virtual int32_t DeleteData(const QueryOption &query, std::vector<UnifiedData> &unifiedDataSet) = 0;
45     virtual int32_t GetSummary(const QueryOption &query, Summary &summary) = 0;
46     virtual int32_t AddPrivilege(const QueryOption &query, Privilege &privilege) = 0;
47     virtual int32_t Sync(const QueryOption &query, const std::vector<std::string> &devices) = 0;
48     virtual int32_t IsRemoteData(const QueryOption &query, bool &result) = 0;
49     virtual int32_t SetAppShareOption(const std::string &intention, int32_t shareOption) = 0;
50     virtual int32_t GetAppShareOption(const std::string &intention, int32_t &shareOption) = 0;
51     virtual int32_t RemoveAppShareOption(const std::string &intention) = 0;
52 };
53 } // namespace UDMF
54 } // namespace OHOS
55 #endif // UDMF_SERVICE_H