NaCl: Update revision in DEPS, r12770 -> r12773
[chromium-blink-merge.git] / chrome / browser / ui / cocoa / hyperlink_text_view.h
blob06180ae285e6008699117c87817caa92d719d00e
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 @class NSColor;
9 // HyperlinkTextView is an NSTextView subclass for unselectable, linkable text.
10 // This subclass doesn't show the text caret or IBeamCursor, whereas the base
11 // class NSTextView displays both with full keyboard accessibility enabled.
12 @interface HyperlinkTextView : NSTextView {
13 @private
14 BOOL acceptsFirstResponder_;
17 // Convenience function that sets the |HyperlinkTextView| contents to the
18 // specified |message| with a hypertext style |link| inserted at |linkOffset|.
19 // Uses the supplied |font|, |messageColor|, and |linkColor|.
20 - (void)setMessageAndLink:(NSString*)message
21 withLink:(NSString*)link
22 atOffset:(NSUInteger)linkOffset
23 font:(NSFont*)font
24 messageColor:(NSColor*)messageColor
25 linkColor:(NSColor*)linkColor;
27 // Set the |message| displayed by the HyperlinkTextView, using |font| and
28 // |messageColor|.
29 - (void)setMessage:(NSString*)message
30 withFont:(NSFont*)font
31 messageColor:(NSColor*)messageColor;
33 // Marks a |range| within the given message as link, associating it with
34 // a |name| that is passed to the delegate's textView:clickedOnLink:atIndex:.
35 - (void)addLinkRange:(NSRange)range
36 withName:(id)name
37 linkColor:(NSColor*)linkColor;
39 // This is YES (by default) if the view accepts first responder status.
40 - (void)setAcceptsFirstResponder:(BOOL)acceptsFirstResponder;
42 @end