2001-09-25 05:32:19 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-05-21 15:12:37 +04: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/. */
|
2000-09-14 09:24:18 +04:00
|
|
|
|
2011-08-08 00:17:00 +04:00
|
|
|
#include "nsISelection.idl"
|
2000-09-14 09:24:18 +04:00
|
|
|
|
2012-01-10 18:19:54 +04:00
|
|
|
interface nsRange;
|
2011-08-08 00:17:00 +04:00
|
|
|
interface nsIDOMNode;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 20:46:42 +04:00
|
|
|
interface nsISelectionListener;
|
2007-06-28 06:48:16 +04:00
|
|
|
interface nsIContent;
|
2012-01-10 18:19:54 +04:00
|
|
|
interface nsINode;
|
Landing the XPCDOM_20010329_BRANCH branch, changes mostly done by jband@netscape.com and jst@netscape.com, also some changes done by shaver@mozilla.org, peterv@netscape.com and markh@activestate.com. r= and sr= by vidur@netscape.com, jband@netscape.com, jst@netscpae.com, danm@netscape.com, hyatt@netscape.com, shaver@mozilla.org, dbradley@netscape.com, rpotts@netscape.com.
2001-05-08 20:46:42 +04:00
|
|
|
|
2003-04-04 06:36:12 +04:00
|
|
|
%{C++
|
2013-08-07 00:19:11 +04:00
|
|
|
class nsIFrame;
|
2003-04-20 05:03:40 +04:00
|
|
|
struct nsPoint;
|
2012-03-20 06:09:50 +04:00
|
|
|
struct ScrollAxis;
|
2013-08-07 00:19:11 +04:00
|
|
|
#include "nsDirection.h"
|
|
|
|
#include "nsIPresShell.h" // TODO: Remove this include
|
2016-07-20 18:29:36 +03:00
|
|
|
#include "nsTArrayForwardDeclare.h"
|
2013-09-24 14:04:15 +04:00
|
|
|
#include "mozilla/EventForwards.h"
|
2003-04-04 06:36:12 +04:00
|
|
|
%}
|
|
|
|
|
2003-04-20 05:03:40 +04:00
|
|
|
[ptr] native nsIFrame(nsIFrame);
|
2012-01-10 18:19:54 +04:00
|
|
|
[ptr] native RangeArray(nsTArray<nsRange*>);
|
2013-10-01 11:22:59 +04:00
|
|
|
[ref] native constTextRangeStyleRef(const mozilla::TextRangeStyle);
|
2003-04-20 05:03:40 +04:00
|
|
|
[ref] native nsPointRef(nsPoint);
|
2011-07-28 21:51:22 +04:00
|
|
|
native nsDirection(nsDirection);
|
2012-03-20 06:09:50 +04:00
|
|
|
native ScrollAxis(nsIPresShell::ScrollAxis);
|
2000-09-14 09:24:18 +04:00
|
|
|
|
2015-12-01 23:25:06 +03:00
|
|
|
[scriptable, builtinclass, uuid(0c9f4f74-ee7e-4fe9-be6b-0ba856368178)]
|
2011-08-08 00:17:00 +04:00
|
|
|
interface nsISelectionPrivate : nsISelection
|
2000-09-14 09:24:18 +04:00
|
|
|
{
|
|
|
|
const short ENDOFPRECEDINGLINE=0;
|
|
|
|
const short STARTOFNEXTLINE=1;
|
2013-12-17 18:12:33 +04:00
|
|
|
|
2000-09-14 09:24:18 +04:00
|
|
|
attribute boolean interlinePosition;
|
2014-09-10 03:27:56 +04:00
|
|
|
[noscript] attribute nsIContent ancestorLimiter;
|
2000-09-14 09:24:18 +04:00
|
|
|
|
|
|
|
/* startBatchChanges
|
|
|
|
match this up with endbatchChanges. will stop ui updates while multiple selection methods are called
|
|
|
|
*/
|
2015-12-01 23:25:06 +03:00
|
|
|
[noscript] void startBatchChanges();
|
2013-12-17 18:12:33 +04:00
|
|
|
|
2000-09-14 09:24:18 +04:00
|
|
|
/* endBatchChanges
|
|
|
|
match this up with startBatchChanges
|
|
|
|
*/
|
2015-12-01 23:25:06 +03:00
|
|
|
[noscript] void endBatchChanges();
|
2013-12-17 18:12:33 +04:00
|
|
|
|
2012-08-22 19:56:38 +04:00
|
|
|
DOMString toStringWithFormat(in string formatType, in unsigned long flags, in int32_t wrapColumn);
|
2003-04-20 05:03:40 +04:00
|
|
|
void addSelectionListener(in nsISelectionListener newListener);
|
|
|
|
void removeSelectionListener(in nsISelectionListener listenerToRemove);
|
2000-12-21 01:13:54 +03:00
|
|
|
|
|
|
|
/* Table selection stuff
|
2016-07-20 18:29:36 +03:00
|
|
|
We should probably move this and table-related
|
2006-04-26 05:57:22 +04:00
|
|
|
items in nsFrameSelection to a
|
2000-12-21 01:13:54 +03:00
|
|
|
new nsITableSelection interface
|
|
|
|
*/
|
2013-12-17 18:12:33 +04:00
|
|
|
const long TABLESELECTION_NONE = 0;
|
|
|
|
const long TABLESELECTION_CELL = 1;
|
|
|
|
const long TABLESELECTION_ROW = 2;
|
|
|
|
const long TABLESELECTION_COLUMN = 3;
|
|
|
|
const long TABLESELECTION_TABLE = 4;
|
2000-12-21 01:13:54 +03:00
|
|
|
const long TABLESELECTION_ALLCELLS = 5;
|
|
|
|
|
|
|
|
/** Test if supplied range points to a single table element:
|
|
|
|
* Result is one of above constants. "None" means
|
|
|
|
* a table element isn't selected.
|
|
|
|
*/
|
2013-12-17 18:12:33 +04:00
|
|
|
[noscript] long getTableSelectionType(in nsIDOMRange range);
|
|
|
|
|
2003-04-20 05:03:40 +04:00
|
|
|
/* canCacheFrameOffset
|
|
|
|
* Frame Offset cache can be used just during calling nsEditor::EndPlaceHolderTransaction.
|
|
|
|
* EndPlaceHolderTransaction will give rise to reflow/refreshing view/scroll, and call times
|
|
|
|
* of nsTextFrame::GetPointFromOffset whose return value is to be cached.
|
|
|
|
* see bugs 35296 and 199412
|
|
|
|
*/
|
|
|
|
[noscript] attribute boolean canCacheFrameOffset;
|
|
|
|
|
|
|
|
/* GetCachedOffsetForFrame
|
|
|
|
* Returns cached value for nsTextFrame::GetPointFromOffset.
|
|
|
|
*/
|
2012-08-22 19:56:38 +04:00
|
|
|
[noscript] void getCachedFrameOffset(in nsIFrame aFrame, in int32_t inOffset, in nsPointRef aPoint);
|
2005-08-24 21:44:28 +04:00
|
|
|
|
2009-04-23 07:27:12 +04:00
|
|
|
/**
|
|
|
|
* Set the painting style for the range. The range must be a range in
|
|
|
|
* the selection. The textRangeStyle will be used by text frame
|
|
|
|
* when it is painting the selection.
|
|
|
|
*/
|
|
|
|
[noscript] void setTextRangeStyle(in nsIDOMRange range,
|
|
|
|
in constTextRangeStyleRef textRangeStyle);
|
2011-07-28 21:51:22 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the direction of the selection.
|
|
|
|
*/
|
|
|
|
[noscript, notxpcom] nsDirection getSelectionDirection();
|
|
|
|
[noscript, notxpcom] void setSelectionDirection(in nsDirection aDirection);
|
2016-07-20 18:29:36 +03:00
|
|
|
|
2011-08-08 00:17:00 +04:00
|
|
|
/**
|
|
|
|
* Returns the type of the selection (see nsISelectionController for
|
|
|
|
* available constants).
|
|
|
|
*/
|
|
|
|
readonly attribute short type;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return array of ranges intersecting with the given DOM interval.
|
|
|
|
*/
|
|
|
|
void GetRangesForInterval(
|
2012-08-22 19:56:38 +04:00
|
|
|
in nsIDOMNode beginNode, in int32_t beginOffset,
|
|
|
|
in nsIDOMNode endNode, in int32_t endOffset,
|
2011-08-27 19:45:25 +04:00
|
|
|
in boolean allowAdjacent,
|
2012-08-22 19:56:38 +04:00
|
|
|
out uint32_t resultCount,
|
2011-08-08 00:17:00 +04:00
|
|
|
[retval, array, size_is(resultCount)] out nsIDOMRange results);
|
|
|
|
|
2012-01-10 18:19:54 +04:00
|
|
|
[noscript] void GetRangesForIntervalArray(
|
2012-08-22 19:56:38 +04:00
|
|
|
in nsINode beginNode, in int32_t beginOffset,
|
|
|
|
in nsINode endNode, in int32_t endOffset,
|
2011-08-27 19:45:25 +04:00
|
|
|
in boolean allowAdjacent,
|
2011-08-08 00:17:00 +04:00
|
|
|
in RangeArray results);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Scrolls a region of the selection, so that it is visible in
|
|
|
|
* the scrolled view.
|
|
|
|
*
|
|
|
|
* @param aRegion - the region inside the selection to scroll into view
|
|
|
|
* (see selection region constants defined in
|
|
|
|
* nsISelectionController).
|
|
|
|
* @param aIsSynchronous - when true, scrolls the selection into view
|
|
|
|
* before returning. If false, posts a request which
|
|
|
|
* is processed at some point after the method returns.
|
2012-03-20 06:09:50 +04:00
|
|
|
* @param aVPercent - how to align the frame vertically.
|
|
|
|
* @param aHPercent - how to align the frame horizontally.
|
2011-08-08 00:17:00 +04:00
|
|
|
*/
|
|
|
|
void scrollIntoView(in short aRegion, in boolean aIsSynchronous,
|
2012-08-22 19:56:38 +04:00
|
|
|
in int16_t aVPercent,
|
|
|
|
in int16_t aHPercent);
|
2012-03-20 06:09:50 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Scrolls a region of the selection, so that it is visible in
|
|
|
|
* the scrolled view.
|
|
|
|
*
|
|
|
|
* @param aRegion - the region inside the selection to scroll into view
|
|
|
|
* (see selection region constants defined in
|
|
|
|
* nsISelectionController).
|
|
|
|
* @param aIsSynchronous - when true, scrolls the selection into view
|
|
|
|
* before returning. If false, posts a request which
|
|
|
|
* is processed at some point after the method returns.
|
|
|
|
* @param aVertical - how to align the frame vertically and when.
|
|
|
|
* See nsIPresShell.h:ScrollAxis for details.
|
|
|
|
* @param aHorizontal - how to align the frame horizontally and when.
|
|
|
|
* See nsIPresShell.h:ScrollAxis for details.
|
|
|
|
*/
|
|
|
|
[noscript] void scrollIntoViewInternal(in short aRegion,
|
|
|
|
in boolean aIsSynchronous,
|
|
|
|
in ScrollAxis aVertical,
|
|
|
|
in ScrollAxis aHorizontal);
|
2013-12-17 18:12:17 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Modifies the cursor Bidi level after a change in keyboard direction
|
|
|
|
* @param langRTL is PR_TRUE if the new language is right-to-left or
|
|
|
|
* PR_FALSE if the new language is left-to-right.
|
|
|
|
*/
|
|
|
|
[noscript] void selectionLanguageChange(in boolean langRTL);
|
2000-09-14 09:24:18 +04:00
|
|
|
};
|
|
|
|
|