1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/content/base/public/nsISelectionPrivate.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,166 @@ 1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 + 1.9 +#include "nsISelection.idl" 1.10 + 1.11 +interface nsRange; 1.12 +interface nsIDOMNode; 1.13 +interface nsISelectionListener; 1.14 +interface nsIContent; 1.15 +interface nsINode; 1.16 + 1.17 +%{C++ 1.18 +class nsIFrame; 1.19 +struct nsPoint; 1.20 +struct ScrollAxis; 1.21 +template<class T> class nsTArray; 1.22 +#include "nsDirection.h" 1.23 +#include "nsIPresShell.h" // TODO: Remove this include 1.24 +#include "mozilla/EventForwards.h" 1.25 +%} 1.26 + 1.27 +[ptr] native nsIFrame(nsIFrame); 1.28 +[ptr] native RangeArray(nsTArray<nsRange*>); 1.29 +[ref] native constTextRangeStyleRef(const mozilla::TextRangeStyle); 1.30 +[ref] native nsPointRef(nsPoint); 1.31 +native nsDirection(nsDirection); 1.32 +native ScrollAxis(nsIPresShell::ScrollAxis); 1.33 + 1.34 +[scriptable, builtinclass, uuid(52629837-7b3f-4434-940d-a14de7ef9b7a)] 1.35 +interface nsISelectionPrivate : nsISelection 1.36 + { 1.37 + const short ENDOFPRECEDINGLINE=0; 1.38 + const short STARTOFNEXTLINE=1; 1.39 + 1.40 + attribute boolean interlinePosition; 1.41 + 1.42 + /* startBatchChanges 1.43 + match this up with endbatchChanges. will stop ui updates while multiple selection methods are called 1.44 + */ 1.45 + [noscript] void startBatchChanges(); 1.46 + 1.47 + /* endBatchChanges 1.48 + match this up with startBatchChanges 1.49 + */ 1.50 + [noscript] void endBatchChanges(); 1.51 + 1.52 + DOMString toStringWithFormat(in string formatType, in unsigned long flags, in int32_t wrapColumn); 1.53 + void addSelectionListener(in nsISelectionListener newListener); 1.54 + void removeSelectionListener(in nsISelectionListener listenerToRemove); 1.55 + 1.56 + /* Table selection stuff 1.57 + We should probably move this and table-related 1.58 + items in nsFrameSelection to a 1.59 + new nsITableSelection interface 1.60 + */ 1.61 + const long TABLESELECTION_NONE = 0; 1.62 + const long TABLESELECTION_CELL = 1; 1.63 + const long TABLESELECTION_ROW = 2; 1.64 + const long TABLESELECTION_COLUMN = 3; 1.65 + const long TABLESELECTION_TABLE = 4; 1.66 + const long TABLESELECTION_ALLCELLS = 5; 1.67 + 1.68 + /** Test if supplied range points to a single table element: 1.69 + * Result is one of above constants. "None" means 1.70 + * a table element isn't selected. 1.71 + */ 1.72 + [noscript] long getTableSelectionType(in nsIDOMRange range); 1.73 + 1.74 + /* canCacheFrameOffset 1.75 + * Frame Offset cache can be used just during calling nsEditor::EndPlaceHolderTransaction. 1.76 + * EndPlaceHolderTransaction will give rise to reflow/refreshing view/scroll, and call times 1.77 + * of nsTextFrame::GetPointFromOffset whose return value is to be cached. 1.78 + * see bugs 35296 and 199412 1.79 + */ 1.80 + [noscript] attribute boolean canCacheFrameOffset; 1.81 + 1.82 + /* GetCachedOffsetForFrame 1.83 + * Returns cached value for nsTextFrame::GetPointFromOffset. 1.84 + */ 1.85 + [noscript] void getCachedFrameOffset(in nsIFrame aFrame, in int32_t inOffset, in nsPointRef aPoint); 1.86 + 1.87 + [noscript] void setAncestorLimiter(in nsIContent aContent); 1.88 + 1.89 + /** 1.90 + * Set the painting style for the range. The range must be a range in 1.91 + * the selection. The textRangeStyle will be used by text frame 1.92 + * when it is painting the selection. 1.93 + */ 1.94 + [noscript] void setTextRangeStyle(in nsIDOMRange range, 1.95 + in constTextRangeStyleRef textRangeStyle); 1.96 + 1.97 + /** 1.98 + * Get the direction of the selection. 1.99 + */ 1.100 + [noscript, notxpcom] nsDirection getSelectionDirection(); 1.101 + [noscript, notxpcom] void setSelectionDirection(in nsDirection aDirection); 1.102 + 1.103 + /** 1.104 + * Returns the type of the selection (see nsISelectionController for 1.105 + * available constants). 1.106 + */ 1.107 + readonly attribute short type; 1.108 + 1.109 + /** 1.110 + * Return array of ranges intersecting with the given DOM interval. 1.111 + */ 1.112 + void GetRangesForInterval( 1.113 + in nsIDOMNode beginNode, in int32_t beginOffset, 1.114 + in nsIDOMNode endNode, in int32_t endOffset, 1.115 + in boolean allowAdjacent, 1.116 + out uint32_t resultCount, 1.117 + [retval, array, size_is(resultCount)] out nsIDOMRange results); 1.118 + 1.119 + [noscript] void GetRangesForIntervalArray( 1.120 + in nsINode beginNode, in int32_t beginOffset, 1.121 + in nsINode endNode, in int32_t endOffset, 1.122 + in boolean allowAdjacent, 1.123 + in RangeArray results); 1.124 + 1.125 + /** 1.126 + * Scrolls a region of the selection, so that it is visible in 1.127 + * the scrolled view. 1.128 + * 1.129 + * @param aRegion - the region inside the selection to scroll into view 1.130 + * (see selection region constants defined in 1.131 + * nsISelectionController). 1.132 + * @param aIsSynchronous - when true, scrolls the selection into view 1.133 + * before returning. If false, posts a request which 1.134 + * is processed at some point after the method returns. 1.135 + * @param aVPercent - how to align the frame vertically. 1.136 + * @param aHPercent - how to align the frame horizontally. 1.137 + */ 1.138 + void scrollIntoView(in short aRegion, in boolean aIsSynchronous, 1.139 + in int16_t aVPercent, 1.140 + in int16_t aHPercent); 1.141 + 1.142 + /** 1.143 + * Scrolls a region of the selection, so that it is visible in 1.144 + * the scrolled view. 1.145 + * 1.146 + * @param aRegion - the region inside the selection to scroll into view 1.147 + * (see selection region constants defined in 1.148 + * nsISelectionController). 1.149 + * @param aIsSynchronous - when true, scrolls the selection into view 1.150 + * before returning. If false, posts a request which 1.151 + * is processed at some point after the method returns. 1.152 + * @param aVertical - how to align the frame vertically and when. 1.153 + * See nsIPresShell.h:ScrollAxis for details. 1.154 + * @param aHorizontal - how to align the frame horizontally and when. 1.155 + * See nsIPresShell.h:ScrollAxis for details. 1.156 + */ 1.157 + [noscript] void scrollIntoViewInternal(in short aRegion, 1.158 + in boolean aIsSynchronous, 1.159 + in ScrollAxis aVertical, 1.160 + in ScrollAxis aHorizontal); 1.161 + 1.162 + /** 1.163 + * Modifies the cursor Bidi level after a change in keyboard direction 1.164 + * @param langRTL is PR_TRUE if the new language is right-to-left or 1.165 + * PR_FALSE if the new language is left-to-right. 1.166 + */ 1.167 + [noscript] void selectionLanguageChange(in boolean langRTL); 1.168 +}; 1.169 +