accessible/mac/MOXTextMarkerDelegate.h
author Eitan Isaacson <eitan@monotonous.org>
Thu, 20 Aug 2020 22:12:23 +0000
changeset 545589 6f2c0de41947528440c4516f8e2314b09742001a
parent 541524 1d37ebf3d20ce8071c7482fbf7bcdc37834e950c
child 546310 c79e406f9073b1894dedacf30966e3a631a3f339
permissions -rw-r--r--
Bug 1660109 - Support get bounds for text marker range. r=Jamie Depends on D87669 Differential Revision: https://phabricator.services.mozilla.com/D87670

/* -*- Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */

#import <Cocoa/Cocoa.h>

#import "MOXAccessibleProtocol.h"

#include "AccessibleOrProxy.h"

@interface MOXTextMarkerDelegate : NSObject <MOXTextMarkerSupport> {
  mozilla::a11y::AccessibleOrProxy mGeckoDocAccessible;
  id mSelection;
}

+ (id)getOrCreateForDoc:(mozilla::a11y::AccessibleOrProxy)aDoc;

+ (void)destroyForDoc:(mozilla::a11y::AccessibleOrProxy)aDoc;

- (id)initWithDoc:(mozilla::a11y::AccessibleOrProxy)aDoc;

- (void)dealloc;

- (void)setSelectionFrom:(mozilla::a11y::AccessibleOrProxy)startContainer
                      at:(int32_t)startOffset
                      to:(mozilla::a11y::AccessibleOrProxy)endContainer
                      at:(int32_t)endOffset;

- (void)invalidateSelection;

// override
- (id)moxStartTextMarker;

// override
- (id)moxEndTextMarker;

// override
- (id)moxSelectedTextMarkerRange;

// override
- (NSNumber*)moxLengthForTextMarkerRange:(id)textMarkerRange;

// override
- (NSString*)moxStringForTextMarkerRange:(id)textMarkerRange;

// override
- (id)moxTextMarkerRangeForUnorderedTextMarkers:(NSArray*)textMarkers;

// override
- (id)moxStartTextMarkerForTextMarkerRange:(id)textMarkerRange;

// override
- (id)moxEndTextMarkerForTextMarkerRange:(id)textMarkerRange;

// override
- (id)moxLeftWordTextMarkerRangeForTextMarker:(id)textMarker;

// override
- (id)moxRightWordTextMarkerRangeForTextMarker:(id)textMarker;

// override
- (id)moxNextTextMarkerForTextMarker:(id)textMarker;

// override
- (id)moxPreviousTextMarkerForTextMarker:(id)textMarker;

// override
- (NSAttributedString*)moxAttributedStringForTextMarkerRange:(id)textMarkerRange;

// override
- (NSValue*)moxBoundsForTextMarkerRange:(id)textMarkerRange;

@end