1 : /*
2 : * DO NOT EDIT. THIS FILE IS GENERATED FROM /builds/slave/m-beta-lnx-codecoverage/build/xpcom/threads/nsITimer.idl
3 : */
4 :
5 : #ifndef __gen_nsITimer_h__
6 : #define __gen_nsITimer_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 : class nsIObserver; /* forward declaration */
18 :
19 : class nsIEventTarget; /* forward declaration */
20 :
21 : /**
22 : * The signature of the timer callback function passed to initWithFuncCallback.
23 : * This is the function that will get called when the timer expires if the
24 : * timer is initialized via initWithFuncCallback.
25 : *
26 : * @param aTimer the timer which has expired
27 : * @param aClosure opaque parameter passed to initWithFuncCallback
28 : *
29 : * Implementers should return the following:
30 : *
31 : * @return NS_OK
32 : *
33 : */
34 : class nsITimer;
35 : typedef void (*nsTimerCallbackFunc) (nsITimer *aTimer, void *aClosure);
36 : class nsITimer; /* forward declaration */
37 :
38 :
39 : /* starting interface: nsITimerCallback */
40 : #define NS_ITIMERCALLBACK_IID_STR "a796816d-7d47-4348-9ab8-c7aeb3216a7d"
41 :
42 : #define NS_ITIMERCALLBACK_IID \
43 : {0xa796816d, 0x7d47, 0x4348, \
44 : { 0x9a, 0xb8, 0xc7, 0xae, 0xb3, 0x21, 0x6a, 0x7d }}
45 :
46 8284 : class NS_NO_VTABLE NS_SCRIPTABLE nsITimerCallback : public nsISupports {
47 : public:
48 :
49 : NS_DECLARE_STATIC_IID_ACCESSOR(NS_ITIMERCALLBACK_IID)
50 :
51 : /* void notify (in nsITimer timer); */
52 : NS_SCRIPTABLE NS_IMETHOD Notify(nsITimer *timer) = 0;
53 :
54 : };
55 :
56 : NS_DEFINE_STATIC_IID_ACCESSOR(nsITimerCallback, NS_ITIMERCALLBACK_IID)
57 :
58 : /* Use this macro when declaring classes that implement this interface. */
59 : #define NS_DECL_NSITIMERCALLBACK \
60 : NS_SCRIPTABLE NS_IMETHOD Notify(nsITimer *timer);
61 :
62 : /* Use this macro to declare functions that forward the behavior of this interface to another object. */
63 : #define NS_FORWARD_NSITIMERCALLBACK(_to) \
64 : NS_SCRIPTABLE NS_IMETHOD Notify(nsITimer *timer) { return _to Notify(timer); }
65 :
66 : /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
67 : #define NS_FORWARD_SAFE_NSITIMERCALLBACK(_to) \
68 : NS_SCRIPTABLE NS_IMETHOD Notify(nsITimer *timer) { return !_to ? NS_ERROR_NULL_POINTER : _to->Notify(timer); }
69 :
70 : #if 0
71 : /* Use the code below as a template for the implementation class for this interface. */
72 :
73 : /* Header file */
74 : class nsTimerCallback : public nsITimerCallback
75 : {
76 : public:
77 : NS_DECL_ISUPPORTS
78 : NS_DECL_NSITIMERCALLBACK
79 :
80 : nsTimerCallback();
81 :
82 : private:
83 : ~nsTimerCallback();
84 :
85 : protected:
86 : /* additional members */
87 : };
88 :
89 : /* Implementation file */
90 : NS_IMPL_ISUPPORTS1(nsTimerCallback, nsITimerCallback)
91 :
92 : nsTimerCallback::nsTimerCallback()
93 : {
94 : /* member initializers and constructor code */
95 : }
96 :
97 : nsTimerCallback::~nsTimerCallback()
98 : {
99 : /* destructor code */
100 : }
101 :
102 : /* void notify (in nsITimer timer); */
103 : NS_IMETHODIMP nsTimerCallback::Notify(nsITimer *timer)
104 : {
105 : return NS_ERROR_NOT_IMPLEMENTED;
106 : }
107 :
108 : /* End of implementation class template. */
109 : #endif
110 :
111 : // Two timer deadlines must differ by less than half the PRIntervalTime domain.
112 : #define DELAY_INTERVAL_LIMIT PR_BIT(8 * sizeof(PRIntervalTime) - 1)
113 :
114 : /* starting interface: nsITimer */
115 : #define NS_ITIMER_IID_STR "193fc37a-8aa4-4d29-aa57-1acd87c26b66"
116 :
117 : #define NS_ITIMER_IID \
118 : {0x193fc37a, 0x8aa4, 0x4d29, \
119 : { 0xaa, 0x57, 0x1a, 0xcd, 0x87, 0xc2, 0x6b, 0x66 }}
120 :
121 12304 : class NS_NO_VTABLE NS_SCRIPTABLE nsITimer : public nsISupports {
122 : public:
123 :
124 : NS_DECLARE_STATIC_IID_ACCESSOR(NS_ITIMER_IID)
125 :
126 : enum {
127 : TYPE_ONE_SHOT = 0,
128 : TYPE_REPEATING_SLACK = 1,
129 : TYPE_REPEATING_PRECISE = 2,
130 : TYPE_REPEATING_PRECISE_CAN_SKIP = 3
131 : };
132 :
133 : /* void init (in nsIObserver aObserver, in unsigned long aDelay, in unsigned long aType); */
134 : NS_SCRIPTABLE NS_IMETHOD Init(nsIObserver *aObserver, PRUint32 aDelay, PRUint32 aType) = 0;
135 :
136 : /* [noscript] void initWithFuncCallback (in nsTimerCallbackFunc aCallback, in voidPtr aClosure, in unsigned long aDelay, in unsigned long aType); */
137 : NS_IMETHOD InitWithFuncCallback(nsTimerCallbackFunc aCallback, void *aClosure, PRUint32 aDelay, PRUint32 aType) = 0;
138 :
139 : /* void initWithCallback (in nsITimerCallback aCallback, in unsigned long aDelay, in unsigned long aType); */
140 : NS_SCRIPTABLE NS_IMETHOD InitWithCallback(nsITimerCallback *aCallback, PRUint32 aDelay, PRUint32 aType) = 0;
141 :
142 : /* void cancel (); */
143 : NS_SCRIPTABLE NS_IMETHOD Cancel(void) = 0;
144 :
145 : /* attribute unsigned long delay; */
146 : NS_SCRIPTABLE NS_IMETHOD GetDelay(PRUint32 *aDelay) = 0;
147 : NS_SCRIPTABLE NS_IMETHOD SetDelay(PRUint32 aDelay) = 0;
148 :
149 : /* attribute unsigned long type; */
150 : NS_SCRIPTABLE NS_IMETHOD GetType(PRUint32 *aType) = 0;
151 : NS_SCRIPTABLE NS_IMETHOD SetType(PRUint32 aType) = 0;
152 :
153 : /* [noscript] readonly attribute voidPtr closure; */
154 : NS_IMETHOD GetClosure(void **aClosure) = 0;
155 :
156 : /* readonly attribute nsITimerCallback callback; */
157 : NS_SCRIPTABLE NS_IMETHOD GetCallback(nsITimerCallback * *aCallback) = 0;
158 :
159 : /* attribute nsIEventTarget target; */
160 : NS_SCRIPTABLE NS_IMETHOD GetTarget(nsIEventTarget * *aTarget) = 0;
161 : NS_SCRIPTABLE NS_IMETHOD SetTarget(nsIEventTarget *aTarget) = 0;
162 :
163 : };
164 :
165 : NS_DEFINE_STATIC_IID_ACCESSOR(nsITimer, NS_ITIMER_IID)
166 :
167 : /* Use this macro when declaring classes that implement this interface. */
168 : #define NS_DECL_NSITIMER \
169 : NS_SCRIPTABLE NS_IMETHOD Init(nsIObserver *aObserver, PRUint32 aDelay, PRUint32 aType); \
170 : NS_IMETHOD InitWithFuncCallback(nsTimerCallbackFunc aCallback, void *aClosure, PRUint32 aDelay, PRUint32 aType); \
171 : NS_SCRIPTABLE NS_IMETHOD InitWithCallback(nsITimerCallback *aCallback, PRUint32 aDelay, PRUint32 aType); \
172 : NS_SCRIPTABLE NS_IMETHOD Cancel(void); \
173 : NS_SCRIPTABLE NS_IMETHOD GetDelay(PRUint32 *aDelay); \
174 : NS_SCRIPTABLE NS_IMETHOD SetDelay(PRUint32 aDelay); \
175 : NS_SCRIPTABLE NS_IMETHOD GetType(PRUint32 *aType); \
176 : NS_SCRIPTABLE NS_IMETHOD SetType(PRUint32 aType); \
177 : NS_IMETHOD GetClosure(void **aClosure); \
178 : NS_SCRIPTABLE NS_IMETHOD GetCallback(nsITimerCallback * *aCallback); \
179 : NS_SCRIPTABLE NS_IMETHOD GetTarget(nsIEventTarget * *aTarget); \
180 : NS_SCRIPTABLE NS_IMETHOD SetTarget(nsIEventTarget *aTarget);
181 :
182 : /* Use this macro to declare functions that forward the behavior of this interface to another object. */
183 : #define NS_FORWARD_NSITIMER(_to) \
184 : NS_SCRIPTABLE NS_IMETHOD Init(nsIObserver *aObserver, PRUint32 aDelay, PRUint32 aType) { return _to Init(aObserver, aDelay, aType); } \
185 : NS_IMETHOD InitWithFuncCallback(nsTimerCallbackFunc aCallback, void *aClosure, PRUint32 aDelay, PRUint32 aType) { return _to InitWithFuncCallback(aCallback, aClosure, aDelay, aType); } \
186 : NS_SCRIPTABLE NS_IMETHOD InitWithCallback(nsITimerCallback *aCallback, PRUint32 aDelay, PRUint32 aType) { return _to InitWithCallback(aCallback, aDelay, aType); } \
187 : NS_SCRIPTABLE NS_IMETHOD Cancel(void) { return _to Cancel(); } \
188 : NS_SCRIPTABLE NS_IMETHOD GetDelay(PRUint32 *aDelay) { return _to GetDelay(aDelay); } \
189 : NS_SCRIPTABLE NS_IMETHOD SetDelay(PRUint32 aDelay) { return _to SetDelay(aDelay); } \
190 : NS_SCRIPTABLE NS_IMETHOD GetType(PRUint32 *aType) { return _to GetType(aType); } \
191 : NS_SCRIPTABLE NS_IMETHOD SetType(PRUint32 aType) { return _to SetType(aType); } \
192 : NS_IMETHOD GetClosure(void **aClosure) { return _to GetClosure(aClosure); } \
193 : NS_SCRIPTABLE NS_IMETHOD GetCallback(nsITimerCallback * *aCallback) { return _to GetCallback(aCallback); } \
194 : NS_SCRIPTABLE NS_IMETHOD GetTarget(nsIEventTarget * *aTarget) { return _to GetTarget(aTarget); } \
195 : NS_SCRIPTABLE NS_IMETHOD SetTarget(nsIEventTarget *aTarget) { return _to SetTarget(aTarget); }
196 :
197 : /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
198 : #define NS_FORWARD_SAFE_NSITIMER(_to) \
199 : NS_SCRIPTABLE NS_IMETHOD Init(nsIObserver *aObserver, PRUint32 aDelay, PRUint32 aType) { return !_to ? NS_ERROR_NULL_POINTER : _to->Init(aObserver, aDelay, aType); } \
200 : NS_IMETHOD InitWithFuncCallback(nsTimerCallbackFunc aCallback, void *aClosure, PRUint32 aDelay, PRUint32 aType) { return !_to ? NS_ERROR_NULL_POINTER : _to->InitWithFuncCallback(aCallback, aClosure, aDelay, aType); } \
201 : NS_SCRIPTABLE NS_IMETHOD InitWithCallback(nsITimerCallback *aCallback, PRUint32 aDelay, PRUint32 aType) { return !_to ? NS_ERROR_NULL_POINTER : _to->InitWithCallback(aCallback, aDelay, aType); } \
202 : NS_SCRIPTABLE NS_IMETHOD Cancel(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Cancel(); } \
203 : NS_SCRIPTABLE NS_IMETHOD GetDelay(PRUint32 *aDelay) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetDelay(aDelay); } \
204 : NS_SCRIPTABLE NS_IMETHOD SetDelay(PRUint32 aDelay) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetDelay(aDelay); } \
205 : NS_SCRIPTABLE NS_IMETHOD GetType(PRUint32 *aType) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetType(aType); } \
206 : NS_SCRIPTABLE NS_IMETHOD SetType(PRUint32 aType) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetType(aType); } \
207 : NS_IMETHOD GetClosure(void **aClosure) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetClosure(aClosure); } \
208 : NS_SCRIPTABLE NS_IMETHOD GetCallback(nsITimerCallback * *aCallback) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCallback(aCallback); } \
209 : NS_SCRIPTABLE NS_IMETHOD GetTarget(nsIEventTarget * *aTarget) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetTarget(aTarget); } \
210 : NS_SCRIPTABLE NS_IMETHOD SetTarget(nsIEventTarget *aTarget) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetTarget(aTarget); }
211 :
212 : #if 0
213 : /* Use the code below as a template for the implementation class for this interface. */
214 :
215 : /* Header file */
216 : class nsTimer : public nsITimer
217 : {
218 : public:
219 : NS_DECL_ISUPPORTS
220 : NS_DECL_NSITIMER
221 :
222 : nsTimer();
223 :
224 : private:
225 : ~nsTimer();
226 :
227 : protected:
228 : /* additional members */
229 : };
230 :
231 : /* Implementation file */
232 : NS_IMPL_ISUPPORTS1(nsTimer, nsITimer)
233 :
234 : nsTimer::nsTimer()
235 : {
236 : /* member initializers and constructor code */
237 : }
238 :
239 : nsTimer::~nsTimer()
240 : {
241 : /* destructor code */
242 : }
243 :
244 : /* void init (in nsIObserver aObserver, in unsigned long aDelay, in unsigned long aType); */
245 : NS_IMETHODIMP nsTimer::Init(nsIObserver *aObserver, PRUint32 aDelay, PRUint32 aType)
246 : {
247 : return NS_ERROR_NOT_IMPLEMENTED;
248 : }
249 :
250 : /* [noscript] void initWithFuncCallback (in nsTimerCallbackFunc aCallback, in voidPtr aClosure, in unsigned long aDelay, in unsigned long aType); */
251 : NS_IMETHODIMP nsTimer::InitWithFuncCallback(nsTimerCallbackFunc aCallback, void *aClosure, PRUint32 aDelay, PRUint32 aType)
252 : {
253 : return NS_ERROR_NOT_IMPLEMENTED;
254 : }
255 :
256 : /* void initWithCallback (in nsITimerCallback aCallback, in unsigned long aDelay, in unsigned long aType); */
257 : NS_IMETHODIMP nsTimer::InitWithCallback(nsITimerCallback *aCallback, PRUint32 aDelay, PRUint32 aType)
258 : {
259 : return NS_ERROR_NOT_IMPLEMENTED;
260 : }
261 :
262 : /* void cancel (); */
263 : NS_IMETHODIMP nsTimer::Cancel()
264 : {
265 : return NS_ERROR_NOT_IMPLEMENTED;
266 : }
267 :
268 : /* attribute unsigned long delay; */
269 : NS_IMETHODIMP nsTimer::GetDelay(PRUint32 *aDelay)
270 : {
271 : return NS_ERROR_NOT_IMPLEMENTED;
272 : }
273 : NS_IMETHODIMP nsTimer::SetDelay(PRUint32 aDelay)
274 : {
275 : return NS_ERROR_NOT_IMPLEMENTED;
276 : }
277 :
278 : /* attribute unsigned long type; */
279 : NS_IMETHODIMP nsTimer::GetType(PRUint32 *aType)
280 : {
281 : return NS_ERROR_NOT_IMPLEMENTED;
282 : }
283 : NS_IMETHODIMP nsTimer::SetType(PRUint32 aType)
284 : {
285 : return NS_ERROR_NOT_IMPLEMENTED;
286 : }
287 :
288 : /* [noscript] readonly attribute voidPtr closure; */
289 : NS_IMETHODIMP nsTimer::GetClosure(void **aClosure)
290 : {
291 : return NS_ERROR_NOT_IMPLEMENTED;
292 : }
293 :
294 : /* readonly attribute nsITimerCallback callback; */
295 : NS_IMETHODIMP nsTimer::GetCallback(nsITimerCallback * *aCallback)
296 : {
297 : return NS_ERROR_NOT_IMPLEMENTED;
298 : }
299 :
300 : /* attribute nsIEventTarget target; */
301 : NS_IMETHODIMP nsTimer::GetTarget(nsIEventTarget * *aTarget)
302 : {
303 : return NS_ERROR_NOT_IMPLEMENTED;
304 : }
305 : NS_IMETHODIMP nsTimer::SetTarget(nsIEventTarget *aTarget)
306 : {
307 : return NS_ERROR_NOT_IMPLEMENTED;
308 : }
309 :
310 : /* End of implementation class template. */
311 : #endif
312 :
313 : #define NS_TIMER_CONTRACTID "@mozilla.org/timer;1"
314 : #define NS_TIMER_CALLBACK_TOPIC "timer-callback"
315 :
316 : #endif /* __gen_nsITimer_h__ */
|