accessible/mac/MOXTextMarkerDelegate.h
author Eitan Isaacson <eitan@monotonous.org>
Tue, 21 Jul 2020 23:02:55 +0000
changeset 541524 1d37ebf3d20ce8071c7482fbf7bcdc37834e950c
parent 541355 8dc0120d47e63446d78b76887d53587031621d76
child 545589 6f2c0de41947528440c4516f8e2314b09742001a
permissions -rw-r--r--
Bug 1653421 - Part 2: Add attributed string for range getter. r=morgan This doesn't actually add any attributes yet. VoiceOver uses this instead of the plain string equivalent. Differential Revision: https://phabricator.services.mozilla.com/D84054

/* -*- 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;

@end