API  1.0.0
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:
 
- 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:
 
(void) - performSelector:withObject:afterDelay:
 
(void) - performSelector:withObject:afterDelay:inModes:
 
(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:
 
(void) + cancelPreviousPerformRequestsWithTarget:
 
(void) + cancelPreviousPerformRequestsWithTarget:selector:object:
 
(Class) + class
 
(BOOL) + conformsToProtocol:
 
(void) + exposeBinding:
 
(void) + initialize
 
(IMP) + instanceMethodForSelector:
 
(BOOL) + instancesImplementSelector:
 
(BOOL) + instancesRespondToSelector:
 
(BOOL) + isBindingExclusive:
 
(BOOL) + isSubclassOfClass:
 
(CPSet) + keyPathsForValuesAffectingValueForKey:
 
(void) + load
 
(id) + new
 
(void) + object:performSelector:withObject:afterDelay:inModes:
 
(void) + setVersion:
 
(Class) + superclass
 
(int) + version
 

Detailed Description

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

Definition at line 2 of file CPDocumentController.h.

Method Documentation

◆ addDocument:()

- (void) addDocument: (CPDocument aDocument
implementation

Adds aDocument under the control of the receiver.

Parameters
aDocumentthe document to add

Definition at line 261 of file CPDocumentController.j.

◆ clearRecentDocuments:()

- (void) clearRecentDocuments: (id)  sender
implementation

Provided by category CPDocumentController(Recents).

Definition at line 417 of file CPDocumentController.j.

◆ closeAllDocumentsWithDelegate:didCloseAllSelector:contextInfo:()

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

Provided by category CPDocumentController(Closing).

Definition at line 371 of file CPDocumentController.j.

◆ currentDocument()

- (CPDocument) currentDocument
implementation

Returns the CPDocument object associated with the main window.

Definition at line 252 of file CPDocumentController.j.

◆ defaultType()

- (CPString) defaultType
implementation

Definition at line 302 of file CPDocumentController.j.

◆ document:didRead:contextInfo:()

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

Definition at line 204 of file CPDocumentController.j.

◆ documentClassForType:()

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

◆ documentForURL:()

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

◆ documentForWindow:()

- (CPDocument) documentForWindow: (CPWindow aWindow
implementation

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

Definition at line 279 of file CPDocumentController.j.

◆ documents()

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

◆ hasEditedDocuments()

- (BOOL) hasEditedDocuments
implementation

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

Definition at line 288 of file CPDocumentController.j.

◆ init()

- (id) init
implementation

Initializes the receiver

Returns
the initialized receiver

Reimplemented from CPObject.

Definition at line 56 of file CPDocumentController.j.

◆ makeDocumentForURL:withContentsOfURL:ofType:delegate:didReadSelector:contextInfo:()

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

◆ makeDocumentWithContentsOfURL:ofType:delegate:didReadSelector:contextInfo:()

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

◆ makeUntitledDocumentOfType:error:()

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

◆ newDocument:()

- (CFAction) newDocument: (id)  aSender
implementation

Opens a new document in the application.

Parameters
aSenderthe requesting object

Definition at line 219 of file CPDocumentController.j.

◆ noteNewRecentDocument:()

- (void) noteNewRecentDocument: (CPDocument aDocument
implementation

Provided by category CPDocumentController(Recents).

Definition at line 425 of file CPDocumentController.j.

◆ noteNewRecentDocumentURL:()

- (void) noteNewRecentDocumentURL: (CPURL aURL
implementation

Provided by category CPDocumentController(Recents).

Definition at line 430 of file CPDocumentController.j.

◆ openDocument:()

- (void) openDocument: (id)  aSender
implementation

Definition at line 224 of file CPDocumentController.j.

◆ openDocumentWithContentsOfURL:display:error:()

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

◆ openUntitledDocumentOfType:display:()

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

◆ recentDocumentURLs()

- (CPArray) recentDocumentURLs
implementation

Provided by category CPDocumentController(Recents).

Definition at line 408 of file CPDocumentController.j.

◆ removeDocument:()

- (void) removeDocument: (CPDocument aDocument
implementation

Removes aDocument from the control of the receiver.

Parameters
aDocumentthe document to remove

Definition at line 270 of file CPDocumentController.j.

◆ reopenDocumentForURL:withContentsOfURL:error:()

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

◆ sharedDocumentController()

+ (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.

◆ typeForContentsOfURL:error:()

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

Definition at line 307 of file CPDocumentController.j.


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