CPDocumentController Class Reference

List of all members.

Public Member Functions

(id) - init [implementation]
(CPDocument- documentForURL: [implementation]
(void) - openUntitledDocumentOfType:display: [implementation]
(CPDocument- makeUntitledDocumentOfType:error: [implementation]
(CPDocument- openDocumentWithContentsOfURL:display:error: [implementation]
(CPDocument- reopenDocumentForURL:withContentsOfURL:error: [implementation]
(CPDocument- makeDocumentWithContentsOfURL:ofType:delegate:didReadSelector:contextInfo: [implementation]
(CPDocument- makeDocumentForURL:withContentsOfURL:ofType:delegate:didReadSelector:contextInfo: [implementation]
(void) - document:didRead:contextInfo: [implementation]
(CFAction) - newDocument: [implementation]
(CPArray- documents [implementation]
(void) - addDocument: [implementation]
(void) - removeDocument: [implementation]
(CPString- defaultType [implementation]
(CPString- typeForContentsOfURL:error: [implementation]
(Class) - documentClassForType: [implementation]

Static Public Member Functions

(id) + sharedDocumentController [implementation]


Detailed Description

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

Definition at line 34 of file CPDocumentController.j.


Member Function Documentation

- (void) addDocument: (CPDocument aDocument   [implementation]

Adds aDocument under the control of the receiver.

Parameters:
aDocument the document to add

Definition at line 235 of file CPDocumentController.j.

- (CPString) defaultType   [implementation]

Definition at line 249 of file CPDocumentController.j.

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

Definition at line 199 of file CPDocumentController.j.

- (Class) documentClassForType: (CPString aType   [implementation]

Returns the CPDocument subclass associated with aType.

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

Definition at line 301 of file CPDocumentController.j.

- (CPDocument) documentForURL: (CPURL)  aURL   [implementation]

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:
aURL the url of the document
Returns:
the document, or nil if such a document is not open

Definition at line 81 of file CPDocumentController.j.

- (CPArray) documents   [implementation]

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

Definition at line 226 of file CPDocumentController.j.

- (id) init   [implementation]

Definition at line 56 of file CPDocumentController.j.

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

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

Parameters:
anAbsoluteURL the document's location
absoluteContentsURL the location of the document's contents
aType the document's data type
aDelegate receives a callback after the load has completed
aSelector the selector to invoke for the callback
aContextInfo an object passed as an argument for the callback
Returns:
a new document or nil if there was an error

Definition at line 190 of file CPDocumentController.j.

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

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

Parameters:
anAbsoluteURL the location of the document data
aType the document type
aDelegate the delegate to notify
aSelector the selector to notify with
aContextInfo the context infomration passed to the delegate

Definition at line 174 of file CPDocumentController.j.

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

Creates a document of the specified type.

Parameters:
aType the document type
anError not used
Returns:
the created document

Definition at line 124 of file CPDocumentController.j.

- (CFAction) newDocument: (id)  aSender   [implementation]

Opens a new document in the application.

Parameters:
aSender the requesting object

Definition at line 215 of file CPDocumentController.j.

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

Opens the document at the specified URL.

Parameters:
anAbsoluteURL the path to the document's file
shouldDisplay whether to display the document on screen
anError not used
Returns:
the opened document

Definition at line 136 of file CPDocumentController.j.

- (void) openUntitledDocumentOfType: (CPString aType
display: (BOOL)  shouldDisplay 
[implementation]

Creates a new document of the specified type.

Parameters:
aType the type of the new document
shouldDisplay whether to display the document on screen

Definition at line 102 of file CPDocumentController.j.

- (void) removeDocument: (CPDocument aDocument   [implementation]

Removes aDocument from the control of the receiver.

Parameters:
aDocument the document to remove

Definition at line 244 of file CPDocumentController.j.

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

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

Parameters:
anAbsoluteURL the document URL
absoluteContentsURL the location of the document's contents
anError not used
Returns:
the loaded document or nil if there was an error

Definition at line 160 of file CPDocumentController.j.

+ (id) sharedDocumentController   [implementation]

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 45 of file CPDocumentController.j.

- (CPString) typeForContentsOfURL: (CPURL)  anAbsoluteURL
error: (CPError)  outError 
[implementation]

Definition at line 254 of file CPDocumentController.j.


The documentation for this class was generated from the following file:

Generated on Thu Dec 11 01:55:50 2008 for Cappuccino by  doxygen 1.5.7.1