Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / ui / base / cocoa / controls / hyperlink_text_view.h
blobf04ad40b1823aee1b60fa85e0c5e2b39aec6b907
1 // Copyright (c) 2011 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.
5 #import <Cocoa/Cocoa.h>
7 #include "ui/base/ui_base_export.h"
9 @class NSColor;
11 // HyperlinkTextView is an NSTextView subclass for unselectable, linkable text.
12 // This subclass doesn't show the text caret or IBeamCursor, whereas the base
13 // class NSTextView displays both with full keyboard accessibility enabled.
14 UI_BASE_EXPORT
15 @interface HyperlinkTextView : NSTextView {
16 @private
17 BOOL refusesFirstResponder_;
18 BOOL drawsBackgroundUsingSuperview_;
21 @property(nonatomic, assign) BOOL drawsBackgroundUsingSuperview;
23 // Set the |message| displayed by the HyperlinkTextView, using |font| and
24 // |messageColor|.
25 - (void)setMessage:(NSString*)message
26 withFont:(NSFont*)font
27 messageColor:(NSColor*)messageColor;
29 // Marks a |range| within the given message as link, associating it with
30 // a |name| that is passed to the delegate's textView:clickedOnLink:atIndex:.
31 - (void)addLinkRange:(NSRange)range
32 withName:(id)name
33 linkColor:(NSColor*)linkColor;
35 // This is NO (by default) if the view rejects first responder status.
36 - (void)setRefusesFirstResponder:(BOOL)refusesFirstResponder;
38 @end