1 /* 2 * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. Oracle designates this 8 * particular file as subject to the "Classpath" exception as provided 9 * by Oracle in the LICENSE file that accompanied this code. 10 * 11 * This code is distributed in the hope that it will be useful, but WITHOUT 12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 * version 2 for more details (a copy is included in the LICENSE file that 15 * accompanied this code). 16 * 17 * You should have received a copy of the GNU General Public License version 18 * 2 along with this work; if not, write to the Free Software Foundation, 19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 20 * 21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 22 * or visit www.oracle.com if you need additional information or have any 23 * questions. 24 */ 25 26 #undef IMPL 27 28 #include "config.h" 29 30 #include <WebCore/HTMLNames.h> 31 #include <WebCore/HTMLTableCellElement.h> 32 #include <WebCore/JSMainThreadExecState.h> 33 34 #include <wtf/RefPtr.h> 35 #include <wtf/GetPtr.h> 36 37 #include "JavaDOMUtils.h" 38 #include <wtf/java/JavaEnv.h> 39 40 using namespace WebCore; 41 42 extern "C" { 43 44 #define IMPL (static_cast<HTMLTableCellElement*>(jlong_to_ptr(peer))) 45 46 47 // Attributes 48 JNIEXPORT jint JNICALL Java_com_sun_webkit_dom_HTMLTableCellElementImpl_getCellIndexImpl(JNIEnv*, jclass, jlong peer) 49 { 50 WebCore::JSMainThreadNullState state; 51 return IMPL->cellIndex(); 52 } 53 54 JNIEXPORT jstring JNICALL Java_com_sun_webkit_dom_HTMLTableCellElementImpl_getAlignImpl(JNIEnv* env, jclass, jlong peer) 55 { 56 WebCore::JSMainThreadNullState state; 57 return JavaReturn<String>(env, IMPL->getAttribute(WebCore::HTMLNames::alignAttr)); 58 } 59 60 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_HTMLTableCellElementImpl_setAlignImpl(JNIEnv* env, jclass, jlong peer, jstring value) 61 { 62 WebCore::JSMainThreadNullState state; 63 IMPL->setAttributeWithoutSynchronization(WebCore::HTMLNames::alignAttr, String(env, value)); 64 } 65 66 JNIEXPORT jstring JNICALL Java_com_sun_webkit_dom_HTMLTableCellElementImpl_getAxisImpl(JNIEnv* env, jclass, jlong peer) 67 { 68 WebCore::JSMainThreadNullState state; 69 return JavaReturn<String>(env, IMPL->getAttribute(WebCore::HTMLNames::axisAttr)); 70 } 71 72 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_HTMLTableCellElementImpl_setAxisImpl(JNIEnv* env, jclass, jlong peer, jstring value) 73 { 74 WebCore::JSMainThreadNullState state; 75 IMPL->setAttributeWithoutSynchronization(WebCore::HTMLNames::axisAttr, String(env, value)); 76 } 77 78 JNIEXPORT jstring JNICALL Java_com_sun_webkit_dom_HTMLTableCellElementImpl_getBgColorImpl(JNIEnv* env, jclass, jlong peer) 79 { 80 WebCore::JSMainThreadNullState state; 81 return JavaReturn<String>(env, IMPL->getAttribute(WebCore::HTMLNames::bgcolorAttr)); 82 } 83 84 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_HTMLTableCellElementImpl_setBgColorImpl(JNIEnv* env, jclass, jlong peer, jstring value) 85 { 86 WebCore::JSMainThreadNullState state; 87 IMPL->setAttributeWithoutSynchronization(WebCore::HTMLNames::bgcolorAttr, String(env, value)); 88 } 89 90 JNIEXPORT jstring JNICALL Java_com_sun_webkit_dom_HTMLTableCellElementImpl_getChImpl(JNIEnv* env, jclass, jlong peer) 91 { 92 WebCore::JSMainThreadNullState state; 93 return JavaReturn<String>(env, IMPL->getAttribute(WebCore::HTMLNames::charAttr)); 94 } 95 96 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_HTMLTableCellElementImpl_setChImpl(JNIEnv* env, jclass, jlong peer, jstring value) 97 { 98 WebCore::JSMainThreadNullState state; 99 IMPL->setAttributeWithoutSynchronization(WebCore::HTMLNames::charAttr, String(env, value)); 100 } 101 102 JNIEXPORT jstring JNICALL Java_com_sun_webkit_dom_HTMLTableCellElementImpl_getChOffImpl(JNIEnv* env, jclass, jlong peer) 103 { 104 WebCore::JSMainThreadNullState state; 105 return JavaReturn<String>(env, IMPL->getAttribute(WebCore::HTMLNames::charoffAttr)); 106 } 107 108 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_HTMLTableCellElementImpl_setChOffImpl(JNIEnv* env, jclass, jlong peer, jstring value) 109 { 110 WebCore::JSMainThreadNullState state; 111 IMPL->setAttributeWithoutSynchronization(WebCore::HTMLNames::charoffAttr, String(env, value)); 112 } 113 114 JNIEXPORT jint JNICALL Java_com_sun_webkit_dom_HTMLTableCellElementImpl_getColSpanImpl(JNIEnv*, jclass, jlong peer) 115 { 116 WebCore::JSMainThreadNullState state; 117 return IMPL->colSpan(); 118 } 119 120 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_HTMLTableCellElementImpl_setColSpanImpl(JNIEnv*, jclass, jlong peer, jint value) 121 { 122 WebCore::JSMainThreadNullState state; 123 IMPL->setColSpan(value); 124 } 125 126 JNIEXPORT jint JNICALL Java_com_sun_webkit_dom_HTMLTableCellElementImpl_getRowSpanImpl(JNIEnv*, jclass, jlong peer) 127 { 128 WebCore::JSMainThreadNullState state; 129 return IMPL->rowSpanForBindings(); 130 } 131 132 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_HTMLTableCellElementImpl_setRowSpanImpl(JNIEnv*, jclass, jlong peer, jint value) 133 { 134 WebCore::JSMainThreadNullState state; 135 IMPL->setRowSpanForBindings(value); 136 } 137 138 JNIEXPORT jstring JNICALL Java_com_sun_webkit_dom_HTMLTableCellElementImpl_getHeadersImpl(JNIEnv* env, jclass, jlong peer) 139 { 140 WebCore::JSMainThreadNullState state; 141 return JavaReturn<String>(env, IMPL->getAttribute(WebCore::HTMLNames::headersAttr)); 142 } 143 144 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_HTMLTableCellElementImpl_setHeadersImpl(JNIEnv* env, jclass, jlong peer, jstring value) 145 { 146 WebCore::JSMainThreadNullState state; 147 IMPL->setAttributeWithoutSynchronization(WebCore::HTMLNames::headersAttr, String(env, value)); 148 } 149 150 JNIEXPORT jstring JNICALL Java_com_sun_webkit_dom_HTMLTableCellElementImpl_getHeightImpl(JNIEnv* env, jclass, jlong peer) 151 { 152 WebCore::JSMainThreadNullState state; 153 return JavaReturn<String>(env, IMPL->getAttribute(WebCore::HTMLNames::heightAttr)); 154 } 155 156 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_HTMLTableCellElementImpl_setHeightImpl(JNIEnv* env, jclass, jlong peer, jstring value) 157 { 158 WebCore::JSMainThreadNullState state; 159 IMPL->setAttributeWithoutSynchronization(WebCore::HTMLNames::heightAttr, String(env, value)); 160 } 161 162 JNIEXPORT jboolean JNICALL Java_com_sun_webkit_dom_HTMLTableCellElementImpl_getNoWrapImpl(JNIEnv*, jclass, jlong peer) 163 { 164 WebCore::JSMainThreadNullState state; 165 return IMPL->hasAttribute(WebCore::HTMLNames::nowrapAttr); 166 } 167 168 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_HTMLTableCellElementImpl_setNoWrapImpl(JNIEnv*, jclass, jlong peer, jboolean value) 169 { 170 WebCore::JSMainThreadNullState state; 171 IMPL->setBooleanAttribute(WebCore::HTMLNames::nowrapAttr, value); 172 } 173 174 JNIEXPORT jstring JNICALL Java_com_sun_webkit_dom_HTMLTableCellElementImpl_getVAlignImpl(JNIEnv* env, jclass, jlong peer) 175 { 176 WebCore::JSMainThreadNullState state; 177 return JavaReturn<String>(env, IMPL->getAttribute(WebCore::HTMLNames::valignAttr)); 178 } 179 180 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_HTMLTableCellElementImpl_setVAlignImpl(JNIEnv* env, jclass, jlong peer, jstring value) 181 { 182 WebCore::JSMainThreadNullState state; 183 IMPL->setAttributeWithoutSynchronization(WebCore::HTMLNames::valignAttr, String(env, value)); 184 } 185 186 JNIEXPORT jstring JNICALL Java_com_sun_webkit_dom_HTMLTableCellElementImpl_getWidthImpl(JNIEnv* env, jclass, jlong peer) 187 { 188 WebCore::JSMainThreadNullState state; 189 return JavaReturn<String>(env, IMPL->getAttribute(WebCore::HTMLNames::widthAttr)); 190 } 191 192 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_HTMLTableCellElementImpl_setWidthImpl(JNIEnv* env, jclass, jlong peer, jstring value) 193 { 194 WebCore::JSMainThreadNullState state; 195 IMPL->setAttributeWithoutSynchronization(WebCore::HTMLNames::widthAttr, String(env, value)); 196 } 197 198 JNIEXPORT jstring JNICALL Java_com_sun_webkit_dom_HTMLTableCellElementImpl_getAbbrImpl(JNIEnv* env, jclass, jlong peer) 199 { 200 WebCore::JSMainThreadNullState state; 201 return JavaReturn<String>(env, IMPL->getAttribute(WebCore::HTMLNames::abbrAttr)); 202 } 203 204 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_HTMLTableCellElementImpl_setAbbrImpl(JNIEnv* env, jclass, jlong peer, jstring value) 205 { 206 WebCore::JSMainThreadNullState state; 207 IMPL->setAttributeWithoutSynchronization(WebCore::HTMLNames::abbrAttr, String(env, value)); 208 } 209 210 JNIEXPORT jstring JNICALL Java_com_sun_webkit_dom_HTMLTableCellElementImpl_getScopeImpl(JNIEnv* env, jclass, jlong peer) 211 { 212 WebCore::JSMainThreadNullState state; 213 return JavaReturn<String>(env, IMPL->getAttribute(WebCore::HTMLNames::scopeAttr)); 214 } 215 216 JNIEXPORT void JNICALL Java_com_sun_webkit_dom_HTMLTableCellElementImpl_setScopeImpl(JNIEnv* env, jclass, jlong peer, jstring value) 217 { 218 WebCore::JSMainThreadNullState state; 219 IMPL->setAttributeWithoutSynchronization(WebCore::HTMLNames::scopeAttr, String(env, value)); 220 } 221 222 }