All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.badlogic.gdx.backends.iosrobovm.IOSNet Maven / Gradle / Ivy

/*DO NOT EDIT THIS FILE - it is machine generated*/

package com.badlogic.gdx.backends.iosrobovm;

import org.robovm.apple.foundation.NSURL;
import org.robovm.apple.uikit.UIApplication;
import com.badlogic.gdx.Net;
import com.badlogic.gdx.net.NetJavaImpl;
import com.badlogic.gdx.net.NetJavaServerSocketImpl;
import com.badlogic.gdx.net.NetJavaSocketImpl;
import com.badlogic.gdx.net.ServerSocket;
import com.badlogic.gdx.net.ServerSocketHints;
import com.badlogic.gdx.net.Socket;
import com.badlogic.gdx.net.SocketHints;
import org.robovm.apple.uikit.UIApplicationOpenURLOptions;

/** DO NOT EDIT THIS FILE - it is machine generated */
public class IOSNet implements Net {

	NetJavaImpl netJavaImpl;

	final UIApplication uiApp;

	public IOSNet (IOSApplication app, IOSApplicationConfiguration configuration) {
		uiApp = app.uiApp;
		netJavaImpl = new NetJavaImpl(configuration.maxNetThreads);
	}

	@Override
	public void sendHttpRequest (HttpRequest httpRequest, HttpResponseListener httpResponseListener) {
		netJavaImpl.sendHttpRequest(httpRequest, httpResponseListener);
	}

	@Override
	public void cancelHttpRequest (HttpRequest httpRequest) {
		netJavaImpl.cancelHttpRequest(httpRequest);
	}

	@Override
	public boolean isHttpRequestPending (HttpRequest httpRequest) {
		return netJavaImpl.isHttpRequestPending(httpRequest);
	}

	@Override
	public ServerSocket newServerSocket (Protocol protocol, String hostname, int port, ServerSocketHints hints) {
		return new NetJavaServerSocketImpl(protocol, hostname, port, hints);
	}

	@Override
	public ServerSocket newServerSocket (Protocol protocol, int port, ServerSocketHints hints) {
		return new NetJavaServerSocketImpl(protocol, port, hints);
	}

	@Override
	public Socket newClientSocket (Protocol protocol, String host, int port, SocketHints hints) {
		return new NetJavaSocketImpl(protocol, host, port, hints);
	}

	@Override
	public boolean openURI (String URI) {
		NSURL url = new NSURL(URI);
		if (uiApp.canOpenURL(url)) {
			uiApp.openURL(url, new UIApplicationOpenURLOptions(), null);
			return true;
		}
		return false;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy