1 | /*-------------------------------------------------------------------------------------------------------*\ |
---|
2 | | Adium, Copyright (C) 2001-2005, Adam Iser (adamiser@mac.com | http://www.adiumx.com) | |
---|
3 | \---------------------------------------------------------------------------------------------------------/ |
---|
4 | | This program is free software; you can redistribute it and/or modify it under the terms of the GNU |
---|
5 | | General Public License as published by the Free Software Foundation; either version 2 of the License, |
---|
6 | | or (at your option) any later version. |
---|
7 | | |
---|
8 | | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even |
---|
9 | | the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
---|
10 | | Public License for more details. |
---|
11 | | |
---|
12 | | You should have received a copy of the GNU General Public License along with this program; if not, |
---|
13 | | write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
---|
14 | \------------------------------------------------------------------------------------------------------ */ |
---|
15 | |
---|
16 | @class AIFlexibleLink; |
---|
17 | |
---|
18 | @interface AILinkTrackingController : NSObject { |
---|
19 | NSView *controlView; //The view we're tracking links in |
---|
20 | NSMutableArray *linkArray; //Array of active flexible links |
---|
21 | |
---|
22 | AIFlexibleLink *hoveredLink; //The link currently being hovered |
---|
23 | NSString *hoveredString; |
---|
24 | BOOL mouseOverLink; //Yes if the cursor is over one of our links |
---|
25 | BOOL showTooltip; //Yes if we want to display the tooltip over a hovered link |
---|
26 | |
---|
27 | //The text system of the view we're tracking links for |
---|
28 | NSTextStorage *textStorage; |
---|
29 | NSLayoutManager *layoutManager; |
---|
30 | NSTextContainer *textContainer; |
---|
31 | } |
---|
32 | |
---|
33 | + (id)linkTrackingControllerForView:(NSView *)inControlView withTextStorage:(NSTextStorage *)inTextStorage layoutManager:(NSLayoutManager *)inLayoutManager textContainer:(NSTextContainer *)inTextContainer; |
---|
34 | + (id)linkTrackingControllerForTextView:(NSTextView *)inTextView; |
---|
35 | - (void)trackLinksInRect:(NSRect)visibleRect withOffset:(NSPoint)offset; |
---|
36 | - (BOOL)handleMouseDown:(NSEvent *)theEvent withOffset:(NSPoint)offset; |
---|
37 | - (void)setShowTooltip:(BOOL)inShowTooltip; |
---|
38 | - (NSArray *)menuItemsForEvent:(NSEvent *)theEvent withOffset:(NSPoint)offset; |
---|
39 | |
---|
40 | @end |
---|