gecko-dev/xpfe/components/timebomb/nsITimeBomb.idl

110 строки
3.1 KiB
Plaintext

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
* Doug Turner <dougt@netscape.com>
*/
/****************************************************************
Time Bomb
In order to use timebombs, you must set the preference:
timebomb.enabled
This must be set to true for the time bomb to be activated.
There are two type of timebombs. The first is an absolute
timebomb which expires on a given date regardless of build
date. These absolute dates are set in the preferences:
timebomb.expiration_time
timebomb.warning_time
The values are relative to the epoch, midnight, January 1,
1970 UTC in microseconds. This is basically a PRTime.
The second form of timebomb is naturally relative. It take
a start date and an two offset.
The first relative check is agains the build time preference:
timebomb.build_time
The two offsets are:
timebomb.expiration_offset
timebomb.warning_offset
The next relative check is against the first launch. The
preferences for first run is:
timebomb.first_launch_time
It will be set for you the first time nsITimeBomb is called.
If you only want to preform a time bomb after the
first launch, simply do not define timebomb.build_time.
Since these preferences are set in a plain text
javascript file and there currently is not pref
locking in mozilla, a user could simply remove
any one of these setting.
When the application does expire, you can specify a
URL to load.
timebomb.timebombURL
****************************************************************/
#include "nsISupports.idl"
[scriptable, uuid(93fabc84-e1bf-11d3-ac71-00c04fa0d26b)]
interface nsITimeBomb : nsISupports
{
void init();
void checkWithUI(out boolean expired);
void loadUpdateURL();
readonly attribute boolean expired;
readonly attribute boolean warned;
readonly attribute boolean enabled;
readonly attribute PRTime expirationTime;
readonly attribute PRTime warningTime;
readonly attribute PRTime buildTime;
readonly attribute PRTime firstLaunch;
readonly attribute PRInt64 warningOffset;
readonly attribute PRInt64 expirationOffset;
readonly attribute string timebombURL;
};
%{ C++
#define NS_TIMEBOMB_CONTRACTID "@mozilla.org/timebomb;1"
%}