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"
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.
15 @interface HyperlinkTextView
: NSTextView
{
17 BOOL refusesFirstResponder_
;
18 BOOL drawsBackgroundUsingSuperview_
;
21 @
property(nonatomic
, assign
) BOOL drawsBackgroundUsingSuperview
;
23 // Set the |message| displayed by the HyperlinkTextView, using |font| and
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
33 linkColor
:(NSColor
*)linkColor
;
35 // This is NO (by default) if the view rejects first responder status.
36 - (void)setRefusesFirstResponder
:(BOOL
)refusesFirstResponder
;