Line data Source code
1 : /*
2 : * DO NOT EDIT. THIS FILE IS GENERATED FROM ../../../dist/idl/nsINetworkLinkService.idl
3 : */
4 :
5 : #ifndef __gen_nsINetworkLinkService_h__
6 : #define __gen_nsINetworkLinkService_h__
7 :
8 :
9 : #ifndef __gen_nsISupports_h__
10 : #include "nsISupports.h"
11 : #endif
12 :
13 : /* For IDL files that don't want to include root IDL files. */
14 : #ifndef NS_NO_VTABLE
15 : #define NS_NO_VTABLE
16 : #endif
17 :
18 : /* starting interface: nsINetworkLinkService */
19 : #define NS_INETWORKLINKSERVICE_IID_STR "103e5293-77b3-4b70-af59-6e9e4a1f994a"
20 :
21 : #define NS_INETWORKLINKSERVICE_IID \
22 : {0x103e5293, 0x77b3, 0x4b70, \
23 : { 0xaf, 0x59, 0x6e, 0x9e, 0x4a, 0x1f, 0x99, 0x4a }}
24 :
25 1 : class NS_NO_VTABLE nsINetworkLinkService : public nsISupports {
26 : public:
27 :
28 : NS_DECLARE_STATIC_IID_ACCESSOR(NS_INETWORKLINKSERVICE_IID)
29 :
30 : enum {
31 : LINK_TYPE_UNKNOWN = 0U,
32 : LINK_TYPE_ETHERNET = 1U,
33 : LINK_TYPE_USB = 2U,
34 : LINK_TYPE_WIFI = 3U,
35 : LINK_TYPE_WIMAX = 4U,
36 : LINK_TYPE_2G = 5U,
37 : LINK_TYPE_3G = 6U,
38 : LINK_TYPE_4G = 7U
39 : };
40 :
41 : /* readonly attribute boolean isLinkUp; */
42 : NS_IMETHOD GetIsLinkUp(bool *aIsLinkUp) = 0;
43 :
44 : /* readonly attribute boolean linkStatusKnown; */
45 : NS_IMETHOD GetLinkStatusKnown(bool *aLinkStatusKnown) = 0;
46 :
47 : /* readonly attribute unsigned long linkType; */
48 : NS_IMETHOD GetLinkType(uint32_t *aLinkType) = 0;
49 :
50 : };
51 :
52 : NS_DEFINE_STATIC_IID_ACCESSOR(nsINetworkLinkService, NS_INETWORKLINKSERVICE_IID)
53 :
54 : /* Use this macro when declaring classes that implement this interface. */
55 : #define NS_DECL_NSINETWORKLINKSERVICE \
56 : NS_IMETHOD GetIsLinkUp(bool *aIsLinkUp) override; \
57 : NS_IMETHOD GetLinkStatusKnown(bool *aLinkStatusKnown) override; \
58 : NS_IMETHOD GetLinkType(uint32_t *aLinkType) override;
59 :
60 : /* Use this macro when declaring the members of this interface when the
61 : class doesn't implement the interface. This is useful for forwarding. */
62 : #define NS_DECL_NON_VIRTUAL_NSINETWORKLINKSERVICE \
63 : nsresult GetIsLinkUp(bool *aIsLinkUp); \
64 : nsresult GetLinkStatusKnown(bool *aLinkStatusKnown); \
65 : nsresult GetLinkType(uint32_t *aLinkType);
66 :
67 : /* Use this macro to declare functions that forward the behavior of this interface to another object. */
68 : #define NS_FORWARD_NSINETWORKLINKSERVICE(_to) \
69 : NS_IMETHOD GetIsLinkUp(bool *aIsLinkUp) override { return _to GetIsLinkUp(aIsLinkUp); } \
70 : NS_IMETHOD GetLinkStatusKnown(bool *aLinkStatusKnown) override { return _to GetLinkStatusKnown(aLinkStatusKnown); } \
71 : NS_IMETHOD GetLinkType(uint32_t *aLinkType) override { return _to GetLinkType(aLinkType); }
72 :
73 : /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
74 : #define NS_FORWARD_SAFE_NSINETWORKLINKSERVICE(_to) \
75 : NS_IMETHOD GetIsLinkUp(bool *aIsLinkUp) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetIsLinkUp(aIsLinkUp); } \
76 : NS_IMETHOD GetLinkStatusKnown(bool *aLinkStatusKnown) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetLinkStatusKnown(aLinkStatusKnown); } \
77 : NS_IMETHOD GetLinkType(uint32_t *aLinkType) override { return !_to ? NS_ERROR_NULL_POINTER : _to->GetLinkType(aLinkType); }
78 :
79 : #if 0
80 : /* Use the code below as a template for the implementation class for this interface. */
81 :
82 : /* Header file */
83 : class nsNetworkLinkService : public nsINetworkLinkService
84 : {
85 : public:
86 : NS_DECL_ISUPPORTS
87 : NS_DECL_NSINETWORKLINKSERVICE
88 :
89 : nsNetworkLinkService();
90 :
91 : private:
92 : ~nsNetworkLinkService();
93 :
94 : protected:
95 : /* additional members */
96 : };
97 :
98 : /* Implementation file */
99 : NS_IMPL_ISUPPORTS(nsNetworkLinkService, nsINetworkLinkService)
100 :
101 : nsNetworkLinkService::nsNetworkLinkService()
102 : {
103 : /* member initializers and constructor code */
104 : }
105 :
106 : nsNetworkLinkService::~nsNetworkLinkService()
107 : {
108 : /* destructor code */
109 : }
110 :
111 : /* readonly attribute boolean isLinkUp; */
112 : NS_IMETHODIMP nsNetworkLinkService::GetIsLinkUp(bool *aIsLinkUp)
113 : {
114 : return NS_ERROR_NOT_IMPLEMENTED;
115 : }
116 :
117 : /* readonly attribute boolean linkStatusKnown; */
118 : NS_IMETHODIMP nsNetworkLinkService::GetLinkStatusKnown(bool *aLinkStatusKnown)
119 : {
120 : return NS_ERROR_NOT_IMPLEMENTED;
121 : }
122 :
123 : /* readonly attribute unsigned long linkType; */
124 : NS_IMETHODIMP nsNetworkLinkService::GetLinkType(uint32_t *aLinkType)
125 : {
126 : return NS_ERROR_NOT_IMPLEMENTED;
127 : }
128 :
129 : /* End of implementation class template. */
130 : #endif
131 :
132 : /**
133 : * We send notifications through nsIObserverService with topic
134 : * NS_NETWORK_LINK_TOPIC whenever one of isLinkUp or linkStatusKnown
135 : * changes. We pass one of the NS_NETWORK_LINK_DATA_ constants below
136 : * as the aData parameter of the notification.
137 : */
138 : #define NS_NETWORK_LINK_TOPIC "network:link-status-changed"
139 : /**
140 : * isLinkUp is now true, linkStatusKnown is true.
141 : */
142 : #define NS_NETWORK_LINK_DATA_UP "up"
143 : /**
144 : * isLinkUp is now false, linkStatusKnown is true.
145 : */
146 : #define NS_NETWORK_LINK_DATA_DOWN "down"
147 : /**
148 : * isLinkUp is still true, but the network setup is modified.
149 : * linkStatusKnown is true.
150 : */
151 : #define NS_NETWORK_LINK_DATA_CHANGED "changed"
152 : /**
153 : * linkStatusKnown is now false.
154 : */
155 : #define NS_NETWORK_LINK_DATA_UNKNOWN "unknown"
156 : /**
157 : * We send notifications through nsIObserverService with topic
158 : * NS_NETWORK_LINK_TYPE_TOPIC whenever the network connection type
159 : * changes. We pass one of the valid connection type constants
160 : * below as the aData parameter of the notification.
161 : */
162 : #define NS_NETWORK_LINK_TYPE_TOPIC "network:link-type-changed"
163 : /** We were unable to determine the network connection type */
164 : #define NS_NETWORK_LINK_TYPE_UNKNOWN "unknown"
165 : /** A standard wired ethernet connection */
166 : #define NS_NETWORK_LINK_TYPE_ETHERNET "ethernet"
167 : /** A connection via a USB port */
168 : #define NS_NETWORK_LINK_TYPE_USB "usb"
169 : /** A connection via a WiFi access point (IEEE802.11) */
170 : #define NS_NETWORK_LINK_TYPE_WIFI "wifi"
171 : /** A connection via WiMax (IEEE802.16) */
172 : #define NS_NETWORK_LINK_TYPE_WIMAX "wimax"
173 : /** A '2G' mobile connection (e.g. GSM, GPRS, EDGE) */
174 : #define NS_NETWORK_LINK_TYPE_2G "2g"
175 : /** A '3G' mobile connection (e.g. UMTS, CDMA) */
176 : #define NS_NETWORK_LINK_TYPE_3G "3g"
177 : /** A '4G' mobile connection (e.g. LTE, UMB) */
178 : #define NS_NETWORK_LINK_TYPE_4G "4g"
179 :
180 : #endif /* __gen_nsINetworkLinkService_h__ */
|