1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/toolkit/components/captivedetect/nsICaptivePortalDetector.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,53 @@ 1.4 +/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#include "nsISupports.idl" 1.10 + 1.11 +[scriptable, uuid(593fdeec-6284-4de8-b416-8e63cbdc695e)] 1.12 +interface nsICaptivePortalCallback : nsISupports 1.13 +{ 1.14 + /** 1.15 + * Preparation for network interface before captive portal detection started. 1.16 + */ 1.17 + void prepare(); 1.18 + 1.19 + /** 1.20 + * Invoke callbacks after captive portal detection finished. 1.21 + */ 1.22 + void complete(in bool success); 1.23 +}; 1.24 + 1.25 +[scriptable, uuid(2f827c5a-f551-477f-af09-71adbfbd854a)] 1.26 +interface nsICaptivePortalDetector : nsISupports 1.27 +{ 1.28 + /** 1.29 + * Perform captive portal detection on specific network interface. 1.30 + * @param ifname The name of network interface, exception will be thrwon 1.31 + * if the same interface has unfinished request. 1.32 + * @param callback Callbacks when detection procedure starts and finishes. 1.33 + */ 1.34 + void checkCaptivePortal(in wstring ifname, 1.35 + in nsICaptivePortalCallback callback); 1.36 + 1.37 + /** 1.38 + * Abort captive portal detection for specific network interface 1.39 + * due to system failure, callback will not be invoked. 1.40 + * @param ifname The name of network interface. 1.41 + */ 1.42 + void abort(in wstring ifname); 1.43 + 1.44 + /** 1.45 + * Cancel captive portal login procedure by user, callback will be invoked. 1.46 + * @param eventId Login event id provided in |captive-portal-login| event. 1.47 + */ 1.48 + void cancelLogin(in wstring eventId); 1.49 + 1.50 + /** 1.51 + * Notify prepare phase is finished, routing and dns must be ready for sending 1.52 + * out XMLHttpRequest. this is callback for CaptivePortalDetector API user. 1.53 + * @param ifname The name of network interface, must be unique. 1.54 + */ 1.55 + void finishPreparation(in wstring ifname); 1.56 +};