CTCoreFolder Class Reference
Protected Attributes | |
| id | initWithPath:(NSString *)path inAccount:(CTCoreAccount *)account |
| void | connect |
| void | disconnect |
| CTCoreMessage * | messageWithUID:(NSString *)uid |
| BOOL | isUIDValid:(NSString *)uid |
| NSUInteger | sequenceNumberForUID:(NSString *)uid |
| NSString * | name |
| NSString * | path |
| void | setPath:(NSString *)path |
| void | create |
| void | delete |
| void | subscribe |
| void | unsubscribe |
| unsigned int | flagsForMessage:(CTCoreMessage *)msg |
| void | setFlags:(unsigned int)flags forMessage:(CTCoreMessage *)msg |
| void | expunge |
| NSUInteger | unreadMessageCount |
| NSUInteger | totalMessageCount |
| NSUInteger | uidValidity |
Detailed Description
CTCoreFolder is the class used to get and set attributes for a server side folder. It is also the class used to get a list of messages from the server. You need to make sure and establish a connection first by calling connect. All methods throw an exceptions on failure.Member Data Documentation
- (void) connect [protected] |
This initiates the connection after the folder has been initalized.
- (void) create [protected] |
If the folder doesn't exist on the server this method will create it. Make sure the pathname has been set first.
- (void) delete [protected] |
This method will remove the folder and any messages contained within from the server. Be careful when using this method because there is no way to undo.
- (void) disconnect [protected] |
This method terminates the connection, make sure you don't have any message connections open from this folder before disconnecting.
- (void) expunge [protected] |
Deletes all messages contained in the folder that are marked for deletion. Deleting messages in IMAP is a little strange, first you need to set the message flag CTFlagDeleted to CTFlagSet, and then when you call expunge on the folder the message is contained in, it will be deleted.
- (unsigned int) flagsForMessage [protected] |
Returns the message flags. You must AND/OR using the defines constants. Here is a list of message flags: CTFlagNew, CTFlagSeen, CTFlagFlagged, CTFlagDeleted, CTFlagAnswered, CTFlagForwarded.
- (id) initWithPath [protected] |
This method is used to initialize a folder. This method or the method in CTCoreAccount folderWithPath can be used to setup a folder.
- Parameters:
-
inAccount This parameter must be passed in so the folder can initiate it's connection.
- (BOOL) isUIDValid [protected] |
This validates the passed in UID. The server can at times change the set of UID's for a folder. So you should verify that the server is still using the same set when connecting.
- Parameters:
-
uid The UID to verify.
- Returns:
- YES if the UID is valid.
- (CTCoreMessage*) messageWithUID [protected] |
This will return the message from this folder with the UID that was passed in. If the message can't be found, nil is returned
- Parameters:
-
uid The uid as an NSString for the message to retrieve.
- Returns:
- A CTMessage object is returned which can be used to get further information and perform operations on the message.
- (NSString*) name [protected] |
The folder name.
- (NSString*) path [protected] |
The entire path of folder.
- (NSUInteger) sequenceNumberForUID [protected] |
Pulls the sequence number for the messag with the specified uid. It does not perform UID validation, and the sequence ID is only valid per session.
- Parameters:
-
The uid for the message
- Returns:
- > 1 if successful, 0 on err
- (void) setFlags [protected] |
Sets the message's flags on the server, take a look at the documentation for flagsForMessage:
- (void) setPath [protected] |
This will change the path of the folder. Use this method to rename the folder on the server or to move the folder on the server.
- Parameters:
-
path The new path for the folder as an NSString.
- (void) subscribe [protected] |
The folder will be listed as subscribed on the server.
- (NSUInteger) totalMessageCount [protected] |
Returns the number of messages in the folder.
- Returns:
- A NSUInteger containing the number of messages.
- (NSUInteger) uidValidity [protected] |
Returns the uid validity value for the folder
- Returns:
- An integer containing the uid validity
- (NSUInteger) unreadMessageCount [protected] |
Returns the number of unread messages.
- Returns:
- A NSUInteger containing the number of unread messages.
- (void) unsubscribe [protected] |
The folder will be listed as unsubscribed.