add coordinate enums, rename GetWindowCoordinates to GetCaretCoordinates; r=kin; sr=sfraser

This commit is contained in:
brade%netscape.com 2001-02-05 15:42:58 +00:00
parent 742a52ea53
commit ddfe62df42
2 changed files with 18 additions and 6 deletions

View File

@ -42,6 +42,12 @@ class nsICaret: public nsISupports
public: public:
static const nsIID& GetIID() { static nsIID iid = NS_ICARET_IID; return iid; } 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 Init(nsIPresShell *inPresShell) = 0;
NS_IMETHOD SetCaretDOMSelection(nsISelection *aDOMSel) = 0; NS_IMETHOD SetCaretDOMSelection(nsISelection *aDOMSel) = 0;
@ -62,14 +68,14 @@ public:
*/ */
NS_IMETHOD SetCaretReadOnly(PRBool inMakeReadonly) = 0; NS_IMETHOD SetCaretReadOnly(PRBool inMakeReadonly) = 0;
/** GetWindowRelativeCoordinates /** GetCaretCoordinates
* Get the position of the caret in (top-level) window coordinates. * Get the position of the caret in coordinates relative to the typed specified (aRelativeToType).
* If the selection is collapsed, this returns the caret location * If the selection is collapsed, this returns the caret location
* and true in outIsCollapsed. * and true in outIsCollapsed.
* If the selection is not collapsed, this returns the location of the focus pos, * If the selection is not collapsed, this returns the location of the focus pos,
* and false in outIsCollapsed. * 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 /** ClearFrameRefs
* The caret stores a reference to the frame that the caret was last drawn in. * The caret stores a reference to the frame that the caret was last drawn in.

View File

@ -42,6 +42,12 @@ class nsICaret: public nsISupports
public: public:
static const nsIID& GetIID() { static nsIID iid = NS_ICARET_IID; return iid; } 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 Init(nsIPresShell *inPresShell) = 0;
NS_IMETHOD SetCaretDOMSelection(nsISelection *aDOMSel) = 0; NS_IMETHOD SetCaretDOMSelection(nsISelection *aDOMSel) = 0;
@ -62,14 +68,14 @@ public:
*/ */
NS_IMETHOD SetCaretReadOnly(PRBool inMakeReadonly) = 0; NS_IMETHOD SetCaretReadOnly(PRBool inMakeReadonly) = 0;
/** GetWindowRelativeCoordinates /** GetCaretCoordinates
* Get the position of the caret in (top-level) window coordinates. * Get the position of the caret in coordinates relative to the typed specified (aRelativeToType).
* If the selection is collapsed, this returns the caret location * If the selection is collapsed, this returns the caret location
* and true in outIsCollapsed. * and true in outIsCollapsed.
* If the selection is not collapsed, this returns the location of the focus pos, * If the selection is not collapsed, this returns the location of the focus pos,
* and false in outIsCollapsed. * 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 /** ClearFrameRefs
* The caret stores a reference to the frame that the caret was last drawn in. * The caret stores a reference to the frame that the caret was last drawn in.