API  0.9.7
 All Classes Files Functions Variables Macros Groups Pages
CPDocumentController Class Reference

#import <CPDocumentController.h>

+ Inheritance diagram for CPDocumentController:

Instance Methods

(void) - addDocument:
 
(void) - clearRecentDocuments:
 
(void) - closeAllDocumentsWithDelegate:didCloseAllSelector:contextInfo:
 
(CPDocument- currentDocument
 
(CPString- defaultType
 
(void) - document:didRead:contextInfo:
 
(Class) - documentClassForType:
 
(CPDocument- documentForURL:
 
(CPDocument- documentForWindow:
 
(CPArray) - documents
 
(BOOL) - hasEditedDocuments
 
(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
implementation

Adds aDocument under the control of the receiver.

Parameters
aDocumentthe document to add

Definition at line 262 of file CPDocumentController.j.

- (void) clearRecentDocuments: (id)  sender
implementation

Provided by category CPDocumentController(Recents).

Definition at line 416 of file CPDocumentController.j.

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

Provided by category CPDocumentController(Closing).

Definition at line 372 of file CPDocumentController.j.

- (CPDocument) currentDocument
implementation

Returns the CPDocument object associated with the main window.

Definition at line 253 of file CPDocumentController.j.

- (CPString) defaultType
implementation

Definition at line 303 of file CPDocumentController.j.

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

Definition at line 205 of file CPDocumentController.j.

- (Class) documentClassForType: (CPString aType
implementation

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

Definition at line 82 of file CPDocumentController.j.

- (CPDocument) documentForWindow: (CPWindow aWindow
implementation

Returns the document object whose window controller owns a specified window.

Definition at line 280 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 245 of file CPDocumentController.j.

- (BOOL) hasEditedDocuments
implementation

Returns a Boolean value that indicates whether the receiver has any documents with unsaved changes.

Definition at line 289 of file CPDocumentController.j.

- (id) init
implementation

Definition at line 57 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
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 196 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
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 180 of file CPDocumentController.j.

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

Creates a document of the specified type.

Parameters
aTypethe document type
anErrornot used
Returns
the created document

Definition at line 125 of file CPDocumentController.j.

- (CFAction) newDocument: (id)  aSender
implementation

Opens a new document in the application.

Parameters
aSenderthe requesting object

Definition at line 220 of file CPDocumentController.j.

- (void) noteNewRecentDocument: (CPDocument aDocument
implementation

Provided by category CPDocumentController(Recents).

Definition at line 424 of file CPDocumentController.j.

- (void) noteNewRecentDocumentURL: (CPURL aURL
implementation

Provided by category CPDocumentController(Recents).

Definition at line 429 of file CPDocumentController.j.

- (void) openDocument: (id)  aSender
implementation

Definition at line 225 of file CPDocumentController.j.

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

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

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

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

- (CPArray) recentDocumentURLs
implementation

Provided by category CPDocumentController(Recents).

Definition at line 407 of file CPDocumentController.j.

- (void) removeDocument: (CPDocument aDocument
implementation

Removes aDocument from the control of the receiver.

Parameters
aDocumentthe document to remove

Definition at line 271 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
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 166 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 46 of file CPDocumentController.j.

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

Definition at line 308 of file CPDocumentController.j.


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