FPKView Protocol Reference
Conforms to | NSObject |
Declared in | FPKView.h |
Overview
The FPKView protocol must be implemented on each Extension. It includes the methods that will be called by the FPKOverlayManager to instantiate and communicate with the Extension.
Tasks
-
– initWithParams:andFrame:from:
This method is called by the FPKOverlayManager if the Extension supports the requested prefix. You should return the UIView to be placed over the page. You can also return
required methodnil
and perform some other operations like presenting a modal view on the -
+ acceptedPrefixes
Get the accepted prefixes by an Extension encapsulated in an NSArray of NSString. Obviously you can support even just one prefix.
required method -
+ respondsToPrefix:
You should implement this method to return a BOOL value only on supported prefixes.
required method -
– rect
The frame of the view can change when the pdf mode change and the device is rotated. The original frame is stored to perform the conversion on the fly when needed.
required method -
– setRect:
Set the original frame. More info on rect.
required method -
– willRemoveOverlayView:
The view will be notified if it will be removed from the screen. You can decide to perform some operations like stopping timers and release objects.
Class Methods
acceptedPrefixes
Get the accepted prefixes by an Extension encapsulated in an NSArray of NSString. Obviously you can support even just one prefix.
+ (NSArray *)acceptedPrefixes
Discussion
Get the accepted prefixes by an Extension encapsulated in an NSArray of NSString. Obviously you can support even just one prefix.
[NSArray arrayWithObjects:@"map", nil];
@return
Declared In
FPKView.h
respondsToPrefix:
You should implement this method to return a BOOL value only on supported prefixes.
+ (BOOL)respondsToPrefix:(NSString *)prefix
Parameters
- prefix
The prefix in the form
@"map"
.
Return Value
YES or NO if the prefix is support by the Extension.
Discussion
You should implement this method to return a BOOL value only on supported prefixes.
Declared In
FPKView.h
Instance Methods
initWithParams:andFrame:from:
This method is called by the FPKOverlayManager if the Extension supports the requested prefix.
You should return the UIView to be placed over the page. You can also return nil
and perform some other operations like presenting a modal view on the
- (UIView *)initWithParams:(NSDictionary *)params andFrame:(CGRect)frame from:(FPKOverlayManager *)manager
Parameters
- params
This dictionary contains all the parameters extracted from the url
- prefix the part in the url before
://
- path the part in the url after
://
- params another NSDictionary that contains the parsed parameters after the
://
- resource the part before
?
- … custom parameters included in the annotation separated by
&
- resource the part before
- load YES if the call for the view is made when the pdf page is going to be loaded, NO if the call is made when the user taps on the annotation area
- prefix the part in the url before
- frame
The annotation frame in pdf page coordinates. If the
padding
parameter is specified in the url, the frame is a CGRectInset of the real annotation frame. This feature is useful if the pdf has been created with Adobe InDesign that creates the annotation 2 pixel wider than the original object. Just specify in the url a param?padding=2
and the frame will be set accordingly.
- manager
The FPKOverlayManager that can be used to perform many operations like accessing the MFDocumentViewController or the MFDocumentManager.
Return Value
UIView that will be placed over the pdf page by the FPKOverlayManager.
Discussion
This method is called by the FPKOverlayManager if the Extension supports the requested prefix.
You should return the UIView to be placed over the page. You can also return nil
and perform some other operations like presenting a modal view on the
Declared In
FPKView.h
rect
The frame of the view can change when the pdf mode change and the device is rotated. The original frame is stored to perform the conversion on the fly when needed.
- (CGRect)rect
Return Value
rect The original frame of the UIView.
Discussion
The frame of the view can change when the pdf mode change and the device is rotated. The original frame is stored to perform the conversion on the fly when needed.
Declared In
FPKView.h
setRect:
Set the original frame. More info on rect.
- (void)setRect:(CGRect)rect
Parameters
- rect
The original frame.
Discussion
Set the original frame. More info on rect.
Declared In
FPKView.h
willRemoveOverlayView:
The view will be notified if it will be removed from the screen. You can decide to perform some operations like stopping timers and release objects.
- (void)willRemoveOverlayView:(FPKOverlayManager *)manager
Parameters
- manager
The manager is the sender. It could be useful.
Discussion
The view will be notified if it will be removed from the screen. You can decide to perform some operations like stopping timers and release objects.
Declared In
FPKView.h