This repository has been archived by the owner on May 27, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathJTextView.h
52 lines (42 loc) · 1.65 KB
/
JTextView.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//
// JTextView.h
// JKit
//
// Created by Jeremy Tregunna on 10-10-24.
// Copyright (c) 2010 Jeremy Tregunna. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <CoreText/CoreText.h>
#import "JTextCaret.h"
static NSString* const kJTextViewDataDetectorLinkKey = @"kJTextViewDataDetectorLinkKey";
static NSString* const kJTextViewDataDetectorPhoneNumberKey = @"kJTextViewDataDetectorPhoneNumberKey";
static NSString* const kJTextViewDataDetectorDateKey = @"kJTextViewDataDetectorDateKey";
static NSString* const kJTextViewDataDetectorAddressKey = @"kJTextViewDataDetectorAddressKey";
@protocol JTextViewDataDetectorDelegate <NSObject>
@optional
- (void) linkClicked:(id) data ofType:(NSString*)linkType;
@end
@interface JTextView : UIScrollView <UIKeyInput>
{
NSMutableAttributedString* _textStore;
UIColor* _textColor;
UIFont* _font;
BOOL _editable;
// Data detectors should also allow you to supply a style you want to use for different types of
// detectors. This is not yet implemented, but will be.
UIDataDetectorTypes _dataDetectorTypes;
@private
JTextCaret* caret;
CTFrameRef textFrame;
id<JTextViewDataDetectorDelegate> _dataDelegate;
}
@property (nonatomic, assign) id<JTextViewDataDetectorDelegate> dataDelegate;
@property (nonatomic, retain) NSMutableAttributedString* attributedText;
@property (nonatomic, retain) UIColor* textColor;
@property (nonatomic, retain) UIFont* font;
@property (nonatomic, getter=isEditable) BOOL editable;
@property (nonatomic) UIDataDetectorTypes dataDetectorTypes;
+ (CGFloat)suggestedHeightOfText:(NSString*)text forWidth:(float)maxWidth inFont:(UIFont*)font;
- (void)setText:(NSString*) newText;
- (NSString*)text;
@end