summaryrefslogtreecommitdiffstats
path: root/comm/chat/components/public/imIUserStatusInfo.idl
blob: dba07c31907d93dc9d971115b74897cecf9fd491 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/* 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;

  /**
   * Set the user's current status (e.g. available or away).
   *
   * When called with the status type STATUS_UNSET, only the status
   * message will be changed.
   *
   * @param aStatus the new status to use. Only works with STATUS_OFFLINE,
   *    STATUS_UNAVAILABLE, STATUS_AWAY, STATUS_AVAILABLE and STATUS_INVISIBLE.
   * @param aMessage the new status message. Ignored when aStatus is STATUS_OFFLINE.
   */
  void setStatus(in short aStatus, in AUTF8String aMessage);

  /**
   * Sets the user icon, or removes it if null is passed as a parameter.
   *
   * Calling this will fire a user-icon-changed notification.
   */
  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 notification. */
  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
   */
};