From afcf9816d8a2fa47047a9a0b1d35c9599b0422bb Mon Sep 17 00:00:00 2001 From: "brade%netscape.com" Date: Mon, 5 Feb 2001 15:42:58 +0000 Subject: [PATCH] add coordinate enums, rename GetWindowCoordinates to GetCaretCoordinates; r=kin; sr=sfraser git-svn-id: svn://10.0.0.236/trunk@86229 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/base/nsICaret.h | 12 +++++++++--- mozilla/layout/base/public/nsICaret.h | 12 +++++++++--- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/mozilla/layout/base/nsICaret.h b/mozilla/layout/base/nsICaret.h index b1b550b1937..36e2920ce18 100644 --- a/mozilla/layout/base/nsICaret.h +++ b/mozilla/layout/base/nsICaret.h @@ -42,6 +42,12 @@ class nsICaret: public nsISupports public: static const nsIID& GetIID() { static nsIID iid = NS_ICARET_IID; return iid; } + typedef enum EViewCoordinates { + eTopLevelWindowCoordinates, + eRenderingViewCoordinates, + eClosestViewCoordinates + } EViewCoordinates; + NS_IMETHOD Init(nsIPresShell *inPresShell) = 0; NS_IMETHOD SetCaretDOMSelection(nsISelection *aDOMSel) = 0; @@ -62,14 +68,14 @@ public: */ NS_IMETHOD SetCaretReadOnly(PRBool inMakeReadonly) = 0; - /** GetWindowRelativeCoordinates - * Get the position of the caret in (top-level) window coordinates. + /** GetCaretCoordinates + * Get the position of the caret in coordinates relative to the typed specified (aRelativeToType). * If the selection is collapsed, this returns the caret location * and true in outIsCollapsed. * If the selection is not collapsed, this returns the location of the focus pos, * and false in outIsCollapsed. */ - NS_IMETHOD GetWindowRelativeCoordinates(nsRect& outCoordinates, PRBool& outIsCollapsed, nsISelection *aDOMSel) = 0; + NS_IMETHOD GetCaretCoordinates(EViewCoordinates aRelativeToType, nsISelection *aDOMSel, nsRect *outCoordinates, PRBool *outIsCollapsed) = 0; /** ClearFrameRefs * The caret stores a reference to the frame that the caret was last drawn in. diff --git a/mozilla/layout/base/public/nsICaret.h b/mozilla/layout/base/public/nsICaret.h index b1b550b1937..36e2920ce18 100644 --- a/mozilla/layout/base/public/nsICaret.h +++ b/mozilla/layout/base/public/nsICaret.h @@ -42,6 +42,12 @@ class nsICaret: public nsISupports public: static const nsIID& GetIID() { static nsIID iid = NS_ICARET_IID; return iid; } + typedef enum EViewCoordinates { + eTopLevelWindowCoordinates, + eRenderingViewCoordinates, + eClosestViewCoordinates + } EViewCoordinates; + NS_IMETHOD Init(nsIPresShell *inPresShell) = 0; NS_IMETHOD SetCaretDOMSelection(nsISelection *aDOMSel) = 0; @@ -62,14 +68,14 @@ public: */ NS_IMETHOD SetCaretReadOnly(PRBool inMakeReadonly) = 0; - /** GetWindowRelativeCoordinates - * Get the position of the caret in (top-level) window coordinates. + /** GetCaretCoordinates + * Get the position of the caret in coordinates relative to the typed specified (aRelativeToType). * If the selection is collapsed, this returns the caret location * and true in outIsCollapsed. * If the selection is not collapsed, this returns the location of the focus pos, * and false in outIsCollapsed. */ - NS_IMETHOD GetWindowRelativeCoordinates(nsRect& outCoordinates, PRBool& outIsCollapsed, nsISelection *aDOMSel) = 0; + NS_IMETHOD GetCaretCoordinates(EViewCoordinates aRelativeToType, nsISelection *aDOMSel, nsRect *outCoordinates, PRBool *outIsCollapsed) = 0; /** ClearFrameRefs * The caret stores a reference to the frame that the caret was last drawn in.