Thu, 15 Jan 2015 15:55:04 +0100
Back out 97036ab72558 which inappropriately compared turds to third parties.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #include "nsISelection.idl" |
michael@0 | 7 | |
michael@0 | 8 | interface nsRange; |
michael@0 | 9 | interface nsIDOMNode; |
michael@0 | 10 | interface nsISelectionListener; |
michael@0 | 11 | interface nsIContent; |
michael@0 | 12 | interface nsINode; |
michael@0 | 13 | |
michael@0 | 14 | %{C++ |
michael@0 | 15 | class nsIFrame; |
michael@0 | 16 | struct nsPoint; |
michael@0 | 17 | struct ScrollAxis; |
michael@0 | 18 | template<class T> class nsTArray; |
michael@0 | 19 | #include "nsDirection.h" |
michael@0 | 20 | #include "nsIPresShell.h" // TODO: Remove this include |
michael@0 | 21 | #include "mozilla/EventForwards.h" |
michael@0 | 22 | %} |
michael@0 | 23 | |
michael@0 | 24 | [ptr] native nsIFrame(nsIFrame); |
michael@0 | 25 | [ptr] native RangeArray(nsTArray<nsRange*>); |
michael@0 | 26 | [ref] native constTextRangeStyleRef(const mozilla::TextRangeStyle); |
michael@0 | 27 | [ref] native nsPointRef(nsPoint); |
michael@0 | 28 | native nsDirection(nsDirection); |
michael@0 | 29 | native ScrollAxis(nsIPresShell::ScrollAxis); |
michael@0 | 30 | |
michael@0 | 31 | [scriptable, builtinclass, uuid(52629837-7b3f-4434-940d-a14de7ef9b7a)] |
michael@0 | 32 | interface nsISelectionPrivate : nsISelection |
michael@0 | 33 | { |
michael@0 | 34 | const short ENDOFPRECEDINGLINE=0; |
michael@0 | 35 | const short STARTOFNEXTLINE=1; |
michael@0 | 36 | |
michael@0 | 37 | attribute boolean interlinePosition; |
michael@0 | 38 | |
michael@0 | 39 | /* startBatchChanges |
michael@0 | 40 | match this up with endbatchChanges. will stop ui updates while multiple selection methods are called |
michael@0 | 41 | */ |
michael@0 | 42 | [noscript] void startBatchChanges(); |
michael@0 | 43 | |
michael@0 | 44 | /* endBatchChanges |
michael@0 | 45 | match this up with startBatchChanges |
michael@0 | 46 | */ |
michael@0 | 47 | [noscript] void endBatchChanges(); |
michael@0 | 48 | |
michael@0 | 49 | DOMString toStringWithFormat(in string formatType, in unsigned long flags, in int32_t wrapColumn); |
michael@0 | 50 | void addSelectionListener(in nsISelectionListener newListener); |
michael@0 | 51 | void removeSelectionListener(in nsISelectionListener listenerToRemove); |
michael@0 | 52 | |
michael@0 | 53 | /* Table selection stuff |
michael@0 | 54 | We should probably move this and table-related |
michael@0 | 55 | items in nsFrameSelection to a |
michael@0 | 56 | new nsITableSelection interface |
michael@0 | 57 | */ |
michael@0 | 58 | const long TABLESELECTION_NONE = 0; |
michael@0 | 59 | const long TABLESELECTION_CELL = 1; |
michael@0 | 60 | const long TABLESELECTION_ROW = 2; |
michael@0 | 61 | const long TABLESELECTION_COLUMN = 3; |
michael@0 | 62 | const long TABLESELECTION_TABLE = 4; |
michael@0 | 63 | const long TABLESELECTION_ALLCELLS = 5; |
michael@0 | 64 | |
michael@0 | 65 | /** Test if supplied range points to a single table element: |
michael@0 | 66 | * Result is one of above constants. "None" means |
michael@0 | 67 | * a table element isn't selected. |
michael@0 | 68 | */ |
michael@0 | 69 | [noscript] long getTableSelectionType(in nsIDOMRange range); |
michael@0 | 70 | |
michael@0 | 71 | /* canCacheFrameOffset |
michael@0 | 72 | * Frame Offset cache can be used just during calling nsEditor::EndPlaceHolderTransaction. |
michael@0 | 73 | * EndPlaceHolderTransaction will give rise to reflow/refreshing view/scroll, and call times |
michael@0 | 74 | * of nsTextFrame::GetPointFromOffset whose return value is to be cached. |
michael@0 | 75 | * see bugs 35296 and 199412 |
michael@0 | 76 | */ |
michael@0 | 77 | [noscript] attribute boolean canCacheFrameOffset; |
michael@0 | 78 | |
michael@0 | 79 | /* GetCachedOffsetForFrame |
michael@0 | 80 | * Returns cached value for nsTextFrame::GetPointFromOffset. |
michael@0 | 81 | */ |
michael@0 | 82 | [noscript] void getCachedFrameOffset(in nsIFrame aFrame, in int32_t inOffset, in nsPointRef aPoint); |
michael@0 | 83 | |
michael@0 | 84 | [noscript] void setAncestorLimiter(in nsIContent aContent); |
michael@0 | 85 | |
michael@0 | 86 | /** |
michael@0 | 87 | * Set the painting style for the range. The range must be a range in |
michael@0 | 88 | * the selection. The textRangeStyle will be used by text frame |
michael@0 | 89 | * when it is painting the selection. |
michael@0 | 90 | */ |
michael@0 | 91 | [noscript] void setTextRangeStyle(in nsIDOMRange range, |
michael@0 | 92 | in constTextRangeStyleRef textRangeStyle); |
michael@0 | 93 | |
michael@0 | 94 | /** |
michael@0 | 95 | * Get the direction of the selection. |
michael@0 | 96 | */ |
michael@0 | 97 | [noscript, notxpcom] nsDirection getSelectionDirection(); |
michael@0 | 98 | [noscript, notxpcom] void setSelectionDirection(in nsDirection aDirection); |
michael@0 | 99 | |
michael@0 | 100 | /** |
michael@0 | 101 | * Returns the type of the selection (see nsISelectionController for |
michael@0 | 102 | * available constants). |
michael@0 | 103 | */ |
michael@0 | 104 | readonly attribute short type; |
michael@0 | 105 | |
michael@0 | 106 | /** |
michael@0 | 107 | * Return array of ranges intersecting with the given DOM interval. |
michael@0 | 108 | */ |
michael@0 | 109 | void GetRangesForInterval( |
michael@0 | 110 | in nsIDOMNode beginNode, in int32_t beginOffset, |
michael@0 | 111 | in nsIDOMNode endNode, in int32_t endOffset, |
michael@0 | 112 | in boolean allowAdjacent, |
michael@0 | 113 | out uint32_t resultCount, |
michael@0 | 114 | [retval, array, size_is(resultCount)] out nsIDOMRange results); |
michael@0 | 115 | |
michael@0 | 116 | [noscript] void GetRangesForIntervalArray( |
michael@0 | 117 | in nsINode beginNode, in int32_t beginOffset, |
michael@0 | 118 | in nsINode endNode, in int32_t endOffset, |
michael@0 | 119 | in boolean allowAdjacent, |
michael@0 | 120 | in RangeArray results); |
michael@0 | 121 | |
michael@0 | 122 | /** |
michael@0 | 123 | * Scrolls a region of the selection, so that it is visible in |
michael@0 | 124 | * the scrolled view. |
michael@0 | 125 | * |
michael@0 | 126 | * @param aRegion - the region inside the selection to scroll into view |
michael@0 | 127 | * (see selection region constants defined in |
michael@0 | 128 | * nsISelectionController). |
michael@0 | 129 | * @param aIsSynchronous - when true, scrolls the selection into view |
michael@0 | 130 | * before returning. If false, posts a request which |
michael@0 | 131 | * is processed at some point after the method returns. |
michael@0 | 132 | * @param aVPercent - how to align the frame vertically. |
michael@0 | 133 | * @param aHPercent - how to align the frame horizontally. |
michael@0 | 134 | */ |
michael@0 | 135 | void scrollIntoView(in short aRegion, in boolean aIsSynchronous, |
michael@0 | 136 | in int16_t aVPercent, |
michael@0 | 137 | in int16_t aHPercent); |
michael@0 | 138 | |
michael@0 | 139 | /** |
michael@0 | 140 | * Scrolls a region of the selection, so that it is visible in |
michael@0 | 141 | * the scrolled view. |
michael@0 | 142 | * |
michael@0 | 143 | * @param aRegion - the region inside the selection to scroll into view |
michael@0 | 144 | * (see selection region constants defined in |
michael@0 | 145 | * nsISelectionController). |
michael@0 | 146 | * @param aIsSynchronous - when true, scrolls the selection into view |
michael@0 | 147 | * before returning. If false, posts a request which |
michael@0 | 148 | * is processed at some point after the method returns. |
michael@0 | 149 | * @param aVertical - how to align the frame vertically and when. |
michael@0 | 150 | * See nsIPresShell.h:ScrollAxis for details. |
michael@0 | 151 | * @param aHorizontal - how to align the frame horizontally and when. |
michael@0 | 152 | * See nsIPresShell.h:ScrollAxis for details. |
michael@0 | 153 | */ |
michael@0 | 154 | [noscript] void scrollIntoViewInternal(in short aRegion, |
michael@0 | 155 | in boolean aIsSynchronous, |
michael@0 | 156 | in ScrollAxis aVertical, |
michael@0 | 157 | in ScrollAxis aHorizontal); |
michael@0 | 158 | |
michael@0 | 159 | /** |
michael@0 | 160 | * Modifies the cursor Bidi level after a change in keyboard direction |
michael@0 | 161 | * @param langRTL is PR_TRUE if the new language is right-to-left or |
michael@0 | 162 | * PR_FALSE if the new language is left-to-right. |
michael@0 | 163 | */ |
michael@0 | 164 | [noscript] void selectionLanguageChange(in boolean langRTL); |
michael@0 | 165 | }; |
michael@0 | 166 |