// Path: x-gwt-essential/src/main/java/com/github/spirylics/xgwt/essential/Promise.java
// @SuppressWarnings("ALL")
// @JsType(isNative = true, namespace = JsPackage.GLOBAL)
// public class Promise<S, E> extends Thenable<S, E> {
// 
//     @JsConstructor
//     public Promise(Fn.Resolver<S, E> resolver) {
//     }
// 
//     public static native <A, B> Promise<A, B> all(Promise<?, ?>[] promises);
// 
//     public static native <S> Promise<S, Error> resolve(S success);
// 
//     private Fn.Arg<S> resolve;
//     private Fn.Arg<E> reject;
// 
//     @JsOverlay
//     public final Promise<S, E> openResolve(S success) {
//         if (resolve == null) {
//             throw new UnsupportedOperationException("promise is not open, use buildOpenPromise");
//         }
//         resolve.e(success);
//         return this;
//     }
// 
//     @JsOverlay
//     public final Promise<S, E> openReject(E error) {
//         if (reject == null) {
//             throw new UnsupportedOperationException("promise is not open, use buildOpenPromise");
//         }
//         reject.e(error);
//         return this;
//     }
// 
//     @JsOverlay
//     public static <S, E> Promise<S, E> buildOpenPromise() {
//         final Map<String, Fn.Arg<?>> containers = new HashMap<>(2);
//         Fn.Resolver<S, E> resolver = new Fn.Resolver<S, E>() {
//             @Override
//             public void e(Fn.Arg<S> resolve, Fn.Arg<E> reject) {
//                 containers.put("resolve", resolve);
//                 containers.put("reject", reject);
//             }
//         };
//         Promise<S, E> openPromise = new Promise<S, E>(resolver);
//         openPromise.resolve = (Fn.Arg<S>) containers.get("resolve");
//         openPromise.reject = (Fn.Arg<E>) containers.get("reject");
//         return openPromise;
//     }
// }


import com.github.spirylics.xgwt.essential.Promise;
import com.google.gwt.core.client.GWT;
import com.google.gwt.query.client.js.JsUtils;
import com.google.gwt.user.client.Window;
import com.googlecode.gwtphonegap.client.*;
import com.googlecode.gwtphonegap.client.device.Device;
import com.googlecode.gwtphonegap.client.geolocation.GeolocationCallback;
import com.googlecode.gwtphonegap.client.geolocation.GeolocationOptions;
package com.github.spirylics.xgwt.cordova;


public class XCordova {
    final PhoneGap phoneGap;
    final GeolocationOptions geolocationOptions;
    GeolocationCancelableCallback singleGeolocationCallback;
    boolean networkIndicationShow;

    public XCordova() {
        this(GWT.create(PhoneGap.class));
    }

    public XCordova(PhoneGap phoneGap) {
        this.phoneGap = phoneGap;
        this.geolocationOptions = new GeolocationOptions();
        this.geolocationOptions.setTimeout(5000);
        this.geolocationOptions.setEnableHighAccuracy(true);
        this.geolocationOptions.setMaximumAge(60000);
    }

// Path: x-gwt-essential/src/main/java/com/github/spirylics/xgwt/essential/Promise.java
// @SuppressWarnings("ALL")
// @JsType(isNative = true, namespace = JsPackage.GLOBAL)
// public class Promise<S, E> extends Thenable<S, E> {
// 
//     @JsConstructor
//     public Promise(Fn.Resolver<S, E> resolver) {
//     }
// 
//     public static native <A, B> Promise<A, B> all(Promise<?, ?>[] promises);
// 
//     public static native <S> Promise<S, Error> resolve(S success);
// 
//     private Fn.Arg<S> resolve;
//     private Fn.Arg<E> reject;
// 
//     @JsOverlay
//     public final Promise<S, E> openResolve(S success) {
//         if (resolve == null) {
//             throw new UnsupportedOperationException("promise is not open, use buildOpenPromise");
//         }
//         resolve.e(success);
//         return this;
//     }
// 
//     @JsOverlay
//     public final Promise<S, E> openReject(E error) {
//         if (reject == null) {
//             throw new UnsupportedOperationException("promise is not open, use buildOpenPromise");
//         }
//         reject.e(error);
//         return this;
//     }
// 
//     @JsOverlay
//     public static <S, E> Promise<S, E> buildOpenPromise() {
//         final Map<String, Fn.Arg<?>> containers = new HashMap<>(2);
//         Fn.Resolver<S, E> resolver = new Fn.Resolver<S, E>() {
//             @Override
//             public void e(Fn.Arg<S> resolve, Fn.Arg<E> reject) {
//                 containers.put("resolve", resolve);
//                 containers.put("reject", reject);
//             }
//         };
//         Promise<S, E> openPromise = new Promise<S, E>(resolver);
//         openPromise.resolve = (Fn.Arg<S>) containers.get("resolve");
//         openPromise.reject = (Fn.Arg<E>) containers.get("reject");
//         return openPromise;
//     }
// }


// Path: x-gwt-cordova/src/main/java/com/github/spirylics/xgwt/cordova/XCordova.java
import com.github.spirylics.xgwt.essential.Promise;
import com.google.gwt.core.client.GWT;
import com.google.gwt.query.client.js.JsUtils;
import com.google.gwt.user.client.Window;
import com.googlecode.gwtphonegap.client.*;
import com.googlecode.gwtphonegap.client.device.Device;
import com.googlecode.gwtphonegap.client.geolocation.GeolocationCallback;
import com.googlecode.gwtphonegap.client.geolocation.GeolocationOptions;

package com.github.spirylics.xgwt.cordova;


public class XCordova {
    final PhoneGap phoneGap;
    final GeolocationOptions geolocationOptions;
    GeolocationCancelableCallback singleGeolocationCallback;
    boolean networkIndicationShow;

    public XCordova() {
        this(GWT.create(PhoneGap.class));
    }

    public XCordova(PhoneGap phoneGap) {
        this.phoneGap = phoneGap;
        this.geolocationOptions = new GeolocationOptions();
        this.geolocationOptions.setTimeout(5000);
        this.geolocationOptions.setEnableHighAccuracy(true);
        this.geolocationOptions.setMaximumAge(60000);
    }

    public XCordova initialize(final Promise<Void, Object> promise) {