Regression(r191673): Crash in RunLoopTimer::schedule()
[WebKit-https.git] / Source / WebKit2 / WebProcess / Plugins / PDF / PDFLayerControllerDetails.h
1 /*
2  * Copyright (C) 2012, 2015 Apple Inc. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  *    notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  *    notice, this list of conditions and the following disclaimer in the
11  *    documentation and/or other materials provided with the distribution.
12  *
13  * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
14  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
15  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
17  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
18  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
19  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
20  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
21  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
22  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
23  * THE POSSIBILITY OF SUCH DAMAGE.
24  */
25
26 #import <PDFKit/PDFKit.h>
27
28 @class CPReadingModel;
29 @class PDFViewLayout;
30
31 @protocol PDFLayerControllerDelegate <NSObject>
32
33 - (void)updateScrollPosition:(CGPoint)newPosition;
34 - (void)writeItemsToPasteboard:(NSArray *)items withTypes:(NSArray *)types;
35 - (void)showDefinitionForAttributedString:(NSAttributedString *)string atPoint:(CGPoint)point;
36 - (void)performWebSearch:(NSString *)string;
37 - (void)performSpotlightSearch:(NSString *)string;
38 - (void)openWithNativeApplication;
39 - (void)saveToPDF;
40
41 - (void)pdfLayerController:(PDFLayerController *)pdfLayerController didChangeActiveAnnotation:(PDFAnnotation *)annotation;
42 - (void)pdfLayerController:(PDFLayerController *)pdfLayerController clickedLinkWithURL:(NSURL *)url;
43 - (void)pdfLayerController:(PDFLayerController *)pdfLayerController didChangeContentScaleFactor:(CGFloat)scaleFactor;
44 - (void)pdfLayerController:(PDFLayerController *)pdfLayerController didChangeDisplayMode:(int)mode;
45 - (void)pdfLayerController:(PDFLayerController *)pdfLayerController didChangeSelection:(PDFSelection *)selection;
46
47 @end
48
49 @interface PDFLayerController : NSObject
50 @end
51
52 @interface PDFLayerController (Details)
53
54 @property(retain) CALayer *parentLayer;
55 @property(retain) PDFDocument *document;
56 @property(retain) id<PDFLayerControllerDelegate> delegate;
57
58 - (void)setFrameSize:(CGSize)size;
59
60 - (PDFDisplayMode)displayMode;
61 - (void)setDisplayMode:(PDFDisplayMode)mode;
62 - (void)setDisplaysPageBreaks:(BOOL)pageBreaks;
63
64 - (CGFloat)contentScaleFactor;
65 - (void)setContentScaleFactor:(CGFloat)scaleFactor;
66
67 - (CGFloat)deviceScaleFactor;
68 - (void)setDeviceScaleFactor:(CGFloat)scaleFactor;
69
70 - (CGSize)contentSize;
71 - (CGSize)contentSizeRespectingZoom;
72
73 - (void)snapshotInContext:(CGContextRef)context;
74
75 - (void)magnifyWithMagnification:(CGFloat)magnification atPoint:(CGPoint)point immediately:(BOOL)immediately;
76
77 - (CGPoint)scrollPosition;
78 - (void)setScrollPosition:(CGPoint)newPosition;
79 - (void)scrollWithDelta:(CGSize)delta;
80
81 - (void)mouseDown:(NSEvent *)event;
82 - (void)rightMouseDown:(NSEvent *)event;
83 - (void)mouseMoved:(NSEvent *)event;
84 - (void)mouseUp:(NSEvent *)event;
85 - (void)mouseDragged:(NSEvent *)event;
86 - (void)mouseEntered:(NSEvent *)event;
87 - (void)mouseExited:(NSEvent *)event;
88
89 - (NSMenu *)menuForEvent:(NSEvent *)event;
90
91 - (NSArray *)findString:(NSString *)string caseSensitive:(BOOL)isCaseSensitive highlightMatches:(BOOL)shouldHighlightMatches;
92
93 - (PDFSelection *)currentSelection;
94 - (void)setCurrentSelection:(PDFSelection *)selection;
95 - (PDFSelection *)searchSelection;
96 - (void)setSearchSelection:(PDFSelection *)selection;
97 - (void)gotoSelection:(PDFSelection *)selection;
98 - (PDFSelection *)getSelectionForWordAtPoint:(CGPoint)point;
99 - (NSArray *)rectsForSelectionInLayoutSpace:(PDFSelection *)selection;
100 - (NSArray *)rectsForAnnotationInLayoutSpace:(PDFAnnotation *)annotation;
101 - (PDFViewLayout *)layout;
102 - (NSRect)frame;
103
104 - (PDFPage *)currentPage;
105 - (NSUInteger)lastPageIndex;
106 - (NSUInteger)currentPageIndex;
107 - (void)gotoNextPage;
108 - (void)gotoPreviousPage;
109
110 - (void)copySelection;
111 - (void)selectAll;
112
113 - (bool)keyDown:(NSEvent *)event;
114
115 - (void)setHUDEnabled:(BOOL)enabled;
116 - (BOOL)hudEnabled;
117
118 - (CGRect)boundsForAnnotation:(PDFAnnotation *)annotation;
119 - (void)activateNextAnnotation:(BOOL)previous;
120
121 - (void)attemptToUnlockWithPassword:(NSString *)password;
122
123 - (void)searchInDictionaryWithSelection:(PDFSelection *)selection;
124
125 // Accessibility
126
127 - (CPReadingModel *)readingModel;
128 - (id)accessibilityFocusedUIElement;
129 - (NSArray *)accessibilityAttributeNames;
130 - (BOOL)accessibilityIsAttributeSettable:(NSString *)attribute;
131 - (void)accessibilitySetValue:(id)value forAttribute:(NSString *)attribute;
132 - (NSArray *)accessibilityParameterizedAttributeNames;
133 - (NSString *)accessibilityRoleAttribute;
134 - (NSString *)accessibilityRoleDescriptionAttribute;
135 - (NSString *)accessibilityValueAttribute;
136 - (BOOL)accessibilityIsValueAttributeSettable;
137 - (NSString *)accessibilitySelectedTextAttribute;
138 - (BOOL)accessibilityIsSelectedTextAttributeSettable;
139 - (NSValue *)accessibilitySelectedTextRangeAttribute;
140 - (NSNumber *)accessibilityNumberOfCharactersAttribute;
141 - (BOOL)accessibilityIsNumberOfCharactersAttributeSettable;
142 - (NSValue *)accessibilityVisibleCharacterRangeAttribute;
143 - (BOOL)accessibilityIsVisibleCharacterRangeAttributeSettable;
144 - (NSNumber *)accessibilityLineForIndexAttributeForParameter:(id)parameter;
145 - (NSValue *)accessibilityRangeForLineAttributeForParameter:(id)parameter;
146 - (NSString *)accessibilityStringForRangeAttributeForParameter:(id)parameter;
147 - (NSValue *)accessibilityBoundsForRangeAttributeForParameter:(id)parameter;
148
149 @end