1 module webkit2.GeolocationPermissionRequest; 2 3 private import gobject.ObjectG; 4 private import webkit2.PermissionRequestIF; 5 private import webkit2.PermissionRequestT; 6 private import webkit2.c.functions; 7 public import webkit2.c.types; 8 9 10 /** 11 * WebKitGeolocationPermissionRequest represents a request for 12 * permission to decide whether WebKit should provide the user's 13 * location to a website when requested through the Geolocation API. 14 * 15 * When a WebKitGeolocationPermissionRequest is not handled by the user, 16 * it is denied by default. 17 * 18 * When embedding web views in your application, you *must* configure an 19 * application identifier to allow web content to use geolocation services. 20 * The identifier *must* match the name of the `.desktop` file which describes 21 * the application, sans the suffix. 22 * 23 * If your application uses #GApplication (or any subclass like 24 * #GtkApplication), WebKit will automatically use the identifier returned by 25 * g_application_get_application_id(). This is the recommended approach for 26 * enabling geolocation in applications. 27 * 28 * If an identifier cannot be obtained through #GApplication, the value 29 * returned by g_get_prgname() will be used instead as a fallback. For 30 * programs which cannot use #GApplication, calling g_set_prgname() early 31 * during initialization is needed when the name of the executable on disk 32 * does not match the name of a valid `.desktop` file. 33 */ 34 public class GeolocationPermissionRequest : ObjectG, PermissionRequestIF 35 { 36 /** the main Gtk struct */ 37 protected WebKitGeolocationPermissionRequest* webKitGeolocationPermissionRequest; 38 39 /** Get the main Gtk struct */ 40 public WebKitGeolocationPermissionRequest* getGeolocationPermissionRequestStruct(bool transferOwnership = false) 41 { 42 if (transferOwnership) 43 ownedRef = false; 44 return webKitGeolocationPermissionRequest; 45 } 46 47 /** the main Gtk struct as a void* */ 48 protected override void* getStruct() 49 { 50 return cast(void*)webKitGeolocationPermissionRequest; 51 } 52 53 /** 54 * Sets our main struct and passes it to the parent class. 55 */ 56 public this (WebKitGeolocationPermissionRequest* webKitGeolocationPermissionRequest, bool ownedRef = false) 57 { 58 this.webKitGeolocationPermissionRequest = webKitGeolocationPermissionRequest; 59 super(cast(GObject*)webKitGeolocationPermissionRequest, ownedRef); 60 } 61 62 // add the PermissionRequest capabilities 63 mixin PermissionRequestT!(WebKitGeolocationPermissionRequest); 64 65 66 /** */ 67 public static GType getType() 68 { 69 return webkit_geolocation_permission_request_get_type(); 70 } 71 }