• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2024 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_UNIFIED_RECORD_FFI_H
17 #define UDMF_UNIFIED_RECORD_FFI_H
18 
19 #include <cstdint>
20 
21 #include "cj_common_ffi.h"
22 #include "ffi_remote_data.h"
23 #include "unified_record_impl.h"
24 
25 namespace OHOS {
26 namespace UDMF {
27 extern "C" {
28 FFI_EXPORT int64_t FfiUDMFUnifiedRecordConstructor();
29 FFI_EXPORT int64_t FfiUDMFUnifiedRecordConstructorwithOnlyType(const char *type);
30 FFI_EXPORT int64_t FfiUDMFUnifiedRecordConstructorwithType(const char *type, CJValueType value);
31 FFI_EXPORT char *FfiUDMFUnifiedRecordGetType(int64_t unifiedId);
32 FFI_EXPORT CJValueType FfiUDMFUnifiedRecordGetValue(int64_t unifiedId);
33 
34 FFI_EXPORT int64_t FfiUDMFFileSetUri(int64_t id, const char *uri);
35 FFI_EXPORT char *FfiUDMFFileGetUri(int64_t id);
36 FFI_EXPORT CRecord FfiUDMFFileGetDetails(int64_t id);
37 FFI_EXPORT int64_t FfiUDMFFileSetDetails(int64_t id, CRecord record);
38 
39 FFI_EXPORT char *FfiUDMFImageGetImageUri(int64_t id);
40 FFI_EXPORT int64_t FfiUDMFImageSetImageUri(int64_t id, const char *uri);
41 
42 FFI_EXPORT char *FfiUDMFVideoGetVideoUri(int64_t id);
43 FFI_EXPORT int64_t FfiUDMFVideoSetVideoUri(int64_t id, const char *uri);
44 
45 FFI_EXPORT CRecord FfiUDMFTextGetDetails(int64_t id);
46 FFI_EXPORT int64_t FfiUDMFTextSetDetails(int64_t id, CRecord record);
47 
48 FFI_EXPORT char *FfiUDMFHyperLinkGetUrl(int64_t id);
49 FFI_EXPORT int64_t FfiUDMFHyperLinkSetUrl(int64_t id, const char *url);
50 
51 FFI_EXPORT char *FfiUDMFHyperLinkGetDescription(int64_t id);
52 FFI_EXPORT int64_t FfiUDMFHyperLinkSetDescription(int64_t id, const char *description);
53 
54 FFI_EXPORT char *FfiUDMFPlainTextGetTextContent(int64_t id);
55 FFI_EXPORT int64_t FfiUDMFPlainTextSetTextContent(int64_t id, const char *text);
56 
57 FFI_EXPORT char *FfiUDMFPlainTextGetAbstract(int64_t id);
58 FFI_EXPORT int64_t FfiUDMFPlainTextSetAbstract(int64_t id, const char *abstr);
59 }
60 } // namespace UDMF
61 } // namespace OHOS
62 
63 #endif