michael@0: /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: [scriptable, uuid(593fdeec-6284-4de8-b416-8e63cbdc695e)] michael@0: interface nsICaptivePortalCallback : nsISupports michael@0: { michael@0: /** michael@0: * Preparation for network interface before captive portal detection started. michael@0: */ michael@0: void prepare(); michael@0: michael@0: /** michael@0: * Invoke callbacks after captive portal detection finished. michael@0: */ michael@0: void complete(in bool success); michael@0: }; michael@0: michael@0: [scriptable, uuid(2f827c5a-f551-477f-af09-71adbfbd854a)] michael@0: interface nsICaptivePortalDetector : nsISupports michael@0: { michael@0: /** michael@0: * Perform captive portal detection on specific network interface. michael@0: * @param ifname The name of network interface, exception will be thrwon michael@0: * if the same interface has unfinished request. michael@0: * @param callback Callbacks when detection procedure starts and finishes. michael@0: */ michael@0: void checkCaptivePortal(in wstring ifname, michael@0: in nsICaptivePortalCallback callback); michael@0: michael@0: /** michael@0: * Abort captive portal detection for specific network interface michael@0: * due to system failure, callback will not be invoked. michael@0: * @param ifname The name of network interface. michael@0: */ michael@0: void abort(in wstring ifname); michael@0: michael@0: /** michael@0: * Cancel captive portal login procedure by user, callback will be invoked. michael@0: * @param eventId Login event id provided in |captive-portal-login| event. michael@0: */ michael@0: void cancelLogin(in wstring eventId); michael@0: michael@0: /** michael@0: * Notify prepare phase is finished, routing and dns must be ready for sending michael@0: * out XMLHttpRequest. this is callback for CaptivePortalDetector API user. michael@0: * @param ifname The name of network interface, must be unique. michael@0: */ michael@0: void finishPreparation(in wstring ifname); michael@0: };