CkEmailBundle C++ Class Reference (Visual C++)
CkEmailBundle
Represents a collection of Email objects.
Properties
void LastErrorHtml(CkString &str);
Error information in HTML format for the last method called.
void LastErrorText(CkString &str);
Error information in plain-text format for the last method called.
void LastErrorXml(CkString &str);
Error information in XML format for the last method called.
long get_MessageCount(void);
The number of emails in this bundle.
bool get_Utf8(void) const; void put_Utf8(bool b);
When set to true, all "const char *" arguments are expected to be utf-8 strings. If set to false, the "const char *" arguments are expected to be ANSI strings.
Methods
bool AddEmail(const CkEmail * email);
Adds an Email object to the bundle. Returns true if successful
bool AddEmail(const CkEmail & email);
Adds an Email object to the bundle. Returns true if successful
CkEmail * FindByHeader(const char * name, const char * value);
To be documented soon...
CkEmail * GetEmail(long index);
Returns the Nth Email in the bundle. The email returned is a copy of the email in the bundle. Updating the email object returned by GetEmail has no effect on the email within the bundle. To update/replace the email in the bundle, your program should call GetEmail to get a copy, make modifications, call RemoveEmailByIndex to remove the email (passing the same index used in the call to GetEmail), and then call AddEmail to insert the new/modified email into the bundle. Returns a null reference on failure
CkStringArray * GetUidls();
Returns a StringArray object containing UIDLs for all Email objects in the bundle. UIDLs are only valid for emails retrieved from POP3 servers. An email on a POP3 server has a "UIDL", an email on IMAP servers has a "UID". If the email was retrieved from an IMAP server, the UID will be accessible via the "ckx-imap-uid" header field. Returns a null reference on failure
void GetXml(CkString & sbXml);
Converts the email bundle to an XML document in memory. Returns the XML document as a string. Returns true for success, false for failure.
bool LoadXml(const char * filename);
Loads an email bundle from an XML file.
bool LoadXmlString(const char * xmlStr);
Loads an email bundle from an XML string.
bool RemoveEmail(const CkEmail * email);
Removes an email from the bundle. This does not remove the email from the mail server.
bool RemoveEmail(const CkEmail & email);
Removes an email from the bundle. This does not remove the email from the mail server.
bool RemoveEmailByIndex(int index);
Removes the Nth email in a bundle. (Indexing begins at 0.) Returns true for success, false for failure.
bool SaveLastError(const char * filename);
Saves the last error information to an XML formatted file.
bool SaveXml(const char * filename);
Converts each email to XML and persists the bundle to an XML file. The email bundle can later be re-instantiated by calling MailMan.LoadXmlFile
void SortByDate(bool ascending);
Sorts emails in the bundle by date.
void SortByRecipient(bool ascending);
Sorts emails in the bundle by recipient.
void SortBySender(bool ascending);
Sorts emails in the bundle by sender.
void SortBySubject(bool ascending);
Sorts emails in the bundle by subject.
const char * getXml();
Converts the email bundle to an XML document in memory. Returns the XML document as a string.
const char * lastErrorHtml();
Error information in HTML format for the last method called.
const char * lastErrorText();
Error information in plain-text format for the last method called.
const char * lastErrorXml();
Error information in XML format for the last method called.
|