API  0.9.6
 All Classes Files Functions Variables Macros Modules Pages
CPDocumentController Class Reference

#import <CPDocumentController.h>

+ Inheritance diagram for CPDocumentController:

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:
 
- Instance Methods inherited from CPObject
(void) - addObserver:forKeyPath:options:context:
 
(void) - applyChange:toKeyPath:
 
(id) - autorelease
 
(id) - awakeAfterUsingCoder:
 
(void) - awakeFromCib
 
(void) - bind:toObject:withKeyPath:options:
 
(Class) - classForCoder
 
(Class) - classForKeyedArchiver
 
(CPString- className
 
(id) - copy
 
(void) - dealloc
 
(CPString- description
 
(CPDictionary- dictionaryWithValuesForKeys:
 
(void) - didChange:valuesAtIndexes:forKey:
 
(void) - didChangeValueForKey:
 
(void) - didChangeValueForKey:withSetMutation:usingObjects:
 
(void) - doesNotRecognizeSelector:
 
(CPArray- exposedBindings
 
(id) - forwardingTargetForSelector:
 
(void) - forwardInvocation:
 
(unsigned) - hash
 
(BOOL) - implementsSelector:
 
(CPDictionary- infoForBinding:
 
(BOOL) - isEqual:
 
(BOOL) - isKindOfClass:
 
(BOOL) - isMemberOfClass:
 
(BOOL) - isProxy
 
(IMP) - methodForSelector:
 
(CPMethodSignature) - methodSignatureForSelector:
 
(id) - mutableArrayValueForKey:
 
(id) - mutableArrayValueForKeyPath:
 
(id) - mutableCopy
 
(id) - mutableSetValueForKey:
 
(id) - mutableSetValueForKeyPath:
 
(id) - performSelector:
 
(id) - performSelector:withObject:
 
(id) - performSelector:withObject:withObject:
 
(id) - performSelector:withObjects:
 
(void) - release
 
(void) - removeObserver:forKeyPath:
 
(id) - replacementObjectForArchiver:
 
(id) - replacementObjectForCoder:
 
(id) - replacementObjectForKeyedArchiver:
 
(BOOL) - respondsToSelector:
 
(id) - retain
 
(id) - self
 
(void) - setValue:forKey:
 
(void) - setValue:forKeyPath:
 
(void) - setValue:forUndefinedKey:
 
(void) - setValuesForKeysWithDictionary:
 
(CPString- UID
 
(void) - unbind:
 
(Class) - valueClassForBinding:
 
(id) - valueForKey:
 
(id) - valueForKeyPath:
 
(id) - valueForUndefinedKey:
 
(void) - willChange:valuesAtIndexes:forKey:
 
(void) - willChangeValueForKey:
 
(void) - willChangeValueForKey:withSetMutation:usingObjects:
 

Class Methods

(id) + sharedDocumentController
 
- Class Methods inherited from CPObject
(BOOL) + accessInstanceVariablesDirectly
 
(id) + alloc
 
(id) + allocWithCoder:
 
(BOOL) + automaticallyNotifiesObserversForKey:
 
(Class) + class
 
(void) + exposeBinding:
 
(void) + initialize
 
(IMP) + instanceMethodForSelector:
 
(BOOL) + instancesRespondToSelector:
 
(BOOL) + isSubclassOfClass:
 
(CPSet+ keyPathsForValuesAffectingValueForKey:
 
(void) + load
 
(id) + new
 
(void) + setVersion:
 
(Class) + superclass
 
(int) + version
 

Additional Inherited Members

- Instance Variables inherited from CPObject
Class isa
 

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

- (void) clearRecentDocuments: (id)  sender
implementation

Provided by category CPDocumentController(Recents).

Definition at line 379 of file CPDocumentController.j.

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

Provided by category CPDocumentController(Closing).

Definition at line 335 of file CPDocumentController.j.

- (CPString) defaultType
implementation

Definition at line 266 of file CPDocumentController.j.

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

Definition at line 203 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 324 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 80 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 243 of file CPDocumentController.j.

- (id) init
implementation

Initializes the receiver

Returns
the initialized receiver

Reimplemented from CPObject.

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 
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 194 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 178 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 123 of file CPDocumentController.j.

- (CFAction) newDocument: (id)  aSender
implementation

Opens a new document in the application.

Parameters
aSenderthe requesting object

Definition at line 218 of file CPDocumentController.j.

- (void) noteNewRecentDocument: (CPDocument aDocument
implementation

Provided by category CPDocumentController(Recents).

Definition at line 387 of file CPDocumentController.j.

- (void) noteNewRecentDocumentURL: (CPURL aURL
implementation

Provided by category CPDocumentController(Recents).

Definition at line 392 of file CPDocumentController.j.

- (void) openDocument: (id)  aSender
implementation

Definition at line 223 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 135 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 101 of file CPDocumentController.j.

- (CPArray) recentDocumentURLs
implementation

Provided by category CPDocumentController(Recents).

Definition at line 370 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 261 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 164 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 44 of file CPDocumentController.j.

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

Definition at line 271 of file CPDocumentController.j.


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