-
Notifications
You must be signed in to change notification settings - Fork 1
/
MNLineNumberingRulerView.h
101 lines (65 loc) · 2.06 KB
/
MNLineNumberingRulerView.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
//
// MNLineNumberingRulerView.h
//
//
// Created by Masatoshi Nishikata on 29/10/05.
// Copyright 2005 Masatoshi Nishikata. All rights reserved.
// http://homepage.mac.com/mnishikata/iblog/
//ORIGINAL
//
// MyTextView.m
// LineNumbering
//
// Created by Koen van der Drift on Sat May 01 2004.
// Copyright (c) 2004 Koen van der Drift. All rights reserved.
//
#import <Cocoa/Cocoa.h>
@class MNLineNumberingTextStorage;
extern const int MNNoLineNumbering;
extern const int MNParagraphNumber;
extern const int MNCharacterNumber;
extern const int MNLineNumber;
extern const int MNDrawBookmarks;
@interface MNLineNumberingRulerView : NSRulerView {
//nib outlets
IBOutlet id dialogueView;
IBOutlet id radioButtons;
IBOutlet id textField;
NSTextView* textView;
NSLayoutManager* layoutManager;
NSImage* markerImage;
int rulerOption;
NSMutableDictionary* marginAttributes;
BOOL markerDeleteReservationFlag;
}
-(void)startSheet;
// Start 'Jump To...' sheet.
-(BOOL)showParagraph:(unsigned)paragraphNum;
-(BOOL)showLine:(unsigned)lineNum;
-(BOOL)showCharacter:(unsigned)charIndex granularity:(NSSelectionGranularity)granularity;
// show line in document text view
// Granularity is one of NSSelectByCharacter, NSSelectByWord, NSSelectByParagraph, or -1(select by line)
-(void)setVisible:(BOOL)flag;
-(BOOL)isVisible;
// Set and Return Ruler View visiblity.
-(void)setOption:(unsigned)option;
// option is
/*
extern const int MNNoLineNumbering;
extern const int MNParagraphNumber;
extern const int MNCharacterNumber;
extern const int MNLineNumber;
extern const int MNDrawBookmarks;
*/
////// private
-(IBAction)jumpButtonClicked:(id)sender;
-(unsigned)lineNumberAtIndex:(unsigned)charIndex;
-(unsigned)charIndexOfLineNumber:(unsigned)lineNumber;
-(void)drawEmptyMargin;
-(void) drawParagraphNumbersInMargin;
-(void) drawNumbersInMargin;
-(void)drawOneNumberInMargin:(unsigned) aNumber inRect:(NSRect)r ;
-(void)drawMarkerInRect:(NSRect)lineRect;
-(unsigned)characterIndexAtLocation:(float)pos;
-(NSRulerMarker*)newMarker;
@end