• 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 CJ_WANT_AGENT_UTILS_FFI_H
17 #define CJ_WANT_AGENT_UTILS_FFI_H
18 
19 #include <string>
20 
21 #include "cj_common_ffi.h"
22 #include "want_agent_constant.h"
23 #include "want_agent_helper.h"
24 
25 using WantHandle = void*;
26 
27 namespace OHOS {
28 namespace FfiWantAgent {
29 
30 struct CJWantArr {
31     WantHandle* head;
32     int64_t size;
33 };
34 
35 struct CJWantAgentInfo {
36     CJWantArr wants;
37     int32_t actionType;
38     int32_t requestCode;
39     CArrI32 actionFlags;
40     // Record<string, Object>
41     char* extraInfos;
42 };
43 
44 struct CJTriggerInfo {
45     int32_t code;
46     WantHandle want;
47     bool hasWant;
48     char* permission;
49     // Record<string, Object>
50     char* extraInfos;
51 };
52 
53 struct CJCompleteData {
54     int64_t info;
55     WantHandle want;
56     int32_t finalCode;
57     char* finalData;
58     // Record<string, Object>
59     char* extraInfo;
60 };
61 
62 } // namespace FfiWantAgent
63 } // namespace OHOS
64 #endif // CJ_WANT_AGENT_UTILS_FFI_H
65