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

An abstract, immutable class for displaying document data. More...

#import <UIDocument.h>

Inheritance diagram for UIDocument:

List of all members.

Public Member Functions

(UIImage *) - getImageOfPage:
 Draws and returns an image of the specified page of the document.
(CGSize) - getSizeOfPage:
 Returns the size of the specified page.
(id) - initWithContentsOfFile:
 Initializes and returns the document object with the contents of the specified file.
(id) - initWithData:
 Initializes and returns the document object with the specified data.

Static Public Member Functions

(UIDocument *) + documentWithContentsOfFile:
 Creates and returns a document object by loading the document data from the file at the specified path.
(UIDocument *) + documentWithData:
 Creates and returns a document object that uses the specified document data.

Properties

int numberOfPages
 The number of pages in the document.
CGSize size
 The dimensions of the entire document, in points, when its pages are vertically concatenated with zero margins.

Detailed Description

An abstract, immutable class for displaying document data.

The UIDocument class is a sister class to UIImage as a high-level way to display document data. UIDocument itself is an abstract class; subclasses need to provide concrete functionality for different document file types. When subclassing UIDocument, DO NOT CALL THE SUPERCLASS IMPLEMENTATION in the methods you override: as Objective-C does not actually support abstract classes, the feature has been emulated by defining every method in the UIDocument interface as throwing a NSInternalConsistencyException.

Subclasses of UIDocument should respect document transparency. If a document has been defined with no background color or a transparent one, it is the responsibility of view objects to provide a background against which the document is readable.

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

Definition at line 11 of file UIDocument.h.


Member Function Documentation

+ (UIDocument *) documentWithContentsOfFile: (NSString *)  path

Creates and returns a document object by loading the document data from the file at the specified path.

Parameters:
pathThe full or partial path to the file.
Returns:
An autoreleased document object for the specified file, or nil if the method could not initialize the image from the specified file.

Definition at line 34 of file UIDocument.m.

+ (UIDocument *) documentWithData: (NSData *)  data

Creates and returns a document object that uses the specified document data.

Parameters:
dataThe document data. This can be data from a file or data you create programmatically.
Returns:
An autoreleased document object for the specified file, or nil if the method could not initialize the image from the specified data.

Definition at line 46 of file UIDocument.m.

- (UIImage *) getImageOfPage: (int)  pageNumber

Draws and returns an image of the specified page of the document.

Parameters:
pageNumberThe number of the page, starting from 1.
Returns:
An autoreleased UIImage object that contains a graphical representation of the specified page. The orientation of the page is taken into account. Returns nil on failure.

Reimplemented in UIDocumentPDF.

Definition at line 85 of file UIDocument.m.

Here is the caller graph for this function:

- (CGSize) getSizeOfPage: (int)  pageNumber

Returns the size of the specified page.

Parameters:
pageNumberThe number of the page, starting from 1.
Returns:
The dimensions of the specified page, in points, with page orientation taken into account. Returns CGSizeZero on failure.

Reimplemented in UIDocumentPDF.

Definition at line 98 of file UIDocument.m.

Here is the caller graph for this function:

- (id) initWithContentsOfFile: (NSString *)  path

Initializes and returns the document object with the contents of the specified file.

Parameters:
pathThe path to the file.
Returns:
An initialized document object, or nil if the method could not find the file or initialize the document from its contents.

Reimplemented in UIDocumentPDF.

Definition at line 58 of file UIDocument.m.

- (id) initWithData: (NSData *)  data

Initializes and returns the document object with the specified data.

Parameters:
dataThe data object containing the document data.  
Returns:
An initialized document object, or nil if the method could not initialize the document from the specified data.

Reimplemented in UIDocumentPDF.

Definition at line 71 of file UIDocument.m.


Property Documentation

- (int) numberOfPages [read, assign]

The number of pages in the document.

Definition at line 13 of file UIDocument.h.

- (CGSize) size [read, assign]

The dimensions of the entire document, in points, when its pages are vertically concatenated with zero margins.

Page orientation is taken into account.

Definition at line 12 of file UIDocument.h.


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