/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "nsISupports.idl"
#include "nsIObserver.idl"

//forward declarations
interface nsIFile;
interface nsIFileURL;

[scriptable, uuid(817918fa-1f4b-4254-9cdb-f906da91c45d)]
interface imIUserStatusInfo: nsISupports {

  readonly attribute AUTF8String statusText;

  // See imIStatusInfo for the values.
  readonly attribute short statusType;

  // Only works with STATUS_OFFLINE, STATUS_UNAVAILABLE, STATUS_AWAY,
  // STATUS_AVAILABLE and STATUS_INVISIBLE.
  // - When called with the status type STATUS_UNSET, only the status
  //   message will be changed.
  // - When called with STATUS_OFFLINE, the aMessage parameter is ignored.
  void setStatus(in short aStatus, in AUTF8String aMessage);

  // Sets the user icon, or removes it if null is passed as a parameter.
  // Will fire a user-icon-changed notificaton.
  void setUserIcon(in nsIFile aIconFile);

  // Returns the location of the current user icon, or null if no icon is set.
  nsIFileURL getUserIcon();

  /* The setter will fire a user-display-name-changed notificaton. */
  attribute AUTF8String displayName;

  void addObserver(in nsIObserver aObserver);
  void removeObserver(in nsIObserver aObserver);
  /* Observers will receive the following notifications:
   *   status-changed (when either the status type or text has changed)
   *   user-icon-changed
   *   user-display-name-changed
   *   idle-time-changed
   */
};
