Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | interface nsITreeBoxObject; |
michael@0 | 7 | interface nsITreeColumn; |
michael@0 | 8 | |
michael@0 | 9 | #include "nsISupports.idl" |
michael@0 | 10 | |
michael@0 | 11 | [scriptable, uuid(ab6fe746-300b-4ab4-abb9-1c0e3977874c)] |
michael@0 | 12 | interface nsITreeSelection : nsISupports |
michael@0 | 13 | { |
michael@0 | 14 | /** |
michael@0 | 15 | * The tree widget for this selection. |
michael@0 | 16 | */ |
michael@0 | 17 | attribute nsITreeBoxObject tree; |
michael@0 | 18 | |
michael@0 | 19 | /** |
michael@0 | 20 | * This attribute is a boolean indicating single selection. |
michael@0 | 21 | */ |
michael@0 | 22 | readonly attribute boolean single; |
michael@0 | 23 | |
michael@0 | 24 | /** |
michael@0 | 25 | * The number of rows currently selected in this tree. |
michael@0 | 26 | */ |
michael@0 | 27 | readonly attribute long count; |
michael@0 | 28 | |
michael@0 | 29 | /** |
michael@0 | 30 | * Indicates whether or not the row at the specified index is |
michael@0 | 31 | * part of the selection. |
michael@0 | 32 | */ |
michael@0 | 33 | boolean isSelected(in long index); |
michael@0 | 34 | |
michael@0 | 35 | /** |
michael@0 | 36 | * Deselect all rows and select the row at the specified index. |
michael@0 | 37 | */ |
michael@0 | 38 | void select(in long index); |
michael@0 | 39 | |
michael@0 | 40 | /** |
michael@0 | 41 | * Perform a timed select. |
michael@0 | 42 | */ |
michael@0 | 43 | void timedSelect(in long index, in long delay); |
michael@0 | 44 | |
michael@0 | 45 | /** |
michael@0 | 46 | * Toggle the selection state of the row at the specified index. |
michael@0 | 47 | */ |
michael@0 | 48 | void toggleSelect(in long index); |
michael@0 | 49 | |
michael@0 | 50 | /** |
michael@0 | 51 | * Select the range specified by the indices. If augment is true, |
michael@0 | 52 | * then we add the range to the selection without clearing out anything |
michael@0 | 53 | * else. If augment is false, everything is cleared except for the specified range. |
michael@0 | 54 | */ |
michael@0 | 55 | void rangedSelect(in long startIndex, in long endIndex, in boolean augment); |
michael@0 | 56 | |
michael@0 | 57 | /** |
michael@0 | 58 | * Clears the range. |
michael@0 | 59 | */ |
michael@0 | 60 | void clearRange(in long startIndex, in long endIndex); |
michael@0 | 61 | |
michael@0 | 62 | /** |
michael@0 | 63 | * Clears the selection. |
michael@0 | 64 | */ |
michael@0 | 65 | void clearSelection(); |
michael@0 | 66 | |
michael@0 | 67 | /** |
michael@0 | 68 | * Inverts the selection. |
michael@0 | 69 | */ |
michael@0 | 70 | void invertSelection(); |
michael@0 | 71 | |
michael@0 | 72 | /** |
michael@0 | 73 | * Selects all rows. |
michael@0 | 74 | */ |
michael@0 | 75 | void selectAll(); |
michael@0 | 76 | |
michael@0 | 77 | /** |
michael@0 | 78 | * Iterate the selection using these methods. |
michael@0 | 79 | */ |
michael@0 | 80 | long getRangeCount(); |
michael@0 | 81 | void getRangeAt(in long i, out long min, out long max); |
michael@0 | 82 | |
michael@0 | 83 | /** |
michael@0 | 84 | * Can be used to invalidate the selection. |
michael@0 | 85 | */ |
michael@0 | 86 | void invalidateSelection(); |
michael@0 | 87 | |
michael@0 | 88 | /** |
michael@0 | 89 | * Called when the row count changes to adjust selection indices. |
michael@0 | 90 | */ |
michael@0 | 91 | void adjustSelection(in long index, in long count); |
michael@0 | 92 | |
michael@0 | 93 | /** |
michael@0 | 94 | * This attribute is a boolean indicating whether or not the |
michael@0 | 95 | * "select" event should fire when the selection is changed using |
michael@0 | 96 | * one of our methods. A view can use this to temporarily suppress |
michael@0 | 97 | * the selection while manipulating all of the indices, e.g., on |
michael@0 | 98 | * a sort. |
michael@0 | 99 | * Note: setting this attribute to false will fire a select event. |
michael@0 | 100 | */ |
michael@0 | 101 | attribute boolean selectEventsSuppressed; |
michael@0 | 102 | |
michael@0 | 103 | /** |
michael@0 | 104 | * The current item (the one that gets a focus rect in addition to being |
michael@0 | 105 | * selected). |
michael@0 | 106 | */ |
michael@0 | 107 | attribute long currentIndex; |
michael@0 | 108 | |
michael@0 | 109 | /** |
michael@0 | 110 | * The current column. |
michael@0 | 111 | */ |
michael@0 | 112 | attribute nsITreeColumn currentColumn; |
michael@0 | 113 | |
michael@0 | 114 | /** |
michael@0 | 115 | * The selection "pivot". This is the first item the user selected as |
michael@0 | 116 | * part of a ranged select. |
michael@0 | 117 | */ |
michael@0 | 118 | readonly attribute long shiftSelectPivot; |
michael@0 | 119 | }; |
michael@0 | 120 | |
michael@0 | 121 | /** |
michael@0 | 122 | * The following interface is not scriptable and MUST NEVER BE MADE scriptable. |
michael@0 | 123 | * Native treeselections implement it, and we use this to check whether a |
michael@0 | 124 | * treeselection is native (and therefore suitable for use by untrusted content). |
michael@0 | 125 | */ |
michael@0 | 126 | [uuid(1bd59678-5cb3-4316-b246-31a91b19aabe)] |
michael@0 | 127 | interface nsINativeTreeSelection : nsITreeSelection |
michael@0 | 128 | { |
michael@0 | 129 | [noscript] void ensureNative(); |
michael@0 | 130 | }; |