• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021 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 OHOS_IPC_JNI_MESSAGE_OPTION_H
17 #define OHOS_IPC_JNI_MESSAGE_OPTION_H
18 
19 #include <jni.h>
20 #include <memory>
21 #include "message_option.h"
22 
23 namespace OHOS {
24 /*
25  * Get flags field from ohos.rpc.MessageOption.
26  */
27 int JavaOhosRpcMessageOptionGetFlags(JNIEnv *env, jobject object);
28 
29 /*
30  * Set flags to ohos.rpc.MessageOption
31  */
32 void JavaOhosRpcMessageOptionSetFlags(JNIEnv *env, jobject object, int flags);
33 
34 /*
35  * Get wait time field from ohos.rpc.MessageOption.
36  */
37 int JavaOhosRpcMessageOptionGetWaitTime(JNIEnv *env, jobject object);
38 
39 /*
40  * Set wait time to ohos.rpc.MessageOption
41  */
42 void JavaOhosRpcMessageOptionSetWaitTime(JNIEnv *env, jobject object, int waitTime);
43 
44 /*
45  * Create java object for ohos.rpc.MessageOption.
46  */
47 jobject JavaOhosRpcMessageOptionNewJavaObject(JNIEnv *env, int flags, int waitTime);
48 
49 /*
50  * Get and create native instance of ohos.rpc.MessageOption.
51  */
52 MessageOptionPtr JavaOhosRpcMessageOptionGetNative(JNIEnv *env, jobject object);
53 
54 /*
55  * register native methods for ohos.rpc.MessageOption.
56  */
57 int JavaOhosRpcMessageOptionRegisterNativeMethods(JNIEnv *env);
58 } // namespace OHOS
59 #endif // OHOS_IPC_JNI_MESSAGE_OPTION_H