Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1503)

Side by Side Diff: ui/accessibility/platform/text_marker_helper_mac.h

Issue 2940923003: a11y: Move CreateTextMarker[Range] to TextMarkerHelperMac.
Patch Set: self review Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef UI_ACCESSIBILITY_PLATFORM_TEXT_MARKER_HELPER_MAC_H_
6 #define UI_ACCESSIBILITY_PLATFORM_TEXT_MARKER_HELPER_MAC_H_
7
8 #import <Foundation/Foundation.h>
9
10 #include <memory>
11
12 #include "base/macros.h"
13 #include "ui/accessibility/ax_enums.h"
14 #include "ui/accessibility/ax_export.h"
15
16 typedef struct OpaqueAXTextMarkerRef* AXTextMarkerRef;
17 typedef struct OpaqueAXTextMarkerRangeRef* AXTextMarkerRangeRef;
18
19 // TODO(tapted): Hide these.
20 extern "C" {
21 const UInt8* AXTextMarkerGetBytePtr(AXTextMarkerRef text_marker);
22 size_t AXTextMarkerGetLength(AXTextMarkerRef text_marker);
23 AXTextMarkerRef AXTextMarkerRangeCopyStartMarker(
24 AXTextMarkerRangeRef text_marker_range);
25 AXTextMarkerRef AXTextMarkerRangeCopyEndMarker(
26 AXTextMarkerRangeRef text_marker_range);
27 }
28
29 namespace ui {
30
31 class AXAbstractRange;
32 class AXPositionBase;
33
34 class AX_EXPORT PositionFactory {
tapted 2017/06/19 11:44:30 (self review: comment)
35 public:
36 PositionFactory() {}
37 virtual ~PositionFactory() {}
38
39 virtual std::unique_ptr<AXPositionBase> GetRoot() const = 0;
tapted 2017/06/19 11:44:30 (self review: these too)
40 virtual std::unique_ptr<AXAbstractRange> GetSelection() const = 0;
41 virtual std::unique_ptr<AXPositionBase> ExtractFromMarker(
42 AXTextMarkerRef marker) const = 0;
43 };
44
45 } // namespace ui
46
47 AX_EXPORT
48 @interface TextMarkerHelperMac : NSObject
tapted 2017/06/19 11:44:30 (self review: comment)
49
50 - (instancetype)initWithFactory:(std::unique_ptr<ui::PositionFactory>)factory;
51
52 // Returns a text marker that points to the first character in the document that
53 // can be selected with VoiceOver.
54 - (id)startTextMarker;
55
56 // Returns a text marker that points to the last character in the document that
57 // can be selected with VoiceOver.
58 - (id)endTextMarker;
59
60 // Returns a text marker range corresponding to the current selection.
61 - (id)selectedTextMarkerRange;
62
63 @end
64
65 #endif // UI_ACCESSIBILITY_PLATFORM_TEXT_MARKER_HELPER_MAC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698