Bug 1909613 - Enable <details name=''> everywhere, r=emilio
[gecko.git] / netwerk / base / nsINetworkInfoService.idl
blob9349abe13f1814e21ffd4c1361b16abc723ec37f
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #include "nsISupports.idl"
7 /**
8 * Listener for getting list of addresses.
9 */
10 [scriptable, uuid(c4bdaac1-3ab1-4fdb-9a16-17cbed794603)]
11 interface nsIListNetworkAddressesListener : nsISupports
13 /**
14 * Callback function that gets called by nsINetworkInfoService.listNetworkAddresses.
15 * Each address in the array is a string IP address in canonical form,
16 * e.g. 192.168.1.10, or an IPV6 address in string form.
18 void onListedNetworkAddresses(in Array<ACString> aAddressArray);
19 void onListNetworkAddressesFailed();
22 /**
23 * Listener for getting hostname.
25 [scriptable, uuid(3ebdcb62-2df4-4042-8864-3fa81abd4693)]
26 interface nsIGetHostnameListener : nsISupports
28 void onGotHostname(in AUTF8String aHostname);
29 void onGetHostnameFailed();
32 /**
33 * Service information
35 [scriptable, uuid(55fc8dae-4a58-4e0f-a49b-901cbabae809)]
36 interface nsINetworkInfoService : nsISupports
38 /**
39 * Obtain a list of local machine network addresses. The listener object's
40 * onListedNetworkAddresses will be called with the obtained addresses.
41 * On failure, the listener object's onListNetworkAddressesFailed() will be called.
43 void listNetworkAddresses(in nsIListNetworkAddressesListener aListener);
45 /**
46 * Obtain the hostname of the local machine. The listener object's
47 * onGotHostname will be called with the obtained hostname.
48 * On failure, the listener object's onGetHostnameFailed() will be called.
50 void getHostname(in nsIGetHostnameListener aListener);
53 %{ C++
54 #define NETWORKINFOSERVICE_CONTRACT_ID \
55 "@mozilla.org/network-info-service;1"