CatNiP prefinal
Sähköinen nuottikirja, HY-TKTKL-OHTUPROJ KESÄ11
UIDocumentView Class Reference

A sister class of UIImageView for viewing documents. More...

#import <UIDocumentView.h>

List of all members.

Public Member Functions

(void) - centerContent
 Centers the content in the document view.
(void) - dealloc [implementation]
(id) - init [implementation]
 Initializes the internal variables of the object.
(id) - initWithCoder: [implementation]
 Initializes the object using the data in a given unarchiver.
(id) - initWithDocument:
 Returns a document view initialized with the specified document.
(id) - initWithFrame: [implementation]
 Initializes the object with the specified frame rectangle and default display settings.
(void) - refresh
 Refreshes the document view: lazy loads all unloaded images in the preload area and unloads the rest.
(void) - scrollViewDidEndDecelerating: [implementation]
(void) - scrollViewDidEndDragging:willDecelerate: [implementation]
(void) - scrollViewDidEndScrollingAnimation: [implementation]
(void) - scrollViewDidEndZooming:withView:atScale: [implementation]
(void) - scrollViewDidScroll: [implementation]
(void) - scrollViewDidScrollToTop: [implementation]
(void) - scrollViewDidZoom: [implementation]
(BOOL) - scrollViewShouldScrollToTop: [implementation]
(void) - scrollViewWillBeginDecelerating: [implementation]
(void) - scrollViewWillBeginDragging: [implementation]
(void) - scrollViewWillBeginZooming:withView: [implementation]
(void) - setDocument: [implementation]
 Sets the document displayed in the document view.
(UIView *) - viewForZoomingInScrollView: [implementation]

Protected Attributes

UIView * container
 A containing superview for the UIImageView objects that represent the pages of the document.
NSOperationQueue * operationQueue
 An operation queue for lazy loading the page images.

Properties

id< UIScrollViewDelegate > delegate
 The delegate of the document view object.
UIDocumentdocument
 The document displayed in the document view.
UIImage * placeholder
 The placeholder image to use for document pages that have not been loaded into memory yet.
CGFloat preloadFactor
 How many view-heights above and below the currently viewed area should be preloaded into memory.

Detailed Description

A sister class of UIImageView for viewing documents.

A document view object provides a view-based container for displaying a single document as a vertically concatenated series of lazy-loaded pages. UIDocumentView provides both scrolling and zooming functionality and shares all its default property values with UIScrollView; remember to set minimumZoomScale and maximumZoomScale to something other than 1.0 if you want zooming behaviour.

Note that the delegate property in UIDocumentView obscures that of its superclass in order to provide default zooming behaviour: take extreme care in giving it delegates that also respond to zoom events. The delegate also needs to be set programmatically, as Interface Builder only recognizes the delegate property of the UIScrollView superclass.

Created by Lari O Rasku, tkol on 6/13/11. Copyright 2011 __MyCompanyName__. All rights reserved.

Definition at line 12 of file UIDocumentView.h.


Member Function Documentation

- (void) centerContent

Centers the content in the document view.

This method is called automatically whenever the document view is zoomed.

Definition at line 229 of file UIDocumentView.m.

References container.

Here is the caller graph for this function:

- (void) dealloc [implementation]

Definition at line 328 of file UIDocumentView.m.

References container, document, and placeholder.

- (id) init [implementation]

Initializes the internal variables of the object.

Do not use this method to initialize new instances of the object. It only encapsulates common initialization code and does not call any superclass constructors. Use initWithDocument or initWithFrame instead.

Returns:
The initialized object.

Definition at line 106 of file UIDocumentView.m.

References container, operationQueue, placeholder, and preloadFactor.

Here is the caller graph for this function:

- (id) initWithCoder: (NSCoder *)  aDecoder [implementation]

Initializes the object using the data in a given unarchiver.

This method is used to provide compatibility with xib files. Do not call it programmatically.

Parameters:
aDecoderAn unarchiver object.
Returns:
The initialized object, or nil if the object couldn't be created.

Definition at line 141 of file UIDocumentView.m.

References init.

Here is the call graph for this function:

- (id) initWithDocument: (UIDocument *)  uiDocument

Returns a document view initialized with the specified document.

Parameters:
uiDocumentThe initial document to display in the document view.
Returns:
An initialized document view object.

Definition at line 124 of file UIDocumentView.m.

References init.

Here is the call graph for this function:

- (id) initWithFrame: (CGRect)  frame [implementation]

Initializes the object with the specified frame rectangle and default display settings.

Parameters:
frameThe frame rectangle for the view, measured in points.
Returns:
The initialized object, or nil if the object couldn't be created.

Definition at line 155 of file UIDocumentView.m.

References init.

Here is the call graph for this function:

- (void) refresh

Refreshes the document view: lazy loads all unloaded images in the preload area and unloads the rest.

This method is called automatically whenever the document view is scrolled or zoomed.

Definition at line 166 of file UIDocumentView.m.

References container, document, UIDocument::getImageOfPage:, UIDocument::getSizeOfPage:, UIDocument::numberOfPages, operationQueue, placeholder, preloadFactor, and UIDocument::size.

Here is the call graph for this function:

Here is the caller graph for this function:

- (void) scrollViewDidEndDecelerating: (UIScrollView *)  scrollView [implementation]

Definition at line 304 of file UIDocumentView.m.

References delegate.

- (void) scrollViewDidEndDragging: (UIScrollView *)  scrollView
willDecelerate: (BOOL)  decelerate 
[implementation]

Definition at line 279 of file UIDocumentView.m.

References delegate.

- (void) scrollViewDidEndScrollingAnimation: (UIScrollView *)  scrollView [implementation]

Definition at line 322 of file UIDocumentView.m.

References delegate.

- (void) scrollViewDidEndZooming: (UIScrollView *)  scrollView
withView: (UIView *)  view
atScale: (float)  scale 
[implementation]

Definition at line 316 of file UIDocumentView.m.

References delegate.

- (void) scrollViewDidScroll: (UIScrollView *)  scrollView [implementation]

Definition at line 249 of file UIDocumentView.m.

References delegate, and refresh.

Here is the call graph for this function:

- (void) scrollViewDidScrollToTop: (UIScrollView *)  scrollView [implementation]

Definition at line 292 of file UIDocumentView.m.

References delegate.

- (void) scrollViewDidZoom: (UIScrollView *)  scrollView [implementation]

Definition at line 265 of file UIDocumentView.m.

References centerContent, and delegate.

Here is the call graph for this function:

- (BOOL) scrollViewShouldScrollToTop: (UIScrollView *)  scrollView [implementation]

Definition at line 285 of file UIDocumentView.m.

References delegate.

- (void) scrollViewWillBeginDecelerating: (UIScrollView *)  scrollView [implementation]

Definition at line 298 of file UIDocumentView.m.

References delegate.

- (void) scrollViewWillBeginDragging: (UIScrollView *)  scrollView [implementation]

Definition at line 273 of file UIDocumentView.m.

References delegate.

- (void) scrollViewWillBeginZooming: (UIScrollView *)  scrollView
withView: (UIView *)  view 
[implementation]

Definition at line 310 of file UIDocumentView.m.

References delegate.

- (void) setDocument: (UIDocument *)  value [implementation]

Sets the document displayed in the document view.

Calling this method resets the content offset to start and the zoom level as close as possible to fit-to-width as the minimumZoomScale and maximumZoomScale properties allow.

Parameters:
valueThe document to be displayed in the document view.

Definition at line 35 of file UIDocumentView.m.

References container, document, UIDocument::getSizeOfPage:, UIDocument::numberOfPages, and UIDocument::size.

Here is the call graph for this function:

- (UIView *) viewForZoomingInScrollView: (UIScrollView *)  scrollView [implementation]

Definition at line 257 of file UIDocumentView.m.

References container, and delegate.


Member Data Documentation

- (UIView*) container [protected]

A containing superview for the UIImageView objects that represent the pages of the document.

Definition at line 15 of file UIDocumentView.h.

- (NSOperationQueue*) operationQueue [protected]

An operation queue for lazy loading the page images.

Definition at line 18 of file UIDocumentView.h.


Property Documentation

- (id< UIScrollViewDelegate >) delegate [read, write, assign]

The delegate of the document view object.

Definition at line 23 of file UIDocumentView.h.

- (UIDocument *) document [read, write, retain]

The document displayed in the document view.

Returns the currently displayed document in the document view.

Returns:
The currently displayed document.

Definition at line 20 of file UIDocumentView.h.

- (UIImage *) placeholder [read, write, retain]

The placeholder image to use for document pages that have not been loaded into memory yet.

Default is nil.

Definition at line 21 of file UIDocumentView.h.

- (CGFloat) preloadFactor [read, write, assign]

How many view-heights above and below the currently viewed area should be preloaded into memory.

Default is 0.

Definition at line 22 of file UIDocumentView.h.


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Enumerations Enumerator Properties Defines