forked from chromiumembedded/java-cef
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCefPostData_N.java
More file actions
116 lines (100 loc) · 3.04 KB
/
CefPostData_N.java
File metadata and controls
116 lines (100 loc) · 3.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
// Copyright (c) 2014 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
package org.cef.network;
import org.cef.callback.CefNative;
import java.util.Vector;
/**
*
*/
class CefPostData_N extends CefPostData implements CefNative {
// Used internally to store a pointer to the CEF object.
private long N_CefHandle = 0;
@Override
public void setNativeRef(String identifer, long nativeRef) {
N_CefHandle = nativeRef;
}
@Override
public long getNativeRef(String identifer) {
return N_CefHandle;
}
CefPostData_N() {
super();
}
public static CefPostData createNative() {
try {
return CefPostData_N.N_Create();
} catch (UnsatisfiedLinkError ule) {
ule.printStackTrace();
return null;
}
}
@Override
public void dispose() {
try {
N_Dispose(N_CefHandle);
} catch (UnsatisfiedLinkError ule) {
ule.printStackTrace();
}
}
@Override
public boolean isReadOnly() {
try {
return N_IsReadOnly(N_CefHandle);
} catch (UnsatisfiedLinkError ule) {
ule.printStackTrace();
}
return false;
}
@Override
public int getElementCount() {
try {
return N_GetElementCount(N_CefHandle);
} catch (UnsatisfiedLinkError ule) {
ule.printStackTrace();
}
return 0;
}
@Override
public void getElements(Vector<CefPostDataElement> elements) {
try {
N_GetElements(N_CefHandle, elements);
} catch (UnsatisfiedLinkError ule) {
ule.printStackTrace();
}
}
@Override
public boolean removeElement(CefPostDataElement element) {
try {
return N_RemoveElement(N_CefHandle, element);
} catch (UnsatisfiedLinkError ule) {
ule.printStackTrace();
}
return false;
}
@Override
public boolean addElement(CefPostDataElement element) {
try {
return N_AddElement(N_CefHandle, element);
} catch (UnsatisfiedLinkError ule) {
ule.printStackTrace();
}
return false;
}
@Override
public void removeElements() {
try {
N_RemoveElements(N_CefHandle);
} catch (UnsatisfiedLinkError ule) {
ule.printStackTrace();
}
}
private final native static CefPostData_N N_Create();
private final native void N_Dispose(long self);
private final native boolean N_IsReadOnly(long self);
private final native int N_GetElementCount(long self);
private final native void N_GetElements(long self, Vector<CefPostDataElement> elements);
private final native boolean N_RemoveElement(long self, CefPostDataElement element);
private final native boolean N_AddElement(long self, CefPostDataElement element);
private final native void N_RemoveElements(long self);
}