forked from adlr/formulatepro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
FPDocumentView.h
80 lines (60 loc) · 2.07 KB
/
FPDocumentView.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
/* FPDocumentView */
#import <Cocoa/Cocoa.h>
#import <PDFKit/PDFKit.h>
@class FPGraphic;
@class MyDocument;
#define FPSelectionChangedNotification @"FPSelectionChangedNotification"
@interface FPDocumentView : NSView
{
IBOutlet MyDocument *_doc;
PDFDocument *_pdf_document;
unsigned int _current_page;
PDFDisplayBox _box;
float _scale_factor;
BOOL _draws_shadow;
BOOL _inQuickMove;
BOOL _is_printing;
NSMutableArray *_overlayGraphics;
NSMutableSet *_selectedGraphics;
FPGraphic *_editingGraphic;
// For zooming
IBOutlet NSScrollView *_scrollView;
}
- (void)setPDFDocument:(PDFDocument *)pdf_document;
- (void)zoomIn:(id)sender;
- (void)zoomOut:(id)sender;
- (void)nextPage;
- (void)previousPage;
- (void)scrollToPage:(unsigned int)page;
- (float)scaleFactor;
- (BOOL)shouldEnterQuickMove;
- (void)beginQuickMove:(id)unused;
- (void)endQuickMove:(id)unused;
- (NSSet *)selectedGraphics;
- (void)deleteSelectedGraphics;
- (BOOL)handleColorChange:(NSColor*)newColor;
- (NSColor*)defaultStrokeColor;
- (unsigned int)getViewingMidpointToPage:(unsigned int*)page pagePoint:(NSPoint*)pagePoint;
- (void)scrollToMidpointOnPage:(unsigned int)page point:(NSPoint)midPoint;
// place image
- (IBAction)placeImage:(id)sender;
// coordinate transforms
- (unsigned int)pageForPointFromEvent:(NSEvent *)theEvent;
- (unsigned int)pageForPoint:(NSPoint)point;
- (NSPoint)pagePointForPointFromEvent:(NSEvent *)theEvent
page:(unsigned int)page;
- (NSRect)convertRect:(NSRect)rect toPage:(unsigned int)page;
- (NSRect)convertRect:(NSRect)rect fromPage:(unsigned int)page;
- (NSPoint)convertPoint:(NSPoint)point toPage:(unsigned int)page;
- (NSPoint)convertPoint:(NSPoint)point fromPage:(unsigned int)page;
// printing
- (FPDocumentView *)printableCopy;
- (NSRect)rectForPage:(int)page; // indexed from 1, not 0
// opening and saving
- (NSArray *)archivalOverlayGraphics;
- (void)setOverlayGraphicsFromArray:(NSArray *)arr;
// font
- (NSFont *)currentFont;
// private
- (NSAffineTransform *)transformForPage:(unsigned int)page;
@end