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.

Untracked file

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 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368
/* -*- Mode: IDL; tab-width: 4; 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) 2001
 * the Initial Developer. All Rights Reserved.
 *
 * Contributor(s):
 *
 * Alternatively, the contents of this file may be used under the terms of
 * either of 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"
#include "MailNewsTypes2.idl"

interface nsIMsgFolder;
interface nsIMsgWindow;
interface nsIMessenger;
interface nsIMsgDBHdr;
interface nsIMsgDBViewCommandUpdater;
interface nsIMsgDatabase;
interface nsIMsgSearchSession;
interface nsISimpleEnumerator;
interface nsITreeView;
interface nsIMsgCustomColumnHandler;

typedef long nsMsgViewNotificationCodeValue;
typedef long nsMsgViewCommandCheckStateValue;
typedef long nsMsgViewCommandTypeValue;
typedef long nsMsgNavigationTypeValue;

[scriptable, uuid(682a18be-fd18-11d4-a5be-0060b0fc04b7)]
interface nsMsgViewSortOrder
{
  const nsMsgViewSortOrderValue none = 0;
  const nsMsgViewSortOrderValue ascending = 1;
  const nsMsgViewSortOrderValue descending = 2;
};

[scriptable, uuid(f28a1cdf-06c3-4e98-8f66-f49991670071)]
interface nsMsgViewType {
  const nsMsgViewTypeValue eShowAllThreads = 0;
  const nsMsgViewTypeValue eShowThreadsWithUnread = 2;
  const nsMsgViewTypeValue eShowWatchedThreadsWithUnread = 3;
  const nsMsgViewTypeValue eShowQuickSearchResults = 4;
  const nsMsgViewTypeValue eShowVirtualFolderResults = 5;
  const nsMsgViewTypeValue eShowSearch = 6;
};

[scriptable, uuid(64852276-1dd2-11b2-8103-afe12002c053)]
interface nsMsgViewFlagsType
{
  /**
   * flags for GetViewFlags
   */
  const nsMsgViewFlagsTypeValue kNone = 0x0;
  const nsMsgViewFlagsTypeValue kThreadedDisplay = 0x1;
  const nsMsgViewFlagsTypeValue kShowIgnored = 0x8;
  const nsMsgViewFlagsTypeValue kUnreadOnly = 0x10;
  const nsMsgViewFlagsTypeValue kExpandAll = 0x20;
  const nsMsgViewFlagsTypeValue kGroupBySort = 0x40;
};

[scriptable, uuid(e8fdf9ca-9425-49de-b231-8d8fb51b8ee2)]
interface nsMsgViewSortType
{
  const nsMsgViewSortTypeValue byNone = 0x11; /* not sorted */
  const nsMsgViewSortTypeValue byDate = 0x12;
  const nsMsgViewSortTypeValue bySubject = 0x13;
  const nsMsgViewSortTypeValue byAuthor = 0x14;
  const nsMsgViewSortTypeValue byId = 0x15;
  const nsMsgViewSortTypeValue byThread = 0x16;
  const nsMsgViewSortTypeValue byPriority = 0x17;
  const nsMsgViewSortTypeValue byStatus = 0x18;
  const nsMsgViewSortTypeValue bySize = 0x19;
  const nsMsgViewSortTypeValue byFlagged = 0x1a;
  const nsMsgViewSortTypeValue byUnread = 0x1b;
  const nsMsgViewSortTypeValue byRecipient = 0x1c;
  const nsMsgViewSortTypeValue byLocation = 0x1d;
  const nsMsgViewSortTypeValue byTags = 0x1e;
  const nsMsgViewSortTypeValue byJunkStatus = 0x1f;
  const nsMsgViewSortTypeValue byAttachments = 0x20;
  const nsMsgViewSortTypeValue byAccount = 0x21;
  const nsMsgViewSortTypeValue byCustom = 0x22;
  const nsMsgViewSortTypeValue byReceived = 0x23;
};

[scriptable, uuid(255d1c1e-fde7-11d4-a5be-0060b0fc04b7)]
interface nsMsgViewNotificationCode
{
  const nsMsgViewNotificationCodeValue none = 0;        
  /* No change; this call is just being used to potentially nest other sets of calls
     inside it.  The "where" and "num" parameters are unused. 
   */
  const nsMsgViewNotificationCodeValue insertOrDelete = 1;    
  /* Some lines have been inserted or deleted.
     The "where" parameter will indicate the first line that has been added or
     removed; the "num" parameter will indicate how many lines, and will be positive on
     an insertion and negative on a deletion. 
   */
  const nsMsgViewNotificationCodeValue changed = 2;      
  /* Some lines have had their contents changed (e.g., messages have been marked read
    or something.)  "where" indicates the first line with a change; "num" indicates
    how many chaged. 
   */
 const nsMsgViewNotificationCodeValue  scramble = 3;  
 /* Everything changed.  Probably means we resorted the folder.  We are still working
    with the same set of items, or at least have some overlap, but all the indices are
    invalid.  The "where" and "num" parameters are unused. 
  */
  const nsMsgViewNotificationCodeValue all = 4;
  /* Everything changed.  We're now not displaying anything like what we were; we
     probably opened a new folder or something. The FE needs to forget anything it ever knew
     about what was being displayed, and start over.  The "where" and "num" parameters are
     unused.  
   */
  const nsMsgViewNotificationCodeValue totalContentChanged = 5;
  /* Introduced for the address book to support virtual list views.  The total number of
      entries on the LDAP directory has changed and the FE must update its scrollbar.  The
      "num" parameter contains the total number of entries on the LDAP server. 
   */
  const nsMsgViewNotificationCodeValue newTopIndex = 6;        
  /* Introduced for the address book to support virtual list views.  The virtual list view
     cache data has changed and the FE view may be out of date.  The view should be updated
     so that the first/top index in the view is the index in the "where" parameter.  The
     scrollbar should be updated to match the new position. 
   */

};

[scriptable, uuid(4ec9248e-0108-11d5-a5be-0060b0fc04b7)]
interface nsMsgViewCommandCheckState
{
  const nsMsgViewCommandCheckStateValue notUsed = 0;
  const nsMsgViewCommandCheckStateValue checked = 1;
  const nsMsgViewCommandCheckStateValue unchecked = 2;
};

[scriptable, uuid(ad36e6cc-0109-11d5-a5be-0060b0fc04b7)]
interface nsMsgViewCommandType
{
  const nsMsgViewCommandTypeValue markMessagesRead = 0;
  const nsMsgViewCommandTypeValue markMessagesUnread = 1;
  const nsMsgViewCommandTypeValue toggleMessageRead = 2;
                   
  const nsMsgViewCommandTypeValue flagMessages = 3;
  const nsMsgViewCommandTypeValue unflagMessages = 4;

  const nsMsgViewCommandTypeValue toggleThreadWatched = 6;

  const nsMsgViewCommandTypeValue deleteMsg = 7;
  const nsMsgViewCommandTypeValue deleteNoTrash = 8;
  const nsMsgViewCommandTypeValue markThreadRead = 9;
  const nsMsgViewCommandTypeValue markAllRead = 10;
  const nsMsgViewCommandTypeValue expandAll = 11;
  const nsMsgViewCommandTypeValue collapseAll = 12;
  
  const nsMsgViewCommandTypeValue copyMessages = 13;
  const nsMsgViewCommandTypeValue moveMessages = 14;

  const nsMsgViewCommandTypeValue selectAll = 15;
  const nsMsgViewCommandTypeValue downloadSelectedForOffline = 16;
  const nsMsgViewCommandTypeValue downloadFlaggedForOffline = 17;

  const nsMsgViewCommandTypeValue selectThread = 18;
  const nsMsgViewCommandTypeValue selectFlagged = 19;
  const nsMsgViewCommandTypeValue cmdRequiringMsgBody = 20;
  const nsMsgViewCommandTypeValue label0 = 21;
  const nsMsgViewCommandTypeValue label1 = 22;
  const nsMsgViewCommandTypeValue label2 = 23;
  const nsMsgViewCommandTypeValue label3 = 24;
  const nsMsgViewCommandTypeValue label4 = 25;
  const nsMsgViewCommandTypeValue label5 = 26;
  const nsMsgViewCommandTypeValue lastLabel = 26;

  const nsMsgViewCommandTypeValue junk = 27;
  const nsMsgViewCommandTypeValue unjunk = 28;
  const nsMsgViewCommandTypeValue undeleteMsg = 29;

  const nsMsgViewCommandTypeValue applyFilters = 30;
  const nsMsgViewCommandTypeValue runJunkControls = 31;
  const nsMsgViewCommandTypeValue deleteJunk = 32;
};

[scriptable, uuid(65903eb2-1dd2-11b2-ac45-c5b69c1618d7)]
interface nsMsgNavigationType
{
  const nsMsgNavigationTypeValue firstMessage = 1;
  const nsMsgNavigationTypeValue nextMessage = 2;
  const nsMsgNavigationTypeValue previousMessage = 3;
  const nsMsgNavigationTypeValue lastMessage = 4;
  /**
   * must match nsMsgViewCommandTypeValue toggleThreadKilled
   */
  const nsMsgNavigationTypeValue toggleThreadKilled = 5;
  const nsMsgNavigationTypeValue firstUnreadMessage = 6;
  const nsMsgNavigationTypeValue nextUnreadMessage = 7;
  const nsMsgNavigationTypeValue previousUnreadMessage = 8;
  const nsMsgNavigationTypeValue lastUnreadMessage = 9;
  const nsMsgNavigationTypeValue nextUnreadThread = 10;
  const nsMsgNavigationTypeValue nextUnreadFolder = 11;
  const nsMsgNavigationTypeValue nextFolder = 12;
  const nsMsgNavigationTypeValue readMore = 13;
  /**
   * Go back to the previous visited message
   */
  const nsMsgNavigationTypeValue back = 15;
  /**
   * Go forward to the previous visited message 
   */
  const nsMsgNavigationTypeValue forward = 16;
  const nsMsgNavigationTypeValue firstFlagged = 17;
  const nsMsgNavigationTypeValue nextFlagged = 18;
  const nsMsgNavigationTypeValue previousFlagged = 19;
  const nsMsgNavigationTypeValue firstNew = 20;
  const nsMsgNavigationTypeValue editUndo = 21;
  const nsMsgNavigationTypeValue editRedo = 22;
  const nsMsgNavigationTypeValue toggleSubthreadKilled = 23;
};


[scriptable, uuid(de4c3458-5222-4cf5-b883-0c42aad848e6)]
interface nsIMsgDBView : nsISupports
{
  void open(in nsIMsgFolder folder, in nsMsgViewSortTypeValue sortType, in nsMsgViewSortOrderValue sortOrder, in nsMsgViewFlagsTypeValue viewFlags, out long count);
  void openWithHdrs(in nsISimpleEnumerator aHeaders, in nsMsgViewSortTypeValue aSortType, 
                      in nsMsgViewSortOrderValue aSortOrder, 
                      in nsMsgViewFlagsTypeValue aViewFlags, out long aCount);
  void close();

  void init(in nsIMessenger aMessengerInstance, in nsIMsgWindow aMsgWindow, in nsIMsgDBViewCommandUpdater aCommandUpdater);

  void sort(in nsMsgViewSortTypeValue sortType, in nsMsgViewSortOrderValue sortOrder);

  void doCommand(in nsMsgViewCommandTypeValue command);
  void doCommandWithFolder(in nsMsgViewCommandTypeValue command, in nsIMsgFolder destFolder);
  void getCommandStatus(in nsMsgViewCommandTypeValue command, out boolean selectable_p, 
                        out nsMsgViewCommandCheckStateValue selected_p);

  readonly attribute nsMsgViewTypeValue viewType;
  attribute nsMsgViewFlagsTypeValue viewFlags;
  attribute nsMsgViewSortTypeValue sortType;
  readonly attribute nsMsgViewSortOrderValue sortOrder;
  readonly attribute nsMsgKey keyForFirstSelectedMessage;
  readonly attribute nsMsgViewIndex viewIndexForFirstSelectedMsg;
  /**
   * this method will automatically expand the destination thread, 
   * if needs be. 
   */
  void viewNavigate(in nsMsgNavigationTypeValue motion, out nsMsgKey resultId, out nsMsgViewIndex resultIndex, out nsMsgViewIndex threadIndex, in boolean wrap);

  /**
   * Indicates if navigation of the passed motion type is valid. 
   */
  boolean navigateStatus(in nsMsgNavigationTypeValue motion);

  readonly attribute nsIMsgFolder msgFolder;
  attribute nsIMsgFolder viewFolder; // in the case of virtual folders, the VF db.

  nsMsgKey getKeyAt(in nsMsgViewIndex index);
  nsIMsgFolder getFolderForViewIndex(in nsMsgViewIndex index); // mainly for search
  ACString getURIForViewIndex(in nsMsgViewIndex index);
  nsIMsgDBView cloneDBView(in nsIMessenger aMessengerInstance, in nsIMsgWindow aMsgWindow, in nsIMsgDBViewCommandUpdater aCommandUpdater);
  void getURIsForSelection(out unsigned long count, [retval, array, size_is(count)] out string uris);
  void getIndicesForSelection(out unsigned long count, [retval, array, size_is(count)] out nsMsgViewIndex indices);

  readonly attribute ACString URIForFirstSelectedMessage;
  readonly attribute nsIMsgDBHdr hdrForFirstSelectedMessage;
  void loadMessageByMsgKey(in nsMsgKey aMsgKey);
  void loadMessageByViewIndex(in nsMsgViewIndex aIndex);
  void loadMessageByUrl(in string aUrl);
  void reloadMessage();
  void reloadMessageWithAllParts();

  readonly attribute unsigned long numSelected;
  readonly attribute nsMsgViewIndex msgToSelectAfterDelete; 
  readonly attribute nsMsgViewIndex currentlyDisplayedMessage; 

  // used by "go to folder" feature
  // and "remember last selected message" feature
  // if key is not found, we don't select.
  void selectMsgByKey(in nsMsgKey key);

  void selectFolderMsgByKey(in nsIMsgFolder aFolder, in nsMsgKey aKey);
  // we'll suppress displaying messages if the message pane is collapsed
  attribute boolean suppressMsgDisplay;

  // we'll suppress command updating during folder loading
  attribute boolean suppressCommandUpdating;

  //to notify tree that rows are going away
  void onDeleteCompleted(in boolean succeeded);

  readonly attribute nsIMsgDatabase db;

  readonly attribute boolean supportsThreading;

  attribute nsIMsgSearchSession searchSession;
  readonly attribute boolean removeRowOnMoveOrDelete; 

  nsMsgViewIndex findIndexFromKey(in nsMsgKey aMsgKey, in boolean aExpand);
  void ExpandAndSelectThreadByIndex(in nsMsgViewIndex aIndex, in boolean aAugment);

  // use lines or kB for size?
  readonly attribute boolean usingLines;
  
  // Custom Column Implementation note: see nsIMsgCustomColumnHandler
  
  // attaches a custom column handler to a specific column (can be a new column or a built in)
  void addColumnHandler(in AString aColumn, in nsIMsgCustomColumnHandler aHandler);
  
  // removes a custom column handler leaving the column to be handled by the system
  void removeColumnHandler(in AString aColumn);
  
  // returns the custom column handler attached to a specific column - if any
  nsIMsgCustomColumnHandler getColumnHandler(in AString aColumn);
};

/* this interface is rapidly morphing from a command updater interface into a more generic
   FE updater interface to handle changes in the view 
*/

[scriptable, uuid(65FC9AD5-0912-11d5-9901-001083010E9B)]
interface nsIMsgDBViewCommandUpdater : nsISupports
{
  /* Eventually we'll flush this out into some kind of rich interface
  which may take specifc selection changed type notifications like
  no selections, single selection, multi-selection, etc. For starters,
  we are going to keep it generic. The back end will only push an update
  command status when the # of selected items changes.
  */

  void updateCommandStatus();

  /* displayed message has changed */
  void displayMessageChanged(in nsIMsgFolder aFolder, in AString aSubject, in ACString aKeywords);

  /**
  * allows the backend to tell the front end to re-determine 
  * which message we should selet after a delete or move
  */
  void updateNextMessageAfterDelete();
};