michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: /** michael@0: * This interface exposes the general notion of a scheduled object with a michael@0: * integral priority value. Following UNIX conventions, smaller (and possibly michael@0: * negative) values have higher priority. michael@0: * michael@0: * This interface does not strictly define what happens when the priority of an michael@0: * object is changed. An implementation of this interface is free to define michael@0: * the side-effects of changing the priority of an object. In some cases, michael@0: * changing the priority of an object may be disallowed (resulting in an michael@0: * exception being thrown) or may simply be ignored. michael@0: */ michael@0: [scriptable, uuid(aa578b44-abd5-4c19-8b14-36d4de6fdc36)] michael@0: interface nsISupportsPriority : nsISupports michael@0: { michael@0: /** michael@0: * Typical priority values. michael@0: */ michael@0: const long PRIORITY_HIGHEST = -20; michael@0: const long PRIORITY_HIGH = -10; michael@0: const long PRIORITY_NORMAL = 0; michael@0: const long PRIORITY_LOW = 10; michael@0: const long PRIORITY_LOWEST = 20; michael@0: michael@0: /** michael@0: * This attribute may be modified to change the priority of this object. The michael@0: * implementation of this interface is free to truncate a given priority michael@0: * value to whatever limits are appropriate. Typically, this attribute is michael@0: * initialized to PRIORITY_NORMAL, but implementations may choose to assign a michael@0: * different initial value. michael@0: */ michael@0: attribute long priority; michael@0: michael@0: /** michael@0: * This method adjusts the priority attribute by a given delta. It helps michael@0: * reduce the amount of coding required to increment or decrement the value michael@0: * of the priority attribute. michael@0: */ michael@0: void adjustPriority(in long delta); michael@0: };