2012-05-21 11:12:37 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2006-04-26 02:01:07 +00:00
|
|
|
|
|
|
|
#ifndef nsFrameSelection_h___
|
|
|
|
#define nsFrameSelection_h___
|
2011-11-21 06:21:16 +00:00
|
|
|
|
2011-12-19 18:48:15 +00:00
|
|
|
#include "mozilla/Attributes.h"
|
2013-09-25 11:21:18 +00:00
|
|
|
#include "mozilla/EventForwards.h"
|
2013-02-15 21:32:19 +00:00
|
|
|
#include "mozilla/Selection.h"
|
2013-10-22 13:27:36 +00:00
|
|
|
#include "mozilla/TextRange.h"
|
2006-04-26 02:01:07 +00:00
|
|
|
#include "nsIFrame.h"
|
|
|
|
#include "nsIContent.h"
|
|
|
|
#include "nsISelectionController.h"
|
|
|
|
#include "nsITableCellLayout.h"
|
|
|
|
#include "nsIDOMElement.h"
|
2012-01-10 14:19:54 +00:00
|
|
|
#include "nsRange.h"
|
2006-04-26 02:01:07 +00:00
|
|
|
|
2012-08-08 13:05:17 +00:00
|
|
|
class nsTableOuterFrame;
|
|
|
|
|
2006-04-26 02:01:07 +00:00
|
|
|
// IID for the nsFrameSelection interface
|
2009-09-10 03:06:54 +00:00
|
|
|
// 3c6ae2d0-4cf1-44a1-9e9d-2411867f19c6
|
2006-04-26 02:01:07 +00:00
|
|
|
#define NS_FRAME_SELECTION_IID \
|
2009-09-10 03:06:54 +00:00
|
|
|
{ 0x3c6ae2d0, 0x4cf1, 0x44a1, \
|
|
|
|
{ 0x9e, 0x9d, 0x24, 0x11, 0x86, 0x7f, 0x19, 0xc6 } }
|
2006-08-08 05:14:52 +00:00
|
|
|
|
|
|
|
#ifdef IBMBIDI // Constant for Set/Get CaretBidiLevel
|
|
|
|
#define BIDI_LEVEL_UNDEFINED 0x80
|
|
|
|
#endif
|
2006-04-26 02:01:07 +00:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
|
|
|
|
// Selection interface
|
|
|
|
|
|
|
|
struct SelectionDetails
|
|
|
|
{
|
2008-08-07 21:05:19 +00:00
|
|
|
#ifdef NS_BUILD_REFCNT_LOGGING
|
|
|
|
SelectionDetails() {
|
|
|
|
MOZ_COUNT_CTOR(SelectionDetails);
|
|
|
|
}
|
|
|
|
~SelectionDetails() {
|
|
|
|
MOZ_COUNT_DTOR(SelectionDetails);
|
|
|
|
}
|
|
|
|
#endif
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t mStart;
|
|
|
|
int32_t mEnd;
|
2006-04-26 02:01:07 +00:00
|
|
|
SelectionType mType;
|
2013-10-01 07:22:59 +00:00
|
|
|
mozilla::TextRangeStyle mTextRangeStyle;
|
2006-04-26 02:01:07 +00:00
|
|
|
SelectionDetails *mNext;
|
|
|
|
};
|
|
|
|
|
|
|
|
class nsIPresShell;
|
2009-09-03 05:23:47 +00:00
|
|
|
class nsIScrollableFrame;
|
2006-04-26 02:01:07 +00:00
|
|
|
|
2006-07-11 22:11:02 +00:00
|
|
|
enum EWordMovementType { eStartWord, eEndWord, eDefaultBehavior };
|
|
|
|
|
2006-07-13 06:06:29 +00:00
|
|
|
/** PeekOffsetStruct is used to group various arguments (both input and output)
|
|
|
|
* that are passed to nsFrame::PeekOffset(). See below for the description of
|
|
|
|
* individual arguments.
|
|
|
|
*/
|
2013-04-12 03:20:45 +00:00
|
|
|
struct MOZ_STACK_CLASS nsPeekOffsetStruct
|
2006-04-26 02:01:07 +00:00
|
|
|
{
|
2012-03-26 16:09:38 +00:00
|
|
|
nsPeekOffsetStruct(nsSelectionAmount aAmount,
|
|
|
|
nsDirection aDirection,
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t aStartOffset,
|
2012-03-26 16:09:38 +00:00
|
|
|
nscoord aDesiredX,
|
|
|
|
bool aJumpLines,
|
|
|
|
bool aScrollViewStop,
|
|
|
|
bool aIsKeyboardSelect,
|
|
|
|
bool aVisual,
|
|
|
|
EWordMovementType aWordMovementType = eDefaultBehavior)
|
|
|
|
: mAmount(aAmount)
|
|
|
|
, mDirection(aDirection)
|
|
|
|
, mStartOffset(aStartOffset)
|
|
|
|
, mDesiredX(aDesiredX)
|
|
|
|
, mWordMovementType(aWordMovementType)
|
|
|
|
, mJumpLines(aJumpLines)
|
|
|
|
, mScrollViewStop(aScrollViewStop)
|
|
|
|
, mIsKeyboardSelect(aIsKeyboardSelect)
|
|
|
|
, mVisual(aVisual)
|
|
|
|
, mResultContent()
|
2012-07-30 14:20:58 +00:00
|
|
|
, mResultFrame(nullptr)
|
2012-03-26 16:09:38 +00:00
|
|
|
, mContentOffset(0)
|
|
|
|
, mAttachForward(false)
|
2006-07-13 06:06:29 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
// Note: Most arguments (input and output) are only used with certain values
|
|
|
|
// of mAmount. These values are indicated for each argument below.
|
|
|
|
// Arguments with no such indication are used with all values of mAmount.
|
|
|
|
|
|
|
|
/*** Input arguments ***/
|
|
|
|
// Note: The value of some of the input arguments may be changed upon exit.
|
|
|
|
|
|
|
|
// mAmount: The type of movement requested (by character, word, line, etc.)
|
2006-04-26 02:01:07 +00:00
|
|
|
nsSelectionAmount mAmount;
|
2006-07-13 06:06:29 +00:00
|
|
|
|
|
|
|
// mDirection: eDirPrevious or eDirNext.
|
2006-09-11 20:43:01 +00:00
|
|
|
// * Note for visual bidi movement:
|
|
|
|
// eDirPrevious means 'left-then-up' if the containing block is LTR,
|
|
|
|
// 'right-then-up' if it is RTL.
|
|
|
|
// eDirNext means 'right-then-down' if the containing block is LTR,
|
|
|
|
// 'left-then-down' if it is RTL.
|
|
|
|
// Between paragraphs, eDirPrevious means "go to the visual end of the
|
|
|
|
// previous paragraph", and eDirNext means "go to the visual beginning
|
|
|
|
// of the next paragraph".
|
2006-07-13 06:06:29 +00:00
|
|
|
// Used with: eSelectCharacter, eSelectWord, eSelectLine, eSelectParagraph.
|
2006-04-26 02:01:07 +00:00
|
|
|
nsDirection mDirection;
|
2006-07-13 06:06:29 +00:00
|
|
|
|
|
|
|
// mStartOffset: Offset into the content of the current frame where the peek starts.
|
|
|
|
// Used with: eSelectCharacter, eSelectWord
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t mStartOffset;
|
2006-07-13 06:06:29 +00:00
|
|
|
|
|
|
|
// mDesiredX: The desired x coordinate for the caret.
|
|
|
|
// Used with: eSelectLine.
|
|
|
|
nscoord mDesiredX;
|
|
|
|
|
2009-08-10 07:47:11 +00:00
|
|
|
// mWordMovementType: An enum that determines whether to prefer the start or end of a word
|
|
|
|
// or to use the default beahvior, which is a combination of
|
|
|
|
// direction and the platform-based pref
|
|
|
|
// "layout.word_select.eat_space_to_next_word"
|
|
|
|
EWordMovementType mWordMovementType;
|
|
|
|
|
2006-07-13 06:06:29 +00:00
|
|
|
// mJumpLines: Whether to allow jumping across line boundaries.
|
|
|
|
// Used with: eSelectCharacter, eSelectWord.
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mJumpLines;
|
2006-07-13 06:06:29 +00:00
|
|
|
|
|
|
|
// mScrollViewStop: Whether to stop when reaching a scroll view boundary.
|
|
|
|
// Used with: eSelectCharacter, eSelectWord, eSelectLine.
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mScrollViewStop;
|
2006-07-13 06:06:29 +00:00
|
|
|
|
|
|
|
// mIsKeyboardSelect: Whether the peeking is done in response to a keyboard action.
|
|
|
|
// Used with: eSelectWord.
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mIsKeyboardSelect;
|
2006-07-13 06:06:29 +00:00
|
|
|
|
2011-10-17 14:59:28 +00:00
|
|
|
// mVisual: Whether bidi caret behavior is visual (true) or logical (false).
|
2006-08-03 06:24:11 +00:00
|
|
|
// Used with: eSelectCharacter, eSelectWord, eSelectBeginLine, eSelectEndLine.
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mVisual;
|
2006-07-13 06:06:29 +00:00
|
|
|
|
|
|
|
/*** Output arguments ***/
|
|
|
|
|
|
|
|
// mResultContent: Content reached as a result of the peek.
|
|
|
|
nsCOMPtr<nsIContent> mResultContent;
|
|
|
|
|
|
|
|
// mResultFrame: Frame reached as a result of the peek.
|
|
|
|
// Used with: eSelectCharacter, eSelectWord.
|
|
|
|
nsIFrame *mResultFrame;
|
|
|
|
|
2009-08-10 07:47:11 +00:00
|
|
|
// mContentOffset: Offset into content reached as a result of the peek.
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t mContentOffset;
|
2009-08-10 07:47:11 +00:00
|
|
|
|
2006-07-13 06:06:29 +00:00
|
|
|
// mAttachForward: When the result position is between two frames,
|
|
|
|
// indicates which of the two frames the caret should be painted in.
|
2011-10-17 14:59:28 +00:00
|
|
|
// false means "the end of the frame logically before the caret",
|
|
|
|
// true means "the beginning of the frame logically after the caret".
|
2006-07-13 06:06:29 +00:00
|
|
|
// Used with: eSelectLine, eSelectBeginLine, eSelectEndLine.
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mAttachForward;
|
2006-04-26 02:01:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct nsPrevNextBidiLevels
|
|
|
|
{
|
|
|
|
void SetData(nsIFrame* aFrameBefore,
|
|
|
|
nsIFrame* aFrameAfter,
|
2012-08-22 15:56:38 +00:00
|
|
|
uint8_t aLevelBefore,
|
|
|
|
uint8_t aLevelAfter)
|
2006-04-26 02:01:07 +00:00
|
|
|
{
|
|
|
|
mFrameBefore = aFrameBefore;
|
|
|
|
mFrameAfter = aFrameAfter;
|
|
|
|
mLevelBefore = aLevelBefore;
|
|
|
|
mLevelAfter = aLevelAfter;
|
|
|
|
}
|
|
|
|
nsIFrame* mFrameBefore;
|
|
|
|
nsIFrame* mFrameAfter;
|
2012-08-22 15:56:38 +00:00
|
|
|
uint8_t mLevelBefore;
|
|
|
|
uint8_t mLevelAfter;
|
2006-04-26 02:01:07 +00:00
|
|
|
};
|
|
|
|
|
2012-06-10 23:44:50 +00:00
|
|
|
namespace mozilla {
|
|
|
|
class Selection;
|
|
|
|
}
|
2009-09-03 05:23:47 +00:00
|
|
|
class nsIScrollableFrame;
|
2006-04-26 02:01:07 +00:00
|
|
|
|
2007-11-22 20:47:33 +00:00
|
|
|
/**
|
|
|
|
* Methods which are marked with *unsafe* should be handled with special care.
|
|
|
|
* They may cause nsFrameSelection to be deleted, if strong pointer isn't used,
|
|
|
|
* or they may cause other objects to be deleted.
|
|
|
|
*/
|
|
|
|
|
2013-02-15 21:32:19 +00:00
|
|
|
class nsFrameSelection MOZ_FINAL {
|
2006-04-26 02:01:07 +00:00
|
|
|
public:
|
|
|
|
enum HINT { HINTLEFT = 0, HINTRIGHT = 1}; //end of this line or beginning of next
|
|
|
|
/*interfaces for addref and release and queryinterface*/
|
|
|
|
|
2013-02-15 21:32:19 +00:00
|
|
|
NS_INLINE_DECL_CYCLE_COLLECTING_NATIVE_REFCOUNTING(nsFrameSelection)
|
|
|
|
NS_DECL_CYCLE_COLLECTION_NATIVE_CLASS(nsFrameSelection)
|
2006-04-26 02:01:07 +00:00
|
|
|
|
|
|
|
/** Init will initialize the frame selector with the necessary pres shell to
|
|
|
|
* be used by most of the methods
|
|
|
|
* @param aShell is the parameter to be used for most of the other calls for callbacks etc
|
|
|
|
* @param aLimiter limits the selection to nodes with aLimiter parents
|
|
|
|
*/
|
|
|
|
void Init(nsIPresShell *aShell, nsIContent *aLimiter);
|
|
|
|
|
|
|
|
/** HandleClick will take the focus to the new frame at the new offset and
|
|
|
|
* will either extend the selection from the old anchor, or replace the old anchor.
|
|
|
|
* the old anchor and focus position may also be used to deselect things
|
|
|
|
* @param aNewfocus is the content that wants the focus
|
|
|
|
* @param aContentOffset is the content offset of the parent aNewFocus
|
|
|
|
* @param aContentOffsetEnd is the content offset of the parent aNewFocus and is specified different
|
|
|
|
* when you need to select to and include both start and end points
|
|
|
|
* @param aContinueSelection is the flag that tells the selection to keep the old anchor point or not.
|
|
|
|
* @param aMultipleSelection will tell the frame selector to replace /or not the old selection.
|
|
|
|
* cannot coexist with aContinueSelection
|
|
|
|
* @param aHint will tell the selection which direction geometrically to actually show the caret on.
|
|
|
|
* 1 = end of this line 0 = beginning of this line
|
|
|
|
*/
|
2007-11-22 20:47:33 +00:00
|
|
|
/*unsafe*/
|
2006-04-26 02:01:07 +00:00
|
|
|
nsresult HandleClick(nsIContent *aNewFocus,
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t aContentOffset,
|
|
|
|
uint32_t aContentEndOffset,
|
2011-09-29 06:19:26 +00:00
|
|
|
bool aContinueSelection,
|
|
|
|
bool aMultipleSelection,
|
|
|
|
bool aHint);
|
2006-04-26 02:01:07 +00:00
|
|
|
|
|
|
|
/** HandleDrag extends the selection to contain the frame closest to aPoint.
|
|
|
|
* @param aPresContext is the context to use when figuring out what frame contains the point.
|
|
|
|
* @param aFrame is the parent of all frames to use when searching for the closest frame to the point.
|
|
|
|
* @param aPoint is relative to aFrame
|
|
|
|
*/
|
2007-11-22 20:47:33 +00:00
|
|
|
/*unsafe*/
|
2006-04-26 02:01:07 +00:00
|
|
|
void HandleDrag(nsIFrame *aFrame, nsPoint aPoint);
|
|
|
|
|
|
|
|
/** HandleTableSelection will set selection to a table, cell, etc
|
|
|
|
* depending on information contained in aFlags
|
|
|
|
* @param aParentContent is the paretent of either a table or cell that user clicked or dragged the mouse in
|
|
|
|
* @param aContentOffset is the offset of the table or cell
|
|
|
|
* @param aTarget indicates what to select (defined in nsISelectionPrivate.idl/nsISelectionPrivate.h):
|
|
|
|
* TABLESELECTION_CELL We should select a cell (content points to the cell)
|
|
|
|
* TABLESELECTION_ROW We should select a row (content points to any cell in row)
|
|
|
|
* TABLESELECTION_COLUMN We should select a row (content points to any cell in column)
|
|
|
|
* TABLESELECTION_TABLE We should select a table (content points to the table)
|
|
|
|
* TABLESELECTION_ALLCELLS We should select all cells (content points to any cell in table)
|
|
|
|
* @param aMouseEvent passed in so we can get where event occurred and what keys are pressed
|
|
|
|
*/
|
2007-11-22 20:47:33 +00:00
|
|
|
/*unsafe*/
|
2013-10-02 06:38:27 +00:00
|
|
|
nsresult HandleTableSelection(nsINode* aParentContent,
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t aContentOffset,
|
|
|
|
int32_t aTarget,
|
2013-10-02 06:38:27 +00:00
|
|
|
mozilla::WidgetMouseEvent* aMouseEvent);
|
2006-04-26 02:01:07 +00:00
|
|
|
|
2009-09-10 03:06:54 +00:00
|
|
|
/**
|
|
|
|
* Add cell to the selection.
|
|
|
|
*
|
|
|
|
* @param aCell [in] HTML td element.
|
|
|
|
*/
|
|
|
|
virtual nsresult SelectCellElement(nsIContent *aCell);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Add cells to the selection inside of the given cells range.
|
|
|
|
*
|
|
|
|
* @param aTable [in] HTML table element
|
|
|
|
* @param aStartRowIndex [in] row index where the cells range starts
|
|
|
|
* @param aStartColumnIndex [in] column index where the cells range starts
|
|
|
|
* @param aEndRowIndex [in] row index where the cells range ends
|
|
|
|
* @param aEndColumnIndex [in] column index where the cells range ends
|
|
|
|
*/
|
|
|
|
virtual nsresult AddCellsToSelection(nsIContent *aTable,
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t aStartRowIndex,
|
|
|
|
int32_t aStartColumnIndex,
|
|
|
|
int32_t aEndRowIndex,
|
|
|
|
int32_t aEndColumnIndex);
|
2009-09-10 03:06:54 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Remove cells from selection inside of the given cell range.
|
|
|
|
*
|
|
|
|
* @param aTable [in] HTML table element
|
|
|
|
* @param aStartRowIndex [in] row index where the cells range starts
|
|
|
|
* @param aStartColumnIndex [in] column index where the cells range starts
|
|
|
|
* @param aEndRowIndex [in] row index where the cells range ends
|
|
|
|
* @param aEndColumnIndex [in] column index where the cells range ends
|
|
|
|
*/
|
|
|
|
virtual nsresult RemoveCellsFromSelection(nsIContent *aTable,
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t aStartRowIndex,
|
|
|
|
int32_t aStartColumnIndex,
|
|
|
|
int32_t aEndRowIndex,
|
|
|
|
int32_t aEndColumnIndex);
|
2009-09-10 03:06:54 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Remove cells from selection outside of the given cell range.
|
|
|
|
*
|
|
|
|
* @param aTable [in] HTML table element
|
|
|
|
* @param aStartRowIndex [in] row index where the cells range starts
|
|
|
|
* @param aStartColumnIndex [in] column index where the cells range starts
|
|
|
|
* @param aEndRowIndex [in] row index where the cells range ends
|
|
|
|
* @param aEndColumnIndex [in] column index where the cells range ends
|
|
|
|
*/
|
|
|
|
virtual nsresult RestrictCellsToSelection(nsIContent *aTable,
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t aStartRowIndex,
|
|
|
|
int32_t aStartColumnIndex,
|
|
|
|
int32_t aEndRowIndex,
|
|
|
|
int32_t aEndColumnIndex);
|
2009-09-10 03:06:54 +00:00
|
|
|
|
2009-09-10 05:16:18 +00:00
|
|
|
/** StartAutoScrollTimer is responsible for scrolling frames so that
|
|
|
|
* aPoint is always visible, and for selecting any frame that contains
|
|
|
|
* aPoint. The timer will also reset itself to fire again if we have
|
|
|
|
* not scrolled to the end of the document.
|
|
|
|
* @param aFrame is the outermost frame to use when searching for
|
|
|
|
* the closest frame for the point, i.e. the frame that is capturing
|
|
|
|
* the mouse
|
|
|
|
* @param aPoint is relative to aFrame.
|
2006-04-26 02:01:07 +00:00
|
|
|
* @param aDelay is the timer's interval.
|
|
|
|
*/
|
2008-12-07 23:11:37 +00:00
|
|
|
/*unsafe*/
|
2009-09-10 05:16:18 +00:00
|
|
|
nsresult StartAutoScrollTimer(nsIFrame *aFrame,
|
2006-04-26 02:01:07 +00:00
|
|
|
nsPoint aPoint,
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t aDelay);
|
2006-04-26 02:01:07 +00:00
|
|
|
|
|
|
|
/** StopAutoScrollTimer stops any active auto scroll timer.
|
|
|
|
*/
|
|
|
|
void StopAutoScrollTimer();
|
|
|
|
|
|
|
|
/** Lookup Selection
|
|
|
|
* returns in frame coordinates the selection beginning and ending with the type of selection given
|
|
|
|
* @param aContent is the content asking
|
|
|
|
* @param aContentOffset is the starting content boundary
|
|
|
|
* @param aContentLength is the length of the content piece asking
|
|
|
|
* @param aReturnDetails linkedlist of return values for the selection.
|
|
|
|
* @param aSlowCheck will check using slow method with no shortcuts
|
|
|
|
*/
|
|
|
|
SelectionDetails* LookUpSelection(nsIContent *aContent,
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t aContentOffset,
|
|
|
|
int32_t aContentLength,
|
2011-09-29 06:19:26 +00:00
|
|
|
bool aSlowCheck) const;
|
2006-04-26 02:01:07 +00:00
|
|
|
|
2011-09-29 06:19:26 +00:00
|
|
|
/** SetMouseDownState(bool);
|
2006-04-26 02:01:07 +00:00
|
|
|
* sets the mouse state to aState for resons of drag state.
|
|
|
|
* @param aState is the new state of mousedown
|
|
|
|
*/
|
2007-11-22 20:47:33 +00:00
|
|
|
/*unsafe*/
|
2011-09-29 06:19:26 +00:00
|
|
|
void SetMouseDownState(bool aState);
|
2006-04-26 02:01:07 +00:00
|
|
|
|
2011-09-29 06:19:26 +00:00
|
|
|
/** GetMouseDownState(bool *);
|
2006-04-26 02:01:07 +00:00
|
|
|
* gets the mouse state to aState for resons of drag state.
|
|
|
|
* @param aState will hold the state of mousedown
|
|
|
|
*/
|
2011-09-29 06:19:26 +00:00
|
|
|
bool GetMouseDownState() const { return mMouseDownState; }
|
2006-04-26 02:01:07 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
if we are in table cell selection mode. aka ctrl click in table cell
|
|
|
|
*/
|
2011-09-29 06:19:26 +00:00
|
|
|
bool GetTableCellSelection() const { return mSelectingTableCellMode != 0; }
|
2007-11-22 20:47:33 +00:00
|
|
|
void ClearTableCellSelection() { mSelectingTableCellMode = 0; }
|
2006-04-26 02:01:07 +00:00
|
|
|
|
|
|
|
/** GetSelection
|
|
|
|
* no query interface for selection. must use this method now.
|
|
|
|
* @param aSelectionType enum value defined in nsISelection for the seleciton you want.
|
|
|
|
*/
|
2012-06-10 23:44:50 +00:00
|
|
|
mozilla::Selection* GetSelection(SelectionType aType) const;
|
2006-04-26 02:01:07 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* ScrollSelectionIntoView scrolls a region of the selection,
|
|
|
|
* so that it is visible in the scrolled view.
|
|
|
|
*
|
|
|
|
* @param aType the selection to scroll into view.
|
|
|
|
* @param aRegion the region inside the selection to scroll into view.
|
2010-10-21 20:56:20 +00:00
|
|
|
* @param aFlags the scroll flags. Valid bits include:
|
|
|
|
* SCROLL_SYNCHRONOUS: when set, scrolls the selection into view
|
|
|
|
* before returning. If not set, posts a request which is processed
|
|
|
|
* at some point after the method returns.
|
|
|
|
* SCROLL_FIRST_ANCESTOR_ONLY: if set, only the first ancestor will be scrolled
|
|
|
|
* into view.
|
2006-04-26 02:01:07 +00:00
|
|
|
*/
|
2008-12-07 23:11:37 +00:00
|
|
|
/*unsafe*/
|
2006-04-26 02:01:07 +00:00
|
|
|
nsresult ScrollSelectionIntoView(SelectionType aType,
|
|
|
|
SelectionRegion aRegion,
|
2012-08-22 15:56:38 +00:00
|
|
|
int16_t aFlags) const;
|
2006-04-26 02:01:07 +00:00
|
|
|
|
|
|
|
/** RepaintSelection repaints the selected frames that are inside the selection
|
|
|
|
* specified by aSelectionType.
|
|
|
|
* @param aSelectionType enum value defined in nsISelection for the seleciton you want.
|
|
|
|
*/
|
2007-11-22 20:47:33 +00:00
|
|
|
nsresult RepaintSelection(SelectionType aType) const;
|
2006-04-26 02:01:07 +00:00
|
|
|
|
|
|
|
/** GetFrameForNodeOffset given a node and its child offset, return the nsIFrame and
|
|
|
|
* the offset into that frame.
|
|
|
|
* @param aNode input parameter for the node to look at
|
|
|
|
* @param aOffset offset into above node.
|
|
|
|
* @param aReturnOffset will contain offset into frame.
|
|
|
|
*/
|
2007-12-11 14:15:21 +00:00
|
|
|
virtual nsIFrame* GetFrameForNodeOffset(nsIContent *aNode,
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t aOffset,
|
2007-12-11 14:15:21 +00:00
|
|
|
HINT aHint,
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t *aReturnOffset) const;
|
2006-04-26 02:01:07 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Scrolling then moving caret placement code in common to text areas and
|
|
|
|
* content areas should be located in the implementer
|
|
|
|
* This method will accept the following parameters and perform the scroll
|
|
|
|
* and caret movement. It remains for the caller to call the final
|
|
|
|
* ScrollCaretIntoView if that called wants to be sure the caret is always
|
|
|
|
* visible.
|
|
|
|
*
|
2011-10-17 14:59:28 +00:00
|
|
|
* @param aForward if true, scroll forward if not scroll backward
|
|
|
|
* @param aExtend if true, extend selection to the new point
|
2009-09-03 05:23:47 +00:00
|
|
|
* @param aScrollableFrame the frame to scroll
|
2006-04-26 02:01:07 +00:00
|
|
|
*/
|
2007-11-22 20:47:33 +00:00
|
|
|
/*unsafe*/
|
2011-09-29 06:19:26 +00:00
|
|
|
void CommonPageMove(bool aForward,
|
|
|
|
bool aExtend,
|
2009-09-03 05:23:47 +00:00
|
|
|
nsIScrollableFrame* aScrollableFrame);
|
2006-04-26 02:01:07 +00:00
|
|
|
|
|
|
|
void SetHint(HINT aHintRight) { mHint = aHintRight; }
|
2007-11-22 20:47:33 +00:00
|
|
|
HINT GetHint() const { return mHint; }
|
2006-08-08 05:14:52 +00:00
|
|
|
|
|
|
|
#ifdef IBMBIDI
|
|
|
|
/** SetCaretBidiLevel sets the caret bidi level
|
|
|
|
* @param aLevel the caret bidi level
|
|
|
|
* This method is virtual since it gets called from outside of layout.
|
|
|
|
*/
|
2012-08-22 15:56:38 +00:00
|
|
|
virtual void SetCaretBidiLevel (uint8_t aLevel);
|
2006-08-08 05:14:52 +00:00
|
|
|
/** GetCaretBidiLevel gets the caret bidi level
|
|
|
|
* This method is virtual since it gets called from outside of layout.
|
|
|
|
*/
|
2012-08-22 15:56:38 +00:00
|
|
|
virtual uint8_t GetCaretBidiLevel() const;
|
2006-08-08 05:14:52 +00:00
|
|
|
/** UndefineCaretBidiLevel sets the caret bidi level to "undefined"
|
|
|
|
* This method is virtual since it gets called from outside of layout.
|
|
|
|
*/
|
|
|
|
virtual void UndefineCaretBidiLevel();
|
|
|
|
#endif
|
2006-04-26 02:01:07 +00:00
|
|
|
|
|
|
|
/** CharacterMove will generally be called from the nsiselectioncontroller implementations.
|
|
|
|
* the effect being the selection will move one character left or right.
|
|
|
|
* @param aForward move forward in document.
|
|
|
|
* @param aExtend continue selection
|
|
|
|
*/
|
2007-11-22 20:47:33 +00:00
|
|
|
/*unsafe*/
|
2011-09-29 06:19:26 +00:00
|
|
|
nsresult CharacterMove(bool aForward, bool aExtend);
|
2006-04-26 02:01:07 +00:00
|
|
|
|
2008-10-16 07:44:32 +00:00
|
|
|
/** CharacterExtendForDelete extends the selection forward (logically) to
|
|
|
|
* the next character cell, so that the selected cell can be deleted.
|
|
|
|
*/
|
|
|
|
/*unsafe*/
|
|
|
|
nsresult CharacterExtendForDelete();
|
|
|
|
|
2010-06-04 17:28:19 +00:00
|
|
|
/** CharacterExtendForBackspace extends the selection backward (logically) to
|
|
|
|
* the previous character cell, so that the selected cell can be deleted.
|
|
|
|
*/
|
|
|
|
/*unsafe*/
|
|
|
|
nsresult CharacterExtendForBackspace();
|
|
|
|
|
2006-04-26 02:01:07 +00:00
|
|
|
/** WordMove will generally be called from the nsiselectioncontroller implementations.
|
|
|
|
* the effect being the selection will move one word left or right.
|
|
|
|
* @param aForward move forward in document.
|
|
|
|
* @param aExtend continue selection
|
|
|
|
*/
|
2007-11-22 20:47:33 +00:00
|
|
|
/*unsafe*/
|
2011-09-29 06:19:26 +00:00
|
|
|
nsresult WordMove(bool aForward, bool aExtend);
|
2006-04-26 02:01:07 +00:00
|
|
|
|
2006-07-18 07:28:38 +00:00
|
|
|
/** WordExtendForDelete extends the selection backward or forward (logically) to the
|
|
|
|
* next word boundary, so that the selected word can be deleted.
|
|
|
|
* @param aForward select forward in document.
|
|
|
|
*/
|
2007-11-22 20:47:33 +00:00
|
|
|
/*unsafe*/
|
2011-09-29 06:19:26 +00:00
|
|
|
nsresult WordExtendForDelete(bool aForward);
|
2006-07-18 07:28:38 +00:00
|
|
|
|
2006-04-26 02:01:07 +00:00
|
|
|
/** LineMove will generally be called from the nsiselectioncontroller implementations.
|
|
|
|
* the effect being the selection will move one line up or down.
|
|
|
|
* @param aForward move forward in document.
|
|
|
|
* @param aExtend continue selection
|
|
|
|
*/
|
2007-11-22 20:47:33 +00:00
|
|
|
/*unsafe*/
|
2011-09-29 06:19:26 +00:00
|
|
|
nsresult LineMove(bool aForward, bool aExtend);
|
2006-04-26 02:01:07 +00:00
|
|
|
|
|
|
|
/** IntraLineMove will generally be called from the nsiselectioncontroller implementations.
|
|
|
|
* the effect being the selection will move to beginning or end of line
|
|
|
|
* @param aForward move forward in document.
|
|
|
|
* @param aExtend continue selection
|
|
|
|
*/
|
2007-11-22 20:47:33 +00:00
|
|
|
/*unsafe*/
|
2011-09-29 06:19:26 +00:00
|
|
|
nsresult IntraLineMove(bool aForward, bool aExtend);
|
2006-04-26 02:01:07 +00:00
|
|
|
|
|
|
|
/** Select All will generally be called from the nsiselectioncontroller implementations.
|
|
|
|
* it will select the whole doc
|
|
|
|
*/
|
2007-11-22 20:47:33 +00:00
|
|
|
/*unsafe*/
|
2006-04-26 02:01:07 +00:00
|
|
|
nsresult SelectAll();
|
|
|
|
|
|
|
|
/** Sets/Gets The display selection enum.
|
|
|
|
*/
|
2012-08-22 15:56:38 +00:00
|
|
|
void SetDisplaySelection(int16_t aState) { mDisplaySelection = aState; }
|
|
|
|
int16_t GetDisplaySelection() const { return mDisplaySelection; }
|
2006-04-26 02:01:07 +00:00
|
|
|
|
2006-12-16 14:40:44 +00:00
|
|
|
/** This method can be used to store the data received during a MouseDown
|
|
|
|
* event so that we can place the caret during the MouseUp event.
|
2006-04-26 02:01:07 +00:00
|
|
|
* @aMouseEvent the event received by the selection MouseDown
|
2013-10-08 18:47:21 +00:00
|
|
|
* handling method. A nullptr value can be use to tell this method
|
2006-04-26 02:01:07 +00:00
|
|
|
* that any data is storing is no longer valid.
|
|
|
|
*/
|
2013-10-02 06:38:27 +00:00
|
|
|
void SetDelayedCaretData(mozilla::WidgetMouseEvent* aMouseEvent);
|
2006-04-26 02:01:07 +00:00
|
|
|
|
|
|
|
/** Get the delayed MouseDown event data necessary to place the
|
|
|
|
* caret during MouseUp processing.
|
|
|
|
* @return a pointer to the event received
|
2013-10-08 18:47:21 +00:00
|
|
|
* by the selection during MouseDown processing. It can be nullptr
|
2006-04-26 02:01:07 +00:00
|
|
|
* if the data is no longer valid.
|
|
|
|
*/
|
2012-05-24 10:36:08 +00:00
|
|
|
bool HasDelayedCaretData() { return mDelayedMouseEventValid; }
|
|
|
|
bool IsShiftDownInDelayedCaretData()
|
|
|
|
{
|
|
|
|
NS_ASSERTION(mDelayedMouseEventValid, "No valid delayed caret data");
|
|
|
|
return mDelayedMouseEventIsShift;
|
|
|
|
}
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t GetClickCountInDelayedCaretData()
|
2012-05-24 10:36:08 +00:00
|
|
|
{
|
|
|
|
NS_ASSERTION(mDelayedMouseEventValid, "No valid delayed caret data");
|
|
|
|
return mDelayedMouseEventClickCount;
|
|
|
|
}
|
2006-04-26 02:01:07 +00:00
|
|
|
|
|
|
|
/** Get the content node that limits the selection
|
|
|
|
* When searching up a nodes for parents, as in a text edit field
|
|
|
|
* in an browser page, we must stop at this node else we reach into the
|
|
|
|
* parent page, which is very bad!
|
|
|
|
*/
|
2007-11-22 20:47:33 +00:00
|
|
|
nsIContent* GetLimiter() const { return mLimiter; }
|
2006-04-26 02:01:07 +00:00
|
|
|
|
2007-11-22 20:47:33 +00:00
|
|
|
nsIContent* GetAncestorLimiter() const { return mAncestorLimiter; }
|
|
|
|
/*unsafe*/
|
2007-06-28 02:48:16 +00:00
|
|
|
void SetAncestorLimiter(nsIContent *aLimiter);
|
|
|
|
|
2006-04-26 02:01:07 +00:00
|
|
|
/** This will tell the frame selection that a double click has been pressed
|
|
|
|
* so it can track abort future drags if inside the same selection
|
|
|
|
* @aDoubleDown has the double click down happened
|
|
|
|
*/
|
2011-09-29 06:19:26 +00:00
|
|
|
void SetMouseDoubleDown(bool aDoubleDown) { mMouseDoubleDownState = aDoubleDown; }
|
2006-04-26 02:01:07 +00:00
|
|
|
|
|
|
|
/** This will return whether the double down flag was set.
|
|
|
|
* @return whether the double down flag was set
|
|
|
|
*/
|
2011-09-29 06:19:26 +00:00
|
|
|
bool GetMouseDoubleDown() const { return mMouseDoubleDownState; }
|
2006-04-26 02:01:07 +00:00
|
|
|
|
|
|
|
/** GetPrevNextBidiLevels will return the frames and associated Bidi levels of the characters
|
|
|
|
* logically before and after a (collapsed) selection.
|
|
|
|
* @param aNode is the node containing the selection
|
|
|
|
* @param aContentOffset is the offset of the selection in the node
|
2011-10-17 14:59:28 +00:00
|
|
|
* @param aJumpLines If true, look across line boundaries.
|
|
|
|
* If false, behave as if there were base-level frames at line edges.
|
2006-04-26 02:01:07 +00:00
|
|
|
*
|
|
|
|
* @return A struct holding the before/after frame and the before/after level.
|
|
|
|
*
|
|
|
|
* At the beginning and end of each line there is assumed to be a frame with
|
|
|
|
* Bidi level equal to the paragraph embedding level.
|
|
|
|
* In these cases the before frame and after frame respectively will be
|
2012-07-30 14:20:58 +00:00
|
|
|
* nullptr.
|
2006-04-26 02:01:07 +00:00
|
|
|
*
|
|
|
|
* This method is virtual since it gets called from outside of layout.
|
|
|
|
*/
|
|
|
|
virtual nsPrevNextBidiLevels GetPrevNextBidiLevels(nsIContent *aNode,
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t aContentOffset,
|
2011-09-29 06:19:26 +00:00
|
|
|
bool aJumpLines) const;
|
2006-04-26 02:01:07 +00:00
|
|
|
|
|
|
|
/** GetFrameFromLevel will scan in a given direction
|
|
|
|
* until it finds a frame with a Bidi level less than or equal to a given level.
|
|
|
|
* It will return the last frame before this.
|
|
|
|
* @param aPresContext is the context to use
|
|
|
|
* @param aFrameIn is the frame to start from
|
|
|
|
* @param aDirection is the direction to scan
|
|
|
|
* @param aBidiLevel is the level to search for
|
|
|
|
* @param aFrameOut will hold the frame returned
|
|
|
|
*/
|
|
|
|
nsresult GetFrameFromLevel(nsIFrame *aFrameIn,
|
|
|
|
nsDirection aDirection,
|
2012-08-22 15:56:38 +00:00
|
|
|
uint8_t aBidiLevel,
|
2007-11-22 20:47:33 +00:00
|
|
|
nsIFrame **aFrameOut) const;
|
2006-04-26 02:01:07 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* MaintainSelection will track the current selection as being "sticky".
|
|
|
|
* Dragging or extending selection will never allow for a subset
|
|
|
|
* (or the whole) of the maintained selection to become unselected.
|
|
|
|
* Primary use: double click selecting then dragging on second click
|
2006-07-12 07:07:36 +00:00
|
|
|
* @param aAmount the initial amount of text selected (word, line or paragraph).
|
|
|
|
* For "line", use eSelectBeginLine.
|
2006-04-26 02:01:07 +00:00
|
|
|
*/
|
2006-07-12 07:07:36 +00:00
|
|
|
nsresult MaintainSelection(nsSelectionAmount aAmount = eSelectNoAmount);
|
2006-04-26 02:01:07 +00:00
|
|
|
|
|
|
|
nsFrameSelection();
|
|
|
|
|
|
|
|
void StartBatchChanges();
|
|
|
|
void EndBatchChanges();
|
2007-11-22 20:47:33 +00:00
|
|
|
/*unsafe*/
|
2006-04-26 02:01:07 +00:00
|
|
|
nsresult DeleteFromDocument();
|
|
|
|
|
2007-11-22 20:47:33 +00:00
|
|
|
nsIPresShell *GetShell()const { return mShell; }
|
2006-04-26 02:01:07 +00:00
|
|
|
|
2011-12-20 09:15:41 +00:00
|
|
|
void DisconnectFromPresShell();
|
2013-07-03 07:41:53 +00:00
|
|
|
nsresult ClearNormalSelection();
|
2006-04-26 02:01:07 +00:00
|
|
|
private:
|
|
|
|
nsresult TakeFocus(nsIContent *aNewFocus,
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t aContentOffset,
|
|
|
|
uint32_t aContentEndOffset,
|
2008-10-09 10:07:16 +00:00
|
|
|
HINT aHint,
|
2011-09-29 06:19:26 +00:00
|
|
|
bool aContinueSelection,
|
|
|
|
bool aMultipleSelection);
|
2006-04-26 02:01:07 +00:00
|
|
|
|
|
|
|
void BidiLevelFromMove(nsIPresShell* aPresShell,
|
|
|
|
nsIContent *aNode,
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t aContentOffset,
|
|
|
|
uint32_t aKeycode,
|
2006-04-26 02:01:07 +00:00
|
|
|
HINT aHint);
|
2012-08-22 15:56:38 +00:00
|
|
|
void BidiLevelFromClick(nsIContent *aNewFocus, uint32_t aContentOffset);
|
2006-04-26 02:01:07 +00:00
|
|
|
nsPrevNextBidiLevels GetPrevNextBidiLevels(nsIContent *aNode,
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t aContentOffset,
|
2006-04-26 02:01:07 +00:00
|
|
|
HINT aHint,
|
2011-09-29 06:19:26 +00:00
|
|
|
bool aJumpLines) const;
|
2006-04-26 02:01:07 +00:00
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
bool AdjustForMaintainedSelection(nsIContent *aContent, int32_t aOffset);
|
2006-04-26 02:01:07 +00:00
|
|
|
|
|
|
|
// post and pop reasons for notifications. we may stack these later
|
2012-08-22 15:56:38 +00:00
|
|
|
void PostReason(int16_t aReason) { mSelectionChangeReason = aReason; }
|
|
|
|
int16_t PopReason()
|
2006-04-26 02:01:07 +00:00
|
|
|
{
|
2012-08-22 15:56:38 +00:00
|
|
|
int16_t retval = mSelectionChangeReason;
|
2006-04-26 02:01:07 +00:00
|
|
|
mSelectionChangeReason = 0;
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
2012-06-10 23:44:50 +00:00
|
|
|
friend class mozilla::Selection;
|
2006-04-26 02:01:07 +00:00
|
|
|
#ifdef DEBUG
|
|
|
|
void printSelection(); // for debugging
|
|
|
|
#endif /* DEBUG */
|
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
void ResizeBuffer(uint32_t aNewBufSize);
|
2006-04-26 02:01:07 +00:00
|
|
|
/*HELPER METHODS*/
|
2012-08-22 15:56:38 +00:00
|
|
|
nsresult MoveCaret(uint32_t aKeycode, bool aContinueSelection,
|
2010-04-28 17:47:23 +00:00
|
|
|
nsSelectionAmount aAmount);
|
2012-08-22 15:56:38 +00:00
|
|
|
nsresult MoveCaret(uint32_t aKeycode, bool aContinueSelection,
|
2010-04-28 17:47:23 +00:00
|
|
|
nsSelectionAmount aAmount,
|
2011-09-29 06:19:26 +00:00
|
|
|
bool aVisualMovement);
|
2006-04-26 02:01:07 +00:00
|
|
|
|
|
|
|
nsresult FetchDesiredX(nscoord &aDesiredX); //the x position requested by the Key Handling for up down
|
|
|
|
void InvalidateDesiredX(); //do not listen to mDesiredX you must get another.
|
|
|
|
void SetDesiredX(nscoord aX); //set the mDesiredX
|
|
|
|
|
|
|
|
nsresult ConstrainFrameAndPointToAnchorSubtree(nsIFrame *aFrame, nsPoint& aPoint, nsIFrame **aRetFrame, nsPoint& aRetPoint);
|
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t GetBatching() const {return mBatching; }
|
2011-09-29 06:19:26 +00:00
|
|
|
bool GetNotifyFrames() const { return mNotifyFrames; }
|
|
|
|
void SetDirty(bool aDirty=true){if (mBatching) mChangesDuringBatching = aDirty;}
|
2006-04-26 02:01:07 +00:00
|
|
|
|
2007-11-22 20:47:33 +00:00
|
|
|
// nsFrameSelection may get deleted when calling this,
|
|
|
|
// so remember to use nsCOMPtr when needed.
|
2006-04-26 02:01:07 +00:00
|
|
|
nsresult NotifySelectionListeners(SelectionType aType); // add parameters to say collapsed etc?
|
|
|
|
|
2012-06-10 23:44:50 +00:00
|
|
|
nsRefPtr<mozilla::Selection> mDomSelections[nsISelectionController::NUM_SELECTIONTYPES];
|
2006-04-26 02:01:07 +00:00
|
|
|
|
|
|
|
// Table selection support.
|
2007-11-22 20:47:33 +00:00
|
|
|
nsITableCellLayout* GetCellLayout(nsIContent *aCellContent) const;
|
2006-04-26 02:01:07 +00:00
|
|
|
|
|
|
|
nsresult SelectBlockOfCells(nsIContent *aStartNode, nsIContent *aEndNode);
|
2012-08-22 15:56:38 +00:00
|
|
|
nsresult SelectRowOrColumn(nsIContent *aCellContent, uint32_t aTarget);
|
2009-09-10 03:06:54 +00:00
|
|
|
nsresult UnselectCells(nsIContent *aTable,
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t aStartRowIndex, int32_t aStartColumnIndex,
|
|
|
|
int32_t aEndRowIndex, int32_t aEndColumnIndex,
|
2011-09-29 06:19:26 +00:00
|
|
|
bool aRemoveOutsideOfCellRange);
|
2009-09-10 03:06:54 +00:00
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
nsresult GetCellIndexes(nsIContent *aCell, int32_t &aRowIndex, int32_t &aColIndex);
|
2006-04-26 02:01:07 +00:00
|
|
|
|
2009-04-06 17:20:32 +00:00
|
|
|
// Get our first range, if its first selected node is a cell. If this does
|
|
|
|
// not return null, then the first node in the returned range is a cell
|
|
|
|
// (according to GetFirstCellNodeInRange).
|
2012-01-10 14:19:54 +00:00
|
|
|
nsRange* GetFirstCellRange();
|
2009-04-06 17:20:32 +00:00
|
|
|
// Get our next range, if its first selected node is a cell. If this does
|
|
|
|
// not return null, then the first node in the returned range is a cell
|
|
|
|
// (according to GetFirstCellNodeInRange).
|
2012-01-10 14:19:54 +00:00
|
|
|
nsRange* GetNextCellRange();
|
|
|
|
nsIContent* GetFirstCellNodeInRange(nsRange *aRange) const;
|
2009-04-06 17:21:30 +00:00
|
|
|
// Returns non-null table if in same table, null otherwise
|
|
|
|
nsIContent* IsInSameTable(nsIContent *aContent1, nsIContent *aContent2) const;
|
|
|
|
// Might return null
|
|
|
|
nsIContent* GetParentTable(nsIContent *aCellNode) const;
|
2012-08-22 15:56:38 +00:00
|
|
|
nsresult CreateAndAddRange(nsINode *aParentNode, int32_t aOffset);
|
2006-04-26 02:01:07 +00:00
|
|
|
|
2009-04-06 17:17:38 +00:00
|
|
|
nsCOMPtr<nsINode> mCellParent; //used to snap to table selection
|
2006-04-26 02:01:07 +00:00
|
|
|
nsCOMPtr<nsIContent> mStartSelectedCell;
|
|
|
|
nsCOMPtr<nsIContent> mEndSelectedCell;
|
|
|
|
nsCOMPtr<nsIContent> mAppendStartSelectedCell;
|
|
|
|
nsCOMPtr<nsIContent> mUnselectCellOnMouseUp;
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t mSelectingTableCellMode;
|
|
|
|
int32_t mSelectedCellIndex;
|
2006-04-26 02:01:07 +00:00
|
|
|
|
|
|
|
// maintain selection
|
2012-01-10 14:19:54 +00:00
|
|
|
nsRefPtr<nsRange> mMaintainRange;
|
2006-07-12 07:07:36 +00:00
|
|
|
nsSelectionAmount mMaintainedAmount;
|
2006-04-26 02:01:07 +00:00
|
|
|
|
|
|
|
//batching
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t mBatching;
|
2006-04-26 02:01:07 +00:00
|
|
|
|
2012-07-26 21:44:10 +00:00
|
|
|
// Limit selection navigation to a child of this node.
|
|
|
|
nsCOMPtr<nsIContent> mLimiter;
|
|
|
|
// Limit selection navigation to a descendant of this node.
|
|
|
|
nsCOMPtr<nsIContent> mAncestorLimiter;
|
|
|
|
|
2006-04-26 02:01:07 +00:00
|
|
|
nsIPresShell *mShell;
|
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
int16_t mSelectionChangeReason; // reason for notifications of selection changing
|
|
|
|
int16_t mDisplaySelection; //for visual display purposes.
|
2006-04-26 02:01:07 +00:00
|
|
|
|
|
|
|
HINT mHint; //hint to tell if the selection is at the end of this line or beginning of next
|
2006-08-08 05:14:52 +00:00
|
|
|
#ifdef IBMBIDI
|
2012-08-22 15:56:38 +00:00
|
|
|
uint8_t mCaretBidiLevel;
|
2006-08-08 05:14:52 +00:00
|
|
|
#endif
|
2006-04-26 02:01:07 +00:00
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
int32_t mDesiredX;
|
|
|
|
uint32_t mDelayedMouseEventClickCount;
|
2012-05-24 10:36:08 +00:00
|
|
|
bool mDelayedMouseEventIsShift;
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mDelayedMouseEventValid;
|
2006-04-26 02:01:07 +00:00
|
|
|
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mChangesDuringBatching;
|
|
|
|
bool mNotifyFrames;
|
|
|
|
bool mDragSelectingCells;
|
|
|
|
bool mMouseDownState; //for drag purposes
|
|
|
|
bool mMouseDoubleDownState; //has the doubleclick down happened
|
|
|
|
bool mDesiredXSet;
|
2006-04-26 02:01:07 +00:00
|
|
|
|
2012-08-22 15:56:38 +00:00
|
|
|
int8_t mCaretMovementStyle;
|
2006-04-26 02:01:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* nsFrameSelection_h___ */
|