From 0dbaa4f83f200cc68edbe1c41b2116daaded2dd9 Mon Sep 17 00:00:00 2001 From: "hyatt%netscape.com" Date: Wed, 14 Feb 2001 19:44:38 +0000 Subject: [PATCH] Not part of build. --- .../outliner/public/nsIOutlinerSelection.idl | 4 ++++ .../src/outliner/src/nsOutlinerSelection.cpp | 23 +++++++++++++++---- .../src/outliner/src/nsOutlinerSelection.h | 3 +++ .../base/src/tree/public/nsITreeSelection.idl | 4 ++++ .../xul/base/src/tree/src/nsTreeSelection.cpp | 23 +++++++++++++++---- .../xul/base/src/tree/src/nsTreeSelection.h | 3 +++ 6 files changed, 52 insertions(+), 8 deletions(-) diff --git a/layout/xul/base/src/outliner/public/nsIOutlinerSelection.idl b/layout/xul/base/src/outliner/public/nsIOutlinerSelection.idl index 0e439888fffc..067996524fc8 100644 --- a/layout/xul/base/src/outliner/public/nsIOutlinerSelection.idl +++ b/layout/xul/base/src/outliner/public/nsIOutlinerSelection.idl @@ -54,6 +54,10 @@ interface nsIOutlinerSelection : nsISupports // Selects all rows. void selectAll(); + // Iterate the selection using these methods. + long getRangeCount(); + void getRangeAt(in long i, out long min, out long max); + // This attribute is a boolean indicating whether or not the // "select" event should fire when the selection is changed using // one of our methods. A view can use this to temporarily suppress diff --git a/layout/xul/base/src/outliner/src/nsOutlinerSelection.cpp b/layout/xul/base/src/outliner/src/nsOutlinerSelection.cpp index 22edc26ccedf..1b7ae93ab53d 100644 --- a/layout/xul/base/src/outliner/src/nsOutlinerSelection.cpp +++ b/layout/xul/base/src/outliner/src/nsOutlinerSelection.cpp @@ -29,6 +29,7 @@ nsOutlinerSelection::nsOutlinerSelection(nsIOutlinerBoxObject* aOutliner) { NS_INIT_ISUPPORTS(); mOutliner = aOutliner; + mSuppressed = PR_FALSE; } nsOutlinerSelection::~nsOutlinerSelection() @@ -85,24 +86,38 @@ NS_IMETHODIMP nsOutlinerSelection::SelectAll() return NS_ERROR_NOT_IMPLEMENTED; } -NS_IMETHODIMP nsOutlinerSelection::GetSelectEventsSuppressed(PRBool *aSelectEventsSuppressed) +NS_IMETHODIMP nsOutlinerSelection::GetRangeCount(PRInt32 *_retval) { return NS_ERROR_NOT_IMPLEMENTED; } +NS_IMETHODIMP nsOutlinerSelection::GetRangeAt(PRInt32 i, PRInt32 *min, PRInt32 *max) +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + +NS_IMETHODIMP nsOutlinerSelection::GetSelectEventsSuppressed(PRBool *aSelectEventsSuppressed) +{ + *aSelectEventsSuppressed = mSuppressed; + return NS_OK; +} + NS_IMETHODIMP nsOutlinerSelection::SetSelectEventsSuppressed(PRBool aSelectEventsSuppressed) { - return NS_ERROR_NOT_IMPLEMENTED; + mSuppressed = aSelectEventsSuppressed; + return NS_OK; } NS_IMETHODIMP nsOutlinerSelection::GetCurrentIndex(PRInt32 *aCurrentIndex) { - return NS_ERROR_NOT_IMPLEMENTED; + *aCurrentIndex = mCurrentIndex; + return NS_OK; } NS_IMETHODIMP nsOutlinerSelection::SetCurrentIndex(PRInt32 aCurrentIndex) { - return NS_ERROR_NOT_IMPLEMENTED; + mCurrentIndex = aCurrentIndex; + return NS_OK; } /////////////////////////////////////////////////////////////////////////////////// diff --git a/layout/xul/base/src/outliner/src/nsOutlinerSelection.h b/layout/xul/base/src/outliner/src/nsOutlinerSelection.h index bea75c429c5e..a33a9dbdd693 100644 --- a/layout/xul/base/src/outliner/src/nsOutlinerSelection.h +++ b/layout/xul/base/src/outliner/src/nsOutlinerSelection.h @@ -39,6 +39,9 @@ public: protected: // Members nsIOutlinerBoxObject* mOutliner; // [Weak]. The outliner will hold on to us through the view and let go when it dies. + + PRBool mSuppressed; // Whether or not we should be firing onselect events. + PRInt32 mCurrentIndex; // The item to draw the rect around. The last one clicked, etc. }; extern nsresult diff --git a/layout/xul/base/src/tree/public/nsITreeSelection.idl b/layout/xul/base/src/tree/public/nsITreeSelection.idl index 0e439888fffc..067996524fc8 100644 --- a/layout/xul/base/src/tree/public/nsITreeSelection.idl +++ b/layout/xul/base/src/tree/public/nsITreeSelection.idl @@ -54,6 +54,10 @@ interface nsIOutlinerSelection : nsISupports // Selects all rows. void selectAll(); + // Iterate the selection using these methods. + long getRangeCount(); + void getRangeAt(in long i, out long min, out long max); + // This attribute is a boolean indicating whether or not the // "select" event should fire when the selection is changed using // one of our methods. A view can use this to temporarily suppress diff --git a/layout/xul/base/src/tree/src/nsTreeSelection.cpp b/layout/xul/base/src/tree/src/nsTreeSelection.cpp index 22edc26ccedf..1b7ae93ab53d 100644 --- a/layout/xul/base/src/tree/src/nsTreeSelection.cpp +++ b/layout/xul/base/src/tree/src/nsTreeSelection.cpp @@ -29,6 +29,7 @@ nsOutlinerSelection::nsOutlinerSelection(nsIOutlinerBoxObject* aOutliner) { NS_INIT_ISUPPORTS(); mOutliner = aOutliner; + mSuppressed = PR_FALSE; } nsOutlinerSelection::~nsOutlinerSelection() @@ -85,24 +86,38 @@ NS_IMETHODIMP nsOutlinerSelection::SelectAll() return NS_ERROR_NOT_IMPLEMENTED; } -NS_IMETHODIMP nsOutlinerSelection::GetSelectEventsSuppressed(PRBool *aSelectEventsSuppressed) +NS_IMETHODIMP nsOutlinerSelection::GetRangeCount(PRInt32 *_retval) { return NS_ERROR_NOT_IMPLEMENTED; } +NS_IMETHODIMP nsOutlinerSelection::GetRangeAt(PRInt32 i, PRInt32 *min, PRInt32 *max) +{ + return NS_ERROR_NOT_IMPLEMENTED; +} + +NS_IMETHODIMP nsOutlinerSelection::GetSelectEventsSuppressed(PRBool *aSelectEventsSuppressed) +{ + *aSelectEventsSuppressed = mSuppressed; + return NS_OK; +} + NS_IMETHODIMP nsOutlinerSelection::SetSelectEventsSuppressed(PRBool aSelectEventsSuppressed) { - return NS_ERROR_NOT_IMPLEMENTED; + mSuppressed = aSelectEventsSuppressed; + return NS_OK; } NS_IMETHODIMP nsOutlinerSelection::GetCurrentIndex(PRInt32 *aCurrentIndex) { - return NS_ERROR_NOT_IMPLEMENTED; + *aCurrentIndex = mCurrentIndex; + return NS_OK; } NS_IMETHODIMP nsOutlinerSelection::SetCurrentIndex(PRInt32 aCurrentIndex) { - return NS_ERROR_NOT_IMPLEMENTED; + mCurrentIndex = aCurrentIndex; + return NS_OK; } /////////////////////////////////////////////////////////////////////////////////// diff --git a/layout/xul/base/src/tree/src/nsTreeSelection.h b/layout/xul/base/src/tree/src/nsTreeSelection.h index bea75c429c5e..a33a9dbdd693 100644 --- a/layout/xul/base/src/tree/src/nsTreeSelection.h +++ b/layout/xul/base/src/tree/src/nsTreeSelection.h @@ -39,6 +39,9 @@ public: protected: // Members nsIOutlinerBoxObject* mOutliner; // [Weak]. The outliner will hold on to us through the view and let go when it dies. + + PRBool mSuppressed; // Whether or not we should be firing onselect events. + PRInt32 mCurrentIndex; // The item to draw the rect around. The last one clicked, etc. }; extern nsresult