toolkit/mozapps/update/nsIUpdateTimerManager.idl

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 #include "nsISupports.idl"
michael@0 7
michael@0 8 interface nsITimerCallback;
michael@0 9
michael@0 10 /**
michael@0 11 * An interface describing a global application service that allows long
michael@0 12 * duration (e.g. 1-7 or more days, weeks or months) timers to be registered
michael@0 13 * and then fired.
michael@0 14 */
michael@0 15 [scriptable, uuid(0765c92c-6145-4253-9db4-594d8023087e)]
michael@0 16 interface nsIUpdateTimerManager : nsISupports
michael@0 17 {
michael@0 18 /**
michael@0 19 * Register an interval with the timer manager. The timer manager
michael@0 20 * periodically checks to see if the interval has expired and if it has
michael@0 21 * calls the specified callback. This is persistent across application
michael@0 22 * restarts and can handle intervals of long durations.
michael@0 23 * @param id
michael@0 24 * An id that identifies the interval, used for persistence
michael@0 25 * @param callback
michael@0 26 * A nsITimerCallback object that is notified when the interval
michael@0 27 * expires
michael@0 28 * @param interval
michael@0 29 * The length of time, in seconds, of the interval
michael@0 30 *
michael@0 31 * Note: to avoid having to instantiate a component to call registerTimer
michael@0 32 * the component can intead register an update-timer category with comma
michael@0 33 * separated values as a single string representing the timer as follows.
michael@0 34 *
michael@0 35 * _xpcom_categories: [{ category: "update-timer",
michael@0 36 * value: "contractID," +
michael@0 37 * "method," +
michael@0 38 * "id," +
michael@0 39 * "preference," +
michael@0 40 * "interval" }],
michael@0 41 * the values are as follows
michael@0 42 * contractID : the contract ID for the component.
michael@0 43 * method : the method used to instantiate the interface. This should be
michael@0 44 * either getService or createInstance depending on your
michael@0 45 * component.
michael@0 46 * id : the id that identifies the interval, used for persistence.
michael@0 47 * preference : the preference to for timer interval. This value can be
michael@0 48 * optional by specifying an empty string for the value.
michael@0 49 * interval : the default interval in seconds for the timer.
michael@0 50 */
michael@0 51 void registerTimer(in AString id,
michael@0 52 in nsITimerCallback callback,
michael@0 53 in unsigned long interval);
michael@0 54 };

mercurial