DXR will be turned off on Tuesday, December 29th. It will redirect to Searchfox.
See the announcement on Discourse.

DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Mercurial (379a2370cd89)

VCS Links

Line Code
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 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
 *
 * The contents of this file are subject to the Mozilla 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/MPL/
 *
 * 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 the Initial Developer are Copyright (C) 2008
 * the Initial Developer. All Rights Reserved.
 *
 * Contributor(s):
 *   David Ascher <dascher@mozillamessaging.com>
 *   Emre Birol <ebirol@gmail.com>
 *
 * Alternatively, the contents of this file may be used under the terms of
 * either the GNU General Public License Version 2 or later (the "GPL"), or
 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 * in which case the provisions of the GPL or the LGPL are applicable instead
 * of those above. If you wish to allow use of your version of this file only
 * under the terms of either the GPL or the LGPL, and not to allow others to
 * use your version of this file under the terms of the MPL, indicate your
 * decision by deleting the provisions above and replace them with the notice
 * and other provisions required by the GPL or the LGPL. If you do not delete
 * the provisions above, a recipient may use your version of this file under
 * the terms of any one of the MPL, the GPL or the LGPL.
 *
 * ***** END LICENSE BLOCK ***** */

#include "nsISupports.idl"

interface mozIStorageConnection;
interface nsIActivity;
interface nsIActivityProcess;
interface nsIVariant;

/**
 * See https://wiki.mozilla.org/Thunderbird:Activity_Manager/Developer for UML
 * diagram and sample codes.
 */

/**
 * An interface to get notified by the major Activity Manager events.
 * Mostly used by UI glue code in activity.js.
 */
[scriptable, uuid(14cfad1c-3401-4c44-ab04-4a11b6662663)]
interface nsIActivityMgrListener : nsISupports {
  /**
   * Called _after_ activity manager adds an activity into
   * the managed list.
   */
  void onAddedActivity(in unsigned long aID, in nsIActivity aActivity);
  
  /**
   * Called _after_ activity manager removes an activity from
   * the managed list.
   */
  void onRemovedActivity(in unsigned long aID);
};

/**
 * Activity Manager is a simple component that understands how do display a
 * combination of user activity and history. The activity manager works in
 * conjunction with the 'Interactive Status Bar' to give the user the right
 * level of notifications concerning what Thunderbird is doing on it's own and
 * how Thunderbird has handled user requests.
 *
 * There are 3 different classifications of activity items which can be
 * displayed in the Activity Manager Window:
 *  o Process: Processes are transient in the display. They are not written to
 *    disk as they are always acting on some data that already exists
 *    locally or remotely. If a process has finished and needs to keep
 *    some state for the user (like last sync time) it can convert
 *    itself into an event.
 * o Event: Historical actions performed by the user and created by a process
 *   for the Activity Manager Window. Events can show up in the
 *   'Interactive Status Bar' and be displayed to users as they are
 *   created.
 * o Warning: Alerts sent by Thunderbird or servers (i.e. imap server) that need
 *   attention by the user. For example a Quota Alert from the imap
 *   server can be represented as a Warning to the user. They are not
 *   written to disk.
 */
[scriptable, uuid(9BFCC031-50E1-4D30-A35F-23509ABCB8D1)]
interface nsIActivityManager : nsISupports {
    
  /**
   * Adds the given activity into the managed activities list.
   *
   * @param aActivity The activity that will be added.
   *
   * @return Unique activity identifier.
   */
  unsigned long addActivity(in nsIActivity aActivity);
  
  /**
   * Removes the activity with the given id if it's not currently
   * in-progress.
   *
   * @param aID The unique ID of the activity.
   *
   * @throws NS_ERROR_FAILURE if the activity is in-progress.
   * @throws NS_ERROR_NOT_AVAILABLE if the activity is not in the list.
   */
  void removeActivity(in unsigned long aID);

  /**
   * Retrieves an activity managed by the activity manager. This can be one that
   * is in progress, or one that has completed in the past and is stored in the
   * persistent store.
   *
   * @param aID The unique ID of the activity.
   *
   * @return The activity with the specified ID.
   * @throws NS_ERROR_NOT_AVAILABLE if the activity is not in the list.
   */
  nsIActivity getActivity(in unsigned long aID);
  
  /**
   * Tests wether the activity in question in the activity list or not.
   */
  boolean containsActivity(in unsigned long aID);
  
  /**
   * Retrieves all activities managed by the activity manager. This can be one
   * that is in progress (process), one that is represented as a warning, or one
   * that has completed (event) in the past and is stored in the persistent
   * store.
   *
   * @return A read-only list of activities managed by the activity manager.
   */
  void getActivities(out unsigned long length,
                  [retval, array, size_is(length)] out nsIActivity aActivities);
  
  /**
   * Retrieves processes with given context type and object.
   *
   * @return A read-only list of processes matching to given criteria.
   */
  void getProcessesByContext(in AString aContextType,
                             in nsIVariant aContextObject,
                             out unsigned long length,
                             [retval, array, size_is(length)] out nsIActivityProcess aProcesses);

  /**
   *  Call to remove all activities apart from those that are in progress.
   */
  void cleanUp();

  /**
   * The number of processes in the activity list.
   */
  readonly attribute long processCount;
  
  /**
   * Adds a listener.
   */
  void addListener(in nsIActivityMgrListener aListener);

  /**
   * Removes the given listener.
   */
  void removeListener(in nsIActivityMgrListener aListener);
};