API 0.9.5
CPDocumentController Class Reference

#import <CPDocumentController.h>

Inheritance diagram for CPDocumentController:

List of all members.

Instance Methods

(void) - addDocument:
(void) - clearRecentDocuments:
(void) - closeAllDocumentsWithDelegate:didCloseAllSelector:contextInfo:
(CPString- defaultType
(void) - document:didRead:contextInfo:
(Class) - documentClassForType:
(CPDocument- documentForURL:
(CPArray- documents
(id) - init
(CPDocument- makeDocumentForURL:withContentsOfURL:ofType:delegate:didReadSelector:contextInfo:
(CPDocument- makeDocumentWithContentsOfURL:ofType:delegate:didReadSelector:contextInfo:
(CPDocument- makeUntitledDocumentOfType:error:
(CFAction) - newDocument:
(void) - noteNewRecentDocument:
(void) - noteNewRecentDocumentURL:
(void) - openDocument:
(CPDocument- openDocumentWithContentsOfURL:display:error:
(void) - openUntitledDocumentOfType:display:
(CPArray- recentDocumentURLs
(void) - removeDocument:
(CPDocument- reopenDocumentForURL:withContentsOfURL:error:
(CPString- typeForContentsOfURL:error:

Class Methods

(id) + sharedDocumentController

Detailed Description

This class is responsible for managing an application's open documents.

Definition at line 2 of file CPDocumentController.h.


Method Documentation

- (void) addDocument: (CPDocument aDocument

Adds aDocument under the control of the receiver.

Parameters:
aDocumentthe document to add

Definition at line 252 of file CPDocumentController.j.

- (void) clearRecentDocuments: (id)  sender

Definition at line 379 of file CPDocumentController.j.

- (void) closeAllDocumentsWithDelegate: (id)  aDelegate
didCloseAllSelector: (SEL)  didCloseSelector
contextInfo: (Object)  info 

Definition at line 335 of file CPDocumentController.j.

- (CPString) defaultType

Definition at line 266 of file CPDocumentController.j.

- (void) document: (CPDocument aDocument
didRead: (BOOL)  didRead
contextInfo: (id)  aContextInfo 

Definition at line 203 of file CPDocumentController.j.

- (Class) documentClassForType: (CPString aType

Returns the CPDocument subclass associated with aType.

Parameters:
aTypethe type of document
Returns:
a Cappuccino Class object, or nil if no match was found

Definition at line 324 of file CPDocumentController.j.

- (CPDocument) documentForURL: (CPURL aURL

Returns the document matching the specified URL. This method searches documents already open. It does not open the document at the URL if it is not already open.

Parameters:
aURLthe url of the document
Returns:
the document, or nil if such a document is not open

Definition at line 80 of file CPDocumentController.j.

- (CPArray) documents

Returns the array of all documents being managed. This is the same as all open documents in the application.

Definition at line 243 of file CPDocumentController.j.

- (id) init

Definition at line 55 of file CPDocumentController.j.

- (CPDocument) makeDocumentForURL: (CPURL anAbsoluteURL
withContentsOfURL: (CPURL absoluteContentsURL
ofType: (CPString aType
delegate: (id)  aDelegate
didReadSelector: (SEL)  aSelector
contextInfo: (id)  aContextInfo 

Creates a document from the contents of a URL, and sets the document's URL location as another URL.

Parameters:
anAbsoluteURLthe document's location
absoluteContentsURLthe location of the document's contents
aTypethe document's data type
aDelegatereceives a callback after the load has completed
aSelectorthe selector to invoke for the callback
aContextInfoan object passed as an argument for the callback
Returns:
a new document or nil if there was an error

Definition at line 194 of file CPDocumentController.j.

- (CPDocument) makeDocumentWithContentsOfURL: (CPURL anAbsoluteURL
ofType: (CPString aType
delegate: (id)  aDelegate
didReadSelector: (SEL)  aSelector
contextInfo: (id)  aContextInfo 

Creates a document from the contents at the specified URL. Notifies the provided delegate with the provided selector afterwards.

Parameters:
anAbsoluteURLthe location of the document data
aTypethe document type
aDelegatethe delegate to notify
aSelectorthe selector to notify with
aContextInfothe context information passed to the delegate

Definition at line 178 of file CPDocumentController.j.

- (CPDocument) makeUntitledDocumentOfType: (CPString aType
error: ({CPError})  anError 

Creates a document of the specified type.

Parameters:
aTypethe document type
anErrornot used
Returns:
the created document

Definition at line 123 of file CPDocumentController.j.

- (CFAction) newDocument: (id)  aSender

Opens a new document in the application.

Parameters:
aSenderthe requesting object

Definition at line 218 of file CPDocumentController.j.

- (void) noteNewRecentDocument: (CPDocument aDocument

Definition at line 387 of file CPDocumentController.j.

- (void) noteNewRecentDocumentURL: (CPURL aURL

Definition at line 392 of file CPDocumentController.j.

- (void) openDocument: (id)  aSender

Definition at line 223 of file CPDocumentController.j.

- (CPDocument) openDocumentWithContentsOfURL: (CPURL anAbsoluteURL
display: (BOOL)  shouldDisplay
error: (CPError)  anError 

Opens the document at the specified URL.

Parameters:
anAbsoluteURLthe path to the document's file
shouldDisplaywhether to display the document on screen
anErrornot used
Returns:
the opened document

Definition at line 135 of file CPDocumentController.j.

- (void) openUntitledDocumentOfType: (CPString aType
display: (BOOL)  shouldDisplay 

Creates a new document of the specified type.

Parameters:
aTypethe type of the new document
shouldDisplaywhether to display the document on screen

Definition at line 101 of file CPDocumentController.j.

- (CPArray) recentDocumentURLs

Definition at line 370 of file CPDocumentController.j.

- (void) removeDocument: (CPDocument aDocument

Removes aDocument from the control of the receiver.

Parameters:
aDocumentthe document to remove

Definition at line 261 of file CPDocumentController.j.

- (CPDocument) reopenDocumentForURL: (CPURL anAbsoluteURL
withContentsOfURL: (CPURL absoluteContentsURL
error: (CPError)  anError 

Loads a document for a specified URL with it's content retrieved from another URL.

Parameters:
anAbsoluteURLthe document URL
absoluteContentsURLthe location of the document's contents
anErrornot used
Returns:
the loaded document or nil if there was an error

Definition at line 164 of file CPDocumentController.j.

+ (id) sharedDocumentController

Returns the singleton instance of the application's document controller. If it has not been created yet, it will be created then returned.

Returns:
a CPDocumentController

Definition at line 44 of file CPDocumentController.j.

- (CPString) typeForContentsOfURL: (CPURL anAbsoluteURL
error: (CPError)  outError 

Definition at line 271 of file CPDocumentController.j.


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