36 mTreeSelection(aTreeSelection),
39 NS_ASSERTION(aTreeSelection,
"Null passed to ctor");
43 sbFilterTreeSelection::GetTree(nsITreeBoxObject** aTree)
45 return mTreeSelection->GetTree(aTree);
48 sbFilterTreeSelection::SetTree(nsITreeBoxObject* aTree)
50 return mTreeSelection->SetTree(aTree);
54 sbFilterTreeSelection::GetSingle(PRBool* aSingle)
56 return mTreeSelection->GetSingle(aSingle);
60 sbFilterTreeSelection::GetCount(PRInt32*
aCount)
62 return mTreeSelection->GetCount(aCount);
66 sbFilterTreeSelection::IsSelected(PRInt32 index, PRBool* _retval)
68 return mTreeSelection->IsSelected(index, _retval);
76 nsresult rv = mTreeSelection->Select(index);
77 NS_ENSURE_SUCCESS(rv, rv);
79 rv = CheckIsSelectAll();
80 NS_ENSURE_SUCCESS(rv, rv);
86 sbFilterTreeSelection::TimedSelect(PRInt32 index, PRInt32 delay)
88 nsresult rv = mTreeSelection->TimedSelect(index, delay);
89 NS_ENSURE_SUCCESS(rv, rv);
91 rv = CheckIsSelectAll();
92 NS_ENSURE_SUCCESS(rv, rv);
98 sbFilterTreeSelection::ToggleSelect(PRInt32 index)
102 nsresult rv = mTreeSelection->ToggleSelect(index);
103 NS_ENSURE_SUCCESS(rv, rv);
105 rv = CheckIsSelectAll();
106 NS_ENSURE_SUCCESS(rv, rv);
112 sbFilterTreeSelection::RangedSelect(PRInt32 startIndex,
118 nsresult rv = mTreeSelection->RangedSelect(startIndex, endIndex, augment);
119 NS_ENSURE_SUCCESS(rv, rv);
121 rv = CheckIsSelectAll();
122 NS_ENSURE_SUCCESS(rv, rv);
128 sbFilterTreeSelection::ClearRange(PRInt32 startIndex,
133 nsresult rv = mTreeSelection->ClearRange(startIndex, endIndex);
134 NS_ENSURE_SUCCESS(rv, rv);
136 rv = CheckIsSelectAll();
137 NS_ENSURE_SUCCESS(rv, rv);
143 sbFilterTreeSelection::ClearSelection()
147 nsresult rv = mTreeSelection->ClearSelection();
148 NS_ENSURE_SUCCESS(rv, rv);
150 rv = CheckIsSelectAll();
151 NS_ENSURE_SUCCESS(rv, rv);
157 sbFilterTreeSelection::InvertSelection()
159 return NS_ERROR_NOT_IMPLEMENTED;
163 sbFilterTreeSelection::SelectAll()
167 nsresult rv = mTreeSelection->Select(0);
168 NS_ENSURE_SUCCESS(rv, rv);
170 rv = CheckIsSelectAll();
171 NS_ENSURE_SUCCESS(rv, rv);
177 sbFilterTreeSelection::GetRangeCount(PRInt32* _retval)
179 return mTreeSelection->GetRangeCount(_retval);
183 sbFilterTreeSelection::GetRangeAt(PRInt32
i,
187 return mTreeSelection->GetRangeAt(i, min, max);
191 sbFilterTreeSelection::InvalidateSelection()
193 return mTreeSelection->InvalidateSelection();
197 sbFilterTreeSelection::AdjustSelection(PRInt32 index, PRInt32
count)
205 if (index != 0 && count != -1) {
206 rv = mTreeSelection->AdjustSelection(index, count);
207 NS_ENSURE_SUCCESS(rv, rv);
210 rv = CheckIsSelectAll();
211 NS_ENSURE_SUCCESS(rv, rv);
217 sbFilterTreeSelection::GetSelectEventsSuppressed(PRBool* aSelectEventsSuppressed)
219 return mTreeSelection->GetSelectEventsSuppressed(aSelectEventsSuppressed);
222 sbFilterTreeSelection::SetSelectEventsSuppressed(PRBool aSelectEventsSuppressed)
224 return mTreeSelection->SetSelectEventsSuppressed(aSelectEventsSuppressed);
228 sbFilterTreeSelection::GetCurrentIndex(PRInt32* aCurrentIndex)
230 return mTreeSelection->GetCurrentIndex(aCurrentIndex);
233 sbFilterTreeSelection::SetCurrentIndex(PRInt32 aCurrentIndex)
235 return mTreeSelection->SetCurrentIndex(aCurrentIndex);
239 sbFilterTreeSelection::GetCurrentColumn(nsITreeColumn** aCurrentColumn)
241 return mTreeSelection->GetCurrentColumn(aCurrentColumn);
244 sbFilterTreeSelection::SetCurrentColumn(nsITreeColumn* aCurrentColumn)
246 return mTreeSelection->SetCurrentColumn(aCurrentColumn);
250 sbFilterTreeSelection::GetShiftSelectPivot(PRInt32* aShiftSelectPivot)
252 return mTreeSelection->GetShiftSelectPivot(aShiftSelectPivot);
256 sbFilterTreeSelection::CheckIsSelectAll()
261 rv = mTreeView->GetRowCount(&rowCount);
262 NS_ENSURE_SUCCESS(rv, rv);
264 PRInt32 selectedCount;
265 rv = mTreeSelection->GetCount(&selectedCount);
266 NS_ENSURE_SUCCESS(rv, rv);
268 PRBool isAllRowSelected;
269 rv = mTreeSelection->IsSelected(0, &isAllRowSelected);
270 NS_ENSURE_SUCCESS(rv, rv);
281 selectedCount == 0 ||
282 selectedCount == rowCount;
286 rv = mTreeSelection->Select(0);
287 NS_ENSURE_SUCCESS(rv, rv);
290 mTreeView->SetSelectionIsAll(isSelectAll);
NS_IMPL_ISUPPORTS1(sbFilterTreeSelection, nsITreeSelection) sbFilterTreeSelection
restoreHistoryPrecursor aCount
_getSelectedPageStyle s i