PDocAccessible.ipdl (5834B)
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 /* vim: set ts=2 et sw=2 tw=80: */ 3 /* This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 include protocol PBrowser; 8 9 include DocAccessibleTypes; 10 11 include "mozilla/GfxMessageUtils.h"; 12 13 using mozilla::LayoutDeviceIntRect from "Units.h"; 14 using mozilla::LayoutDeviceIntPoint from "Units.h"; 15 using mozilla::LayoutDeviceIntSize from "Units.h"; 16 using mozilla::a11y::role from "mozilla/a11y/IPCTypes.h"; 17 using mozilla::a11y::AccType from "mozilla/a11y/IPCTypes.h"; 18 using mozilla::a11y::AccGenericType from "mozilla/a11y/IPCTypes.h"; 19 [RefCounted] using mozilla::a11y::AccAttributes from "mozilla/a11y/IPCTypes.h"; 20 using mozilla::a11y::CacheUpdateType from "mozilla/a11y/IPCTypes.h"; 21 using mozilla::gfx::Matrix4x4 from "mozilla/gfx/Matrix.h"; 22 23 namespace mozilla { 24 namespace a11y { 25 26 struct AccessibleData 27 { 28 uint64_t ID; 29 role Role; 30 uint64_t ParentID; 31 uint32_t IndexInParent; 32 AccType Type; 33 AccGenericType GenericTypes; 34 uint8_t RoleMapEntryIndex; 35 nullable AccAttributes CacheFields; 36 }; 37 38 struct CacheEventData { 39 CacheUpdateType UpdateType; 40 CacheData[] aData; 41 }; 42 43 struct ShowEventData { 44 AccessibleData[] NewTree; 45 bool EventSuppressed; 46 bool Complete; 47 bool FromUser; 48 }; 49 50 struct HideEventData { 51 uint64_t ID; 52 bool IsFromUserInput; 53 }; 54 55 struct ReorderEventData { 56 uint64_t ID; 57 uint32_t Type; 58 }; 59 60 struct TextChangeEventData { 61 uint64_t ID; 62 nsString Str; 63 int32_t Start; 64 uint32_t Len; 65 bool IsInsert; 66 bool FromUser; 67 }; 68 69 union MutationEventData { 70 CacheEventData; 71 ShowEventData; 72 HideEventData; 73 ReorderEventData; 74 TextChangeEventData; 75 }; 76 77 struct TextRangeData 78 { 79 uint64_t StartID; 80 uint64_t EndID; 81 int32_t StartOffset; 82 int32_t EndOffset; 83 }; 84 85 [ManualDealloc, ChildImpl=virtual, ParentImpl=virtual] 86 protocol PDocAccessible 87 { 88 manager PBrowser; 89 90 parent: 91 async Shutdown(); 92 93 /* 94 * Notify the parent process the document in the child process is firing an 95 * event. 96 */ 97 async Event(uint64_t aID, uint32_t type); 98 async StateChangeEvent(uint64_t aID, uint64_t aState, bool aEnabled); 99 async CaretMoveEvent(uint64_t aID, 100 LayoutDeviceIntRect aCaretRect, 101 int32_t aOffset, 102 bool aIsSelectionCollapsed, bool aIsAtEndOfLine, 103 int32_t aGranularity, bool aFromUser); 104 async MutationEvents(MutationEventData[] aData); 105 async RequestAckMutationEvents(); 106 async SelectionEvent(uint64_t aID, uint64_t aWidgetID, uint32_t aType); 107 async RoleChangedEvent(role aRole, uint8_t aRoleMapEntryIndex); 108 async FocusEvent(uint64_t aID, LayoutDeviceIntRect aCaretRect); 109 async ScrollingEvent(uint64_t aID, uint64_t aType, 110 uint32_t aScrollX, uint32_t aScrollY, 111 uint32_t aMaxScrollX, uint32_t aMaxScrollY); 112 #ifndef XP_WIN 113 async AnnouncementEvent(uint64_t aID, 114 nsString aAnnouncement, 115 uint16_t aPriority); 116 #endif 117 async TextSelectionChangeEvent(uint64_t aID, TextRangeData[] aSelection); 118 119 /* 120 * Tell the parent document to bind the existing document as a new child 121 * document. 122 */ 123 async BindChildDoc(PDocAccessible aChildDoc, uint64_t aID); 124 125 /* 126 * Cache The World 127 */ 128 async Cache(CacheUpdateType aUpdateType, CacheData[] aData); 129 130 /* 131 * Lists of accessibles that either gained or lost a selected state. 132 */ 133 async SelectedAccessiblesChanged(uint64_t[] aSelectedIDs, uint64_t[] aUnselectedIDs); 134 135 /* 136 * Tell the parent process that the given Accessibles are about to be moved 137 * via subsequent hide and show events. 138 */ 139 async AccessiblesWillMove(uint64_t[] aIDs); 140 141 child: 142 async __delete__(); 143 144 /* 145 * Called as a result of focus shifting from chrome to content 146 * elements through keyboard navigation. 147 */ 148 async RestoreFocus(); 149 150 // LocalAccessible 151 async ScrollTo(uint64_t aID, uint32_t aScrollType); 152 async ScrollToPoint(uint64_t aID, uint32_t aScrollType, int32_t aX, 153 int32_t aY); 154 #ifndef XP_WIN 155 async Announce(uint64_t aID, nsString aAnnouncement, uint16_t aPriority); 156 #endif 157 158 // AccessibleText 159 160 async SetTextSelection(uint64_t aStartID, int32_t aStartOffset, 161 uint64_t aEndID, int32_t aEndOffset, 162 int32_t aSelectionNum, bool aSetFocus); 163 async RemoveTextSelection(uint64_t aID, int32_t aSelectionNum); 164 165 async ScrollTextLeafRangeIntoView(uint64_t aStartID, int32_t aStartOffset, 166 uint64_t aEndID, int32_t aEndOffset, 167 uint32_t aScrollType); 168 async ScrollSubstringToPoint(uint64_t aID, 169 int32_t aStartOffset, 170 int32_t aEndOffset, 171 uint32_t aCoordinateType, 172 int32_t aX, int32_t aY); 173 174 async ReplaceText(uint64_t aID, nsString aText); 175 async InsertText(uint64_t aID, nsString aText, int32_t aPosition); 176 async CopyText(uint64_t aID, int32_t aStartPos, int32_t aEndPos); 177 async CutText(uint64_t aID, int32_t aStartPos, int32_t aEndPos); 178 async DeleteText(uint64_t aID, int32_t aStartPos, int32_t aEndPos); 179 async PasteText(uint64_t aID, int32_t aPosition); 180 181 async TakeSelection(uint64_t aID); 182 async SetSelected(uint64_t aID, bool aSelected); 183 184 async DoActionAsync(uint64_t aID, uint8_t aIndex); 185 186 async SetCurValue(uint64_t aID, double aValue); 187 188 async TakeFocus(uint64_t aID); 189 190 /* 191 * Verify the cache. Used for testing purposes. 192 */ 193 async VerifyCache(uint64_t aID, uint64_t aCacheDomain, nullable AccAttributes aFields); 194 195 async AckMutationEvents(); 196 197 }; 198 199 } 200 }