Mercurial > projects > qtd
comparison generator/typesystem_network-java.java @ 39:a5cba313c924
network and webkit are wrapped now
author | eldar |
---|---|
date | Sun, 17 May 2009 01:44:06 +0000 |
parents | e78566595089 |
children |
comparison
equal
deleted
inserted
replaced
38:08631ce8e46a | 39:a5cba313c924 |
---|---|
1 /**************************************************************************** | 1 /**************************************************************************** |
2 ** | 2 ** |
3 ** Copyright (C) 1992-2008 Nokia. All rights reserved. | 3 ** Copyright (C) 1992-2009 Nokia. All rights reserved. |
4 ** | 4 ** |
5 ** This file is part of Qt Jambi. | 5 ** This file is part of Qt Jambi. |
6 ** | 6 ** |
7 ** * Commercial Usage | 7 ** Commercial Usage |
8 * Licensees holding valid Qt Commercial licenses may use this file in | 8 Licensees holding valid Qt Commercial licenses may use this file in |
9 * accordance with the Qt Commercial License Agreement provided with the | 9 accordance with the Qt Commercial License Agreement provided with the |
10 * Software or, alternatively, in accordance with the terms contained in | 10 Software or, alternatively, in accordance with the terms contained in |
11 * a written agreement between you and Nokia. | 11 a written agreement between you and Nokia. |
12 * | 12 |
13 * | 13 GNU Lesser General Public License Usage |
14 * GNU General Public License Usage | 14 Alternatively, this file may be used under the terms of the GNU Lesser |
15 * Alternatively, this file may be used under the terms of the GNU | 15 General Public License version 2.1 as published by the Free Software |
16 * General Public License versions 2.0 or 3.0 as published by the Free | 16 Foundation and appearing in the file LICENSE.LGPL included in the |
17 * Software Foundation and appearing in the file LICENSE.GPL included in | 17 packaging of this file. Please review the following information to |
18 * the packaging of this file. Please review the following information | 18 ensure the GNU Lesser General Public License version 2.1 requirements |
19 * to ensure GNU General Public Licensing requirements will be met: | 19 will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
20 * http://www.fsf.org/licensing/licenses/info/GPLv2.html and | 20 |
21 * http://www.gnu.org/copyleft/gpl.html. In addition, as a special | 21 In addition, as a special exception, Nokia gives you certain |
22 * exception, Nokia gives you certain additional rights. These rights | 22 additional rights. These rights are described in the Nokia Qt LGPL |
23 * are described in the Nokia Qt GPL Exception version 1.2, included in | 23 Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this |
24 * the file GPL_EXCEPTION.txt in this package. | 24 package. |
25 * | 25 |
26 * Qt for Windows(R) Licensees | 26 GNU General Public License Usage |
27 * As a special exception, Nokia, as the sole copyright holder for Qt | 27 Alternatively, this file may be used under the terms of the GNU |
28 * Designer, grants users of the Qt/Eclipse Integration plug-in the | 28 General Public License version 3.0 as published by the Free Software |
29 * right for the Qt/Eclipse Integration to link to functionality | 29 Foundation and appearing in the file LICENSE.GPL included in the |
30 * provided by Qt Designer and its related libraries. | 30 packaging of this file. Please review the following information to |
31 * | 31 ensure the GNU General Public License version 3.0 requirements will be |
32 * | 32 met: http://www.gnu.org/copyleft/gpl.html. |
33 * If you are unsure which license is appropriate for your use, please | 33 |
34 * contact the sales department at qt-sales@nokia.com. | 34 If you are unsure which license is appropriate for your use, please |
35 contact the sales department at qt-sales@nokia.com. | |
35 | 36 |
36 ** | 37 ** |
37 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 38 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
38 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 39 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
39 ** | 40 ** |
40 ****************************************************************************/ | 41 ****************************************************************************/ |
41 | 42 |
42 package generator; | 43 package generator; |
43 | 44 |
44 import qt.*; | 45 import com.trolltech.qt.*; |
45 import qt.network.*; | 46 import com.trolltech.qt.network.*; |
46 | 47 |
47 class QHostInfo___ extends QHostInfo { | 48 class QHostInfo___ extends QHostInfo { |
48 /** | 49 /** |
49 * Looks up the IP address(es) associated with host name <code>name</code>, | 50 * Looks up the IP address(es) associated with host name <code>name</code>, |
50 * and returns an ID for the lookup. When the result of the lookup is ready, | 51 * and returns an ID for the lookup. When the result of the lookup is ready, |
54 * | 55 * |
55 * @param name The host name. | 56 * @param name The host name. |
56 * @param receiver The object on which the method will be called. | 57 * @param receiver The object on which the method will be called. |
57 * @param methodName The name of a method which takes a single <code>QHostInfo</code> argument. | 58 * @param methodName The name of a method which takes a single <code>QHostInfo</code> argument. |
58 */ | 59 */ |
59 public static int lookupHost(String name, qt.core.QObject receiver, String methodName) | 60 public static int lookupHost(String name, com.trolltech.qt.core.QObject receiver, String methodName) |
60 { | 61 { |
61 methodName = qt.internal.QtJambiInternal.SlotPrefix + methodName + "(QHostInfo)"; | 62 methodName = com.trolltech.qt.internal.QtJambiInternal.SlotPrefix + methodName + "(QHostInfo)"; |
62 return lookupHost(name, receiver, qt.QNativePointer.createCharPointer(methodName)); | 63 return lookupHost(name, receiver, com.trolltech.qt.QNativePointer.createCharPointer(methodName)); |
63 } | 64 } |
64 | 65 |
65 /** | 66 /** |
66 * Looks up the IP address(es) associated with host name <code>name</code>, | 67 * Looks up the IP address(es) associated with host name <code>name</code>, |
67 * and returns an ID for the lookup. When the result of the lookup is ready, | 68 * and returns an ID for the lookup. When the result of the lookup is ready, |
72 * @param name The host name. | 73 * @param name The host name. |
73 * @param signal The signal to emit. Must take a single <code>QHostInfo</code> | 74 * @param signal The signal to emit. Must take a single <code>QHostInfo</code> |
74 * argument, and must be contained in a <code>QObject</code> | 75 * argument, and must be contained in a <code>QObject</code> |
75 * subclass. | 76 * subclass. |
76 */ | 77 */ |
77 public static int lookupHost(String name, qt.QSignalEmitter.Signal1<QHostInfo> signal) | 78 public static int lookupHost(String name, com.trolltech.qt.QSignalEmitter.Signal1<QHostInfo> signal) |
78 { | 79 { |
79 if (!(signal.containingObject() instanceof qt.core.QObject)) { | 80 if (!(signal.containingObject() instanceof com.trolltech.qt.core.QObject)) { |
80 throw new IllegalArgumentException("Only signals contained in QObject subclasses are supported. " | 81 throw new IllegalArgumentException("Only signals contained in QObject subclasses are supported. " |
81 + "Signal's class is '" + signal.containingObject().getClass() + "'."); | 82 + "Signal's class is '" + signal.containingObject().getClass() + "'."); |
82 } | 83 } |
83 | 84 |
84 String methodName = qt.internal.QtJambiInternal.SignalPrefix + signal.name() + "(QHostInfo)"; | 85 String methodName = com.trolltech.qt.internal.QtJambiInternal.SignalPrefix + signal.name() + "(QHostInfo)"; |
85 return lookupHost(name, (qt.core.QObject)signal.containingObject(), | 86 return lookupHost(name, (com.trolltech.qt.core.QObject)signal.containingObject(), |
86 qt.QNativePointer.createCharPointer(methodName)); | 87 com.trolltech.qt.QNativePointer.createCharPointer(methodName)); |
87 } | 88 } |
88 }// class | 89 }// class |
89 | 90 |
90 class QAbstractSocket___ extends QAbstractSocket { | 91 class QAbstractSocket___ extends QAbstractSocket { |
91 | 92 |
106 proxyAuthenticationRequired.emit(proxy, QAuthenticator.fromNativePointer(authenticator)); | 107 proxyAuthenticationRequired.emit(proxy, QAuthenticator.fromNativePointer(authenticator)); |
107 inEmission = false; | 108 inEmission = false; |
108 } | 109 } |
109 } | 110 } |
110 | 111 |
111 public final void connectToHost(String host, int port, qt.core.QIODevice.OpenMode mode) { | 112 public final void connectToHost(String host, int port, com.trolltech.qt.core.QIODevice.OpenMode mode) { |
112 connectToHost(host, (char) port, mode); | 113 connectToHost(host, (char) port, mode); |
113 } | 114 } |
114 | 115 |
115 public final void connectToHost(String host, int port, qt.core.QIODevice.OpenModeFlag ... mode) { | 116 public final void connectToHost(String host, int port, com.trolltech.qt.core.QIODevice.OpenModeFlag ... mode) { |
116 connectToHost(host, (char) port, mode); | 117 connectToHost(host, (char) port, mode); |
117 } | 118 } |
118 | 119 |
119 public final void connectToHost(String host, int port) { | 120 public final void connectToHost(String host, int port) { |
120 connectToHost(host, (char) port); | 121 connectToHost(host, (char) port); |
121 } | 122 } |
122 | 123 |
123 public final void connectToHost(QHostAddress host, int port, qt.core.QIODevice.OpenMode mode) { | 124 public final void connectToHost(QHostAddress host, int port, com.trolltech.qt.core.QIODevice.OpenMode mode) { |
124 connectToHost(host, (char) port, mode); | 125 connectToHost(host, (char) port, mode); |
125 } | 126 } |
126 | 127 |
127 public final void connectToHost(QHostAddress host, int port, qt.core.QIODevice.OpenModeFlag ... mode) { | 128 public final void connectToHost(QHostAddress host, int port, com.trolltech.qt.core.QIODevice.OpenModeFlag ... mode) { |
128 connectToHost(host, (char) port, mode); | 129 connectToHost(host, (char) port, mode); |
129 } | 130 } |
130 | 131 |
131 public final void connectToHost(QHostAddress host, int port) | 132 public final void connectToHost(QHostAddress host, int port) |
132 { | 133 { |
133 connectToHost(host, (char) port); | 134 connectToHost(host, (char) port); |
134 } | 135 } |
135 | 136 |
136 protected void connectToHostImplementation(String host, int port, qt.core.QIODevice.OpenMode mode) { | 137 protected void connectToHostImplementation(String host, int port, com.trolltech.qt.core.QIODevice.OpenMode mode) { |
137 connectToHostImplementation(host, (char) port, mode); | 138 connectToHostImplementation(host, (char) port, mode); |
138 } | 139 } |
139 | 140 |
140 protected void connectToHostImplementation(String host, int port, qt.core.QIODevice.OpenModeFlag ... mode) { | 141 protected void connectToHostImplementation(String host, int port, com.trolltech.qt.core.QIODevice.OpenModeFlag ... mode) { |
141 connectToHostImplementation(host, (char) port, mode); | 142 connectToHostImplementation(host, (char) port, mode); |
142 } | 143 } |
143 | 144 |
144 protected void connectToHostImplementation(String host, int port) { | 145 protected void connectToHostImplementation(String host, int port) { |
145 connectToHostImplementation(host, (char) port); | 146 connectToHostImplementation(host, (char) port); |
164 | 165 |
165 }// class | 166 }// class |
166 | 167 |
167 class QSslSocket___ extends QSslSocket { | 168 class QSslSocket___ extends QSslSocket { |
168 | 169 |
169 protected void connectToHostImplementation(String host, int port, qt.core.QIODevice.OpenMode mode) { | 170 protected void connectToHostImplementation(String host, int port, com.trolltech.qt.core.QIODevice.OpenMode mode) { |
170 connectToHostImplementation(host, (char) port, mode); | 171 connectToHostImplementation(host, (char) port, mode); |
171 } | 172 } |
172 | 173 |
173 protected void connectToHostImplementation(String host, int port, qt.core.QIODevice.OpenModeFlag ... mode) { | 174 protected void connectToHostImplementation(String host, int port, com.trolltech.qt.core.QIODevice.OpenModeFlag ... mode) { |
174 connectToHostImplementation(host, (char) port, mode); | 175 connectToHostImplementation(host, (char) port, mode); |
175 } | 176 } |
176 | 177 |
177 protected void connectToHostImplementation(String host, int port) { | 178 protected void connectToHostImplementation(String host, int port) { |
178 connectToHostImplementation(host, (char) port); | 179 connectToHostImplementation(host, (char) port); |
225 | 226 |
226 public QHttp(String hostname, int port) { | 227 public QHttp(String hostname, int port) { |
227 this(hostname, (char) port); | 228 this(hostname, (char) port); |
228 } | 229 } |
229 | 230 |
230 public QHttp(String hostname, int port, qt.core.QObject parent) { | 231 public QHttp(String hostname, int port, com.trolltech.qt.core.QObject parent) { |
231 this(hostname, (char) port, parent); | 232 this(hostname, (char) port, parent); |
232 } | 233 } |
233 | 234 |
234 public QHttp(java.lang.String hostname, qt.network.QHttp.ConnectionMode mode) { | 235 public QHttp(java.lang.String hostname, com.trolltech.qt.network.QHttp.ConnectionMode mode) { |
235 this(hostname, mode, '\0'); | 236 this(hostname, mode, '\0'); |
236 } | 237 } |
237 | 238 |
238 public QHttp(String hostname, QHttp.ConnectionMode mode, int port) { | 239 public QHttp(String hostname, QHttp.ConnectionMode mode, int port) { |
239 this(hostname, mode, (char) port); | 240 this(hostname, mode, (char) port); |
240 } | 241 } |
241 | 242 |
242 public QHttp(String hostname, QHttp.ConnectionMode mode, int port, qt.core.QObject parent) { | 243 public QHttp(String hostname, QHttp.ConnectionMode mode, int port, com.trolltech.qt.core.QObject parent) { |
243 this(hostname, mode, (char) port, parent); | 244 this(hostname, mode, (char) port, parent); |
244 } | 245 } |
245 | 246 |
246 public final int setHost(String hostName, QHttp.ConnectionMode mode) { | 247 public final int setHost(String hostName, QHttp.ConnectionMode mode) { |
247 return setHost(hostName, mode, '\0'); | 248 return setHost(hostName, mode, '\0'); |
270 public final boolean listen(QHostAddress address) { | 271 public final boolean listen(QHostAddress address) { |
271 return listen(address, '\0'); | 272 return listen(address, '\0'); |
272 } | 273 } |
273 | 274 |
274 public final boolean listen() { | 275 public final boolean listen() { |
275 return listen(new qt.network.QHostAddress(qt.network.QHostAddress.SpecialAddress.Any)); | 276 return listen(new com.trolltech.qt.network.QHostAddress(com.trolltech.qt.network.QHostAddress.SpecialAddress.Any)); |
276 } | 277 } |
277 | 278 |
278 public final int serverPort() { | 279 public final int serverPort() { |
279 return serverPort_private(); | 280 return serverPort_private(); |
280 } | 281 } |
353 public final int readDatagram(byte data[]) { | 354 public final int readDatagram(byte data[]) { |
354 return readDatagram(data, null); | 355 return readDatagram(data, null); |
355 } | 356 } |
356 | 357 |
357 public final int writeDatagram(byte data[], QHostAddress address, int port) { | 358 public final int writeDatagram(byte data[], QHostAddress address, int port) { |
358 QNativePointer np = qt.internal.QtJambiInternal.byteArrayToNativePointer(data); | 359 QNativePointer np = com.trolltech.qt.internal.QtJambiInternal.byteArrayToNativePointer(data); |
359 return (int) writeDatagram(np, data.length, address, (char) port); | 360 return (int) writeDatagram(np, data.length, address, (char) port); |
360 } | 361 } |
361 | 362 |
362 public final int writeDatagram(qt.core.QByteArray data, QHostAddress address, int port) { | 363 public final int writeDatagram(com.trolltech.qt.core.QByteArray data, QHostAddress address, int port) { |
363 return (int) writeDatagram(data, address, (char) port); | 364 return (int) writeDatagram(data, address, (char) port); |
364 } | 365 } |
365 | 366 |
366 }// class | 367 }// class |
367 | 368 |