CWStore


Discussion

This protocol defines a basic set of methods that classes implementing the protocol must implement in order to offer all the required functionalities of a message store. CWIMAPStore, CWLocalStore and CWPOP3Store are classes that currently implement this protocol.

Declared In

CWStore.h



Methods

-close
-createFolderWithName:type:contents:
-defaultFolder
-deleteFolderWithName:
-folderEnumerator
-folderForName:
-folderForNameIsOpen:
-folderForURL:
-folderSeparator
-folderTypeForFolderName:
-initWithURL:
-openFoldersEnumerator
-removeFolderFromOpenFolders:
-renameFolderWithName:toName:
-subscribedFolderEnumerator

close


- (void) close; 
Discussion

This method is used to close the receiver. Classes implementing the CWStore protocol will also release all resources, like open folders, CWConnection instances, etc.


createFolderWithName:type:contents:


- (void) createFolderWithName: (NSString *) theName type: (PantomimeFolderFormat) theType 
        contents: (NSData *) theContents; 
Parameters
theName

The name of the folder to create. It must be a full path.

theType

The folder type. Accepted values are part of the PantomimeFolderFormat enum.

theContents

The initial content of the folder. It must be in mbox format.

Discussion

This method is used to create a new folder with the specified name, type and contents. On success, it posts the PantomimeFolderCreateCompleted notification and calls -folderCreateCompleted: on the delegate. On failure, it posts the PantomimeFolderCreateFailed notification and calls -folderCreateFailed: on the delegate.


defaultFolder


- (id) defaultFolder; 
Return Value

A CWFolder subclass instance.

Discussion

This method is used to obtain the default folder of the receiver. For example, CWPOP3Store will always return the "INBOX" folder as no other folder is accessible in POP3.


deleteFolderWithName:


- (void) deleteFolderWithName: (NSString *) theName; 
Parameters
theName

The name of the folder to delete.

Discussion

This method is used to delete the folder specified by theName. On success, it posts the PantomimeFolderDeleteCompleted notification. On error, it posts the PantomimeFolderDeleteFailed notification.


folderEnumerator


- (NSEnumerator *) folderEnumerator; 
Return Value

The list of folder names.

Discussion

This method is used to get the list of all available folders on the receiver. The name of the folders are returned, not actual CWFolder subclass instances.


folderForName:


- (id) folderForName: (NSString *) theName; 
Parameters
theName

The name of the folder to obtain.

Return Value

A CWFolder subclass instance.

Discussion

This method is used to obtain a CWFolder instance with the specifed name.


folderForNameIsOpen:


- (BOOL) folderForNameIsOpen: (NSString *) theName; 
Return Value

YES if it is in an open state, NO otherwise.

Discussion

This method is used to verify if the folder with the specified name is in an open state in the receiver.


folderForURL:


- (id) folderForURL: (NSString *) theURL; 
Parameters
theURL

The URL, as a NSString instance.

Return Value

A CWFolder subclass instance.

Discussion

This method is used to obtain a Folder instance with the specifed URL. theURL must be in form which is understood by the CWURLName class.


folderSeparator


- (unichar) folderSeparator; 
Return Value

The folder separator, 0 if none was set. For example, in CWIMAPStore, this method will return NULL if -folderEnumerator or -subscribedFolderEnumerator was not invoked before calling this method.

Discussion

This method is used to obtain the folder separator of the receiver. The separator hierarchically separates folders. Returned values are generatlly either '/' or '.'.


folderTypeForFolderName:


- (PantomimeFolderType) folderTypeForFolderName: (NSString *) theName; 
Parameters
theName

The name of the folder.

Return Value

The type of the folder.

Discussion

This method is used to obtain the folder type of the specified folder name. The returned value is part of the folderTypeForFolderName enum.


initWithURL:


- (id) initWithURL: (CWURLName *) theURL; 
Parameters
theURL

The URL, as a CWURLName instance.

Return Value

A CWStore subclass instance, nil on error.

Discussion

This method is used to initialize a Store instance using the specified URL. theURL.


openFoldersEnumerator


- (NSEnumerator *) openFoldersEnumerator; 
Return Value

The list of open folders.

Discussion

This method is used to obtain all the CWFolder subclass instance which are in the open state in the receiver.


removeFolderFromOpenFolders:


- (void) removeFolderFromOpenFolders: (CWFolder *) theFolder; 
Parameters
theFolder

The CWFolder subclass instance to remove from the list of open folders.

Discussion

This method is used to remove the specified folder from the list of open folders in the receiver. Normally, you should never invoke this method directly.


renameFolderWithName:toName:


- (void) renameFolderWithName: (NSString *) theName toName: (NSString *) theNewName; 
Parameters
theName

The name of the folder to rename.

theNewName

The name of the folder to rename it to.

Discussion

This method is used to rename a folder. On success, this method posts a PantomimeFolderRenameCompleted notification. On error, it posts a PantomimeFolderRenameFailed notification.


subscribedFolderEnumerator


- (NSEnumerator *) subscribedFolderEnumerator; 
Return Value

The list of folder names.

Discussion

This method is used to get the list of subscribed folders on the receiver. The name of the folders are returned, not actual CWFolder subclass instances. This generally returns a subset of the list returned by -folderEnumerator.