aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Hoa V. DINH <dinh.viet.hoa@gmail.com>2015-01-21 18:04:00 -0800
committerGravatar Hoa V. DINH <dinh.viet.hoa@gmail.com>2015-01-21 18:04:00 -0800
commit6c42d89fdf9b0ef23469768ab3491f3400ad73eb (patch)
tree1cf0b6e910db0d5a8cac2593056e55ebbdf8a394 /src
parent97bce894f34a05378f661195c358fb18f90e3fdb (diff)
parent4dcc822f548ca6d15be328edda40f63f2f719d36 (diff)
Merge branch 'master' into icu-ucsdet
Diffstat (limited to 'src')
-rw-r--r--src/core/abstract/MCAbstractMessage.h7
-rw-r--r--src/core/basetypes/MCObject.cpp4
-rw-r--r--src/java/com/libmailcore/AbstractMessage.java14
-rw-r--r--src/java/com/libmailcore/AbstractMessagePart.java7
-rw-r--r--src/java/com/libmailcore/AbstractMultipart.java3
-rw-r--r--src/java/com/libmailcore/AbstractPart.java37
-rw-r--r--src/java/com/libmailcore/Address.java34
-rw-r--r--src/java/com/libmailcore/Attachment.java13
-rw-r--r--src/java/com/libmailcore/AuthType.java16
-rw-r--r--src/java/com/libmailcore/ConnectionLogType.java8
-rw-r--r--src/java/com/libmailcore/ConnectionLogger.java6
-rw-r--r--src/java/com/libmailcore/ConnectionType.java4
-rw-r--r--src/java/com/libmailcore/Encoding.java3
-rw-r--r--src/java/com/libmailcore/ErrorCode.java50
-rw-r--r--src/java/com/libmailcore/HTMLRendererIMAPCallback.java8
-rw-r--r--src/java/com/libmailcore/HTMLRendererTemplateCallback.java32
-rw-r--r--src/java/com/libmailcore/HTMLRendererTemplateCallbackUtils.java1
-rw-r--r--src/java/com/libmailcore/IMAPAppendMessageOperation.java32
-rw-r--r--src/java/com/libmailcore/IMAPCapability.java1
-rw-r--r--src/java/com/libmailcore/IMAPCapabilityOperation.java3
-rw-r--r--src/java/com/libmailcore/IMAPCopyMessagesOperation.java5
-rw-r--r--src/java/com/libmailcore/IMAPFetchContentOperation.java4
-rw-r--r--src/java/com/libmailcore/IMAPFetchFoldersOperation.java2
-rw-r--r--src/java/com/libmailcore/IMAPFetchMessagesOperation.java10
-rw-r--r--src/java/com/libmailcore/IMAPFetchNamespaceOperation.java1
-rw-r--r--src/java/com/libmailcore/IMAPFetchParsedContentOperation.java4
-rw-r--r--src/java/com/libmailcore/IMAPFolder.java13
-rw-r--r--src/java/com/libmailcore/IMAPFolderFlags.java26
-rw-r--r--src/java/com/libmailcore/IMAPFolderInfo.java21
-rw-r--r--src/java/com/libmailcore/IMAPFolderInfoOperation.java2
-rw-r--r--src/java/com/libmailcore/IMAPFolderStatus.java19
-rw-r--r--src/java/com/libmailcore/IMAPFolderStatusOperation.java1
-rw-r--r--src/java/com/libmailcore/IMAPIdentity.java11
-rw-r--r--src/java/com/libmailcore/IMAPIdentityOperation.java1
-rw-r--r--src/java/com/libmailcore/IMAPIdleOperation.java1
-rw-r--r--src/java/com/libmailcore/IMAPMessage.java59
-rw-r--r--src/java/com/libmailcore/IMAPMessagePart.java3
-rw-r--r--src/java/com/libmailcore/IMAPMessageRenderingOperation.java1
-rw-r--r--src/java/com/libmailcore/IMAPMessagesRequestKind.java21
-rw-r--r--src/java/com/libmailcore/IMAPMultipart.java3
-rw-r--r--src/java/com/libmailcore/IMAPNamespace.java15
-rw-r--r--src/java/com/libmailcore/IMAPNamespaceItem.java7
-rw-r--r--src/java/com/libmailcore/IMAPOperation.java10
-rw-r--r--src/java/com/libmailcore/IMAPOperationItemProgressListener.java2
-rw-r--r--src/java/com/libmailcore/IMAPOperationProgressListener.java2
-rw-r--r--src/java/com/libmailcore/IMAPPart.java14
-rw-r--r--src/java/com/libmailcore/IMAPQuotaOperation.java3
-rw-r--r--src/java/com/libmailcore/IMAPSearchExpression.java42
-rw-r--r--src/java/com/libmailcore/IMAPSearchKind.java2
-rw-r--r--src/java/com/libmailcore/IMAPSearchOperation.java2
-rw-r--r--src/java/com/libmailcore/IMAPSession.java98
-rw-r--r--src/java/com/libmailcore/IMAPStoreFlagsRequestKind.java2
-rw-r--r--src/java/com/libmailcore/IndexSet.java19
-rw-r--r--src/java/com/libmailcore/Log.java3
-rw-r--r--src/java/com/libmailcore/MailException.java6
-rw-r--r--src/java/com/libmailcore/MainThreadUtils.java4
-rw-r--r--src/java/com/libmailcore/MessageBuilder.java27
-rw-r--r--src/java/com/libmailcore/MessageFlag.java26
-rw-r--r--src/java/com/libmailcore/MessageHeader.java40
-rw-r--r--src/java/com/libmailcore/MessageParser.java9
-rw-r--r--src/java/com/libmailcore/MessagePart.java1
-rw-r--r--src/java/com/libmailcore/Multipart.java1
-rw-r--r--src/java/com/libmailcore/NNTPFetchAllArticlesOperation.java2
-rw-r--r--src/java/com/libmailcore/NNTPFetchArticleOperation.java2
-rw-r--r--src/java/com/libmailcore/NNTPFetchHeaderOperation.java2
-rw-r--r--src/java/com/libmailcore/NNTPFetchOverviewOperation.java1
-rw-r--r--src/java/com/libmailcore/NNTPFetchServerTimeOperation.java1
-rw-r--r--src/java/com/libmailcore/NNTPGroupInfo.java6
-rw-r--r--src/java/com/libmailcore/NNTPListNewsgroupsOperation.java1
-rw-r--r--src/java/com/libmailcore/NNTPOperation.java10
-rw-r--r--src/java/com/libmailcore/NNTPSession.java36
-rw-r--r--src/java/com/libmailcore/NativeObject.java3
-rw-r--r--src/java/com/libmailcore/Operation.java4
-rw-r--r--src/java/com/libmailcore/OperationCallback.java3
-rw-r--r--src/java/com/libmailcore/OperationQueueListener.java3
-rw-r--r--src/java/com/libmailcore/POPFetchHeaderOperation.java2
-rw-r--r--src/java/com/libmailcore/POPFetchMessageOperation.java2
-rw-r--r--src/java/com/libmailcore/POPFetchMessagesOperation.java1
-rw-r--r--src/java/com/libmailcore/POPMessageInfo.java8
-rw-r--r--src/java/com/libmailcore/POPOperation.java10
-rw-r--r--src/java/com/libmailcore/POPSession.java41
-rw-r--r--src/java/com/libmailcore/PartType.java2
-rw-r--r--src/java/com/libmailcore/Range.java14
-rw-r--r--src/java/com/libmailcore/SMTPOperation.java9
-rw-r--r--src/java/com/libmailcore/SMTPSession.java43
-rw-r--r--src/java/native/com_libmailcore_AuthType.h13
-rw-r--r--src/java/native/com_libmailcore_IMAPAppendMessageOperation.cpp27
-rw-r--r--src/java/native/com_libmailcore_IMAPAppendMessageOperation.h16
-rw-r--r--src/java/native/com_libmailcore_IMAPFetchMessagesOperation.cpp2
-rw-r--r--src/java/native/com_libmailcore_IMAPFetchMessagesOperation.h16
-rw-r--r--src/java/native/com_libmailcore_IMAPMessage.cpp18
-rw-r--r--src/java/native/com_libmailcore_IMAPMessage.h16
-rw-r--r--src/java/native/com_libmailcore_IMAPSearchExpression.h8
-rw-r--r--src/objc/abstract/MCOHTMLRendererDelegate.h3
94 files changed, 1076 insertions, 75 deletions
diff --git a/src/core/abstract/MCAbstractMessage.h b/src/core/abstract/MCAbstractMessage.h
index 6e7e2431..1f567a52 100644
--- a/src/core/abstract/MCAbstractMessage.h
+++ b/src/core/abstract/MCAbstractMessage.h
@@ -16,14 +16,21 @@ namespace mailcore {
AbstractMessage();
virtual ~AbstractMessage();
+ /** Header of the message. */
virtual MessageHeader * header();
+ /** Set a header of the message. */
virtual void setHeader(MessageHeader * header);
+ /** Returns a part matching the given contentID. */
virtual AbstractPart * partForContentID(String * contentID);
+ /** Returns a part matching the given uniqueID */
virtual AbstractPart * partForUniqueID(String * uniqueID);
+ /** Returns the list of attachments, not part of the content of the message. */
virtual Array * /* AbstractPart */ attachments();
+ /** Returns the list of attachments that are shown inline in the content of the message. */
virtual Array * /* AbstractPart */ htmlInlineAttachments();
+ /** Returns the list of the text parts required to render the message properly. */
virtual Array * /* AbstractPart */ requiredPartsForRendering();
public: //subclass behavior
diff --git a/src/core/basetypes/MCObject.cpp b/src/core/basetypes/MCObject.cpp
index 43137f78..3034c791 100644
--- a/src/core/basetypes/MCObject.cpp
+++ b/src/core/basetypes/MCObject.cpp
@@ -313,14 +313,12 @@ void Object::performMethodOnDispatchQueue(Method method, void * context, void *
dispatch_retain((dispatch_queue_t) targetDispatchQueue);
dispatch_sync((dispatch_queue_t) targetDispatchQueue, ^{
(this->*method)(context);
- dispatch_release((dispatch_queue_t) targetDispatchQueue);
});
+ dispatch_release((dispatch_queue_t) targetDispatchQueue);
}
else {
- dispatch_retain((dispatch_queue_t) targetDispatchQueue);
dispatch_async((dispatch_queue_t) targetDispatchQueue, ^{
(this->*method)(context);
- dispatch_release((dispatch_queue_t) targetDispatchQueue);
});
}
}
diff --git a/src/java/com/libmailcore/AbstractMessage.java b/src/java/com/libmailcore/AbstractMessage.java
index 0f995193..3f76c695 100644
--- a/src/java/com/libmailcore/AbstractMessage.java
+++ b/src/java/com/libmailcore/AbstractMessage.java
@@ -2,13 +2,27 @@ package com.libmailcore;
import java.util.List;
+/** Abstract message. */
public class AbstractMessage extends NativeObject {
+ /** Returns the header of the message. */
public native MessageHeader header();
+ /** Sets the header of the message. */
public native void setHeader(MessageHeader header);
+ /**
+ Returns the MIME part with the given Content-ID.
+ @see com.libmailcore.AbstractPart#contentID()
+ */
public native AbstractPart partForContentID(String contentID);
+ /**
+ Returns the MIME part with the given uniqueID.
+ @see com.libmailcore.AbstractPart#uniqueID()
+ */
public native AbstractPart partForUniqueID(String uniqueID);
+ /** Returns the list of attachments, not part of the content of the message. */
public native List<AbstractPart> attachments();
+ /** Returns the list of attachments that are shown inline in the content of the message. */
public native List<AbstractPart> htmlInlineAttachments();
+ /** Returns the list of the text parts required to render the message properly. */
public native List<AbstractPart> requiredPartsForRendering();
}
diff --git a/src/java/com/libmailcore/AbstractMessagePart.java b/src/java/com/libmailcore/AbstractMessagePart.java
index 307e700c..2035ddde 100644
--- a/src/java/com/libmailcore/AbstractMessagePart.java
+++ b/src/java/com/libmailcore/AbstractMessagePart.java
@@ -1,9 +1,14 @@
package com.libmailcore;
+/** Abstract embedded message part. */
public class AbstractMessagePart extends AbstractPart {
+ /** Header of the message. */
public native MessageHeader header();
+ /** Sets the header of the message. */
public native void setHeader(MessageHeader header);
- public native AbstractPart mainPart();
+ /** Returns the main MIME part of the message. */
+ public native AbstractPart mainPart();
+ /** Sets the main MIME part. */
public native void setMainPart(AbstractPart part);
}
diff --git a/src/java/com/libmailcore/AbstractMultipart.java b/src/java/com/libmailcore/AbstractMultipart.java
index c81d8d21..7b6d2e77 100644
--- a/src/java/com/libmailcore/AbstractMultipart.java
+++ b/src/java/com/libmailcore/AbstractMultipart.java
@@ -2,7 +2,10 @@ package com.libmailcore;
import java.util.List;
+/** Abstract MIME multipart. */
public class AbstractMultipart extends AbstractPart {
+ /** Returns the parts of the MIME multipart. */
public native List<AbstractPart> parts();
+ /** Sets the parts of the MIME multipart. */
public native void setParts(List<AbstractPart> parts);
}
diff --git a/src/java/com/libmailcore/AbstractPart.java b/src/java/com/libmailcore/AbstractPart.java
index 6ffbc746..60a325bc 100644
--- a/src/java/com/libmailcore/AbstractPart.java
+++ b/src/java/com/libmailcore/AbstractPart.java
@@ -2,35 +2,72 @@ package com.libmailcore;
import java.util.AbstractList;
+/** Abstract MIME part. */
public class AbstractPart extends NativeObject {
+ /**
+ Returns the type of the part.
+ @see com.libmailcore.PartType
+ */
public native int partType();
+ /**
+ Sets the type of the part.
+ @see com.libmailcore.PartType
+ */
public native void setPartType(int partType);
+ /** Returns filename of the attachment. */
public native String filename();
+ /** Sets the filename of the attachment. */
public native void setFilename(String filename);
+ /** Returns the charset encoding of the attachment. */
public native String charset();
+ /** Sets the charset encoding of the attachment. */
public native void setCharset(String charset);
+ /**
+ Returns the uniqueID of the attachment.
+ The uniqueID is an identifier unique in the scope of the message.
+ */
public native String uniqueID();
+ /** Sets the unique identifier of the attachment. */
public native void setUniqueID(String uniqueID);
+ /** Returns the Content-ID of the attachment. */
public native String contentID();
+ /** Sets the Content-ID of the attachment. */
public native void setContentID(String contentID);
+ /** Returns the Content-Location of the attachment. */
public native String contentLocation();
+ /** Sets the Content-Location of the attachment. */
public native void setContentLocation(String contentLocation);
+ /** Returns the Content-Description of the attachment. */
public native String contentDescription();
+ /** Sets the Content-Description of the attachment. */
public native void setContentDescription(String contentDescription);
+ /** Returns the hint about whether the attachment should be shown inline. */
public native boolean isInlineAttachment();
+ /** Sets the hint about whether the attachment should be shown inline. */
public native void setInlineAttachment(boolean inlineAttachment);
+ /**
+ Returns the MIME part with the given Content-ID.
+ @see com.libmailcore.AbstractPart#contentID()
+ */
public native AbstractPart partForContentID(String contentID);
+ /**
+ Returns the MIME part with the given uniqueID.
+ @see com.libmailcore.AbstractPart#uniqueID()
+ */
public native AbstractPart partForUniqueID(String uniqueID);
+ /** Sets a Content-Type parameter. */
public native void setContentTypeParameter(String name, String value);
+ /** Returns a Content-Type parameter for a given name. */
public native String contentTypeParameterValueForName(String name);
+ /** Returns the list of all parameters names of Content-Type. */
public native AbstractList<String> allContentTypeParametersNames();
}
diff --git a/src/java/com/libmailcore/Address.java b/src/java/com/libmailcore/Address.java
index 36f48c97..85ed19af 100644
--- a/src/java/com/libmailcore/Address.java
+++ b/src/java/com/libmailcore/Address.java
@@ -2,30 +2,60 @@ package com.libmailcore;
import java.util.List;
+/** RFC 822 address. */
public class Address extends NativeObject {
+ /** Creates an address with the given display name and mailbox. */
public native static Address addressWithDisplayName(String displayName, String mailbox);
+ /** Creates an address with only a mailbox. */
public native static Address addressWithMailbox(String mailbox);
+ /**
+ Parses a string that contains an address encoded following RFC 822 rules and create a
+ corresponding address.
+ */
public native static Address addressWithRFC822String(String rfc822String);
+ /**
+ Parses a string that contains an address encoded following RFC 822 rules and create a
+ corresponding address. It assumes that the address is not MIME-encoded.
+ */
public native static Address addressWithNonEncodedRFC822String(String nonEncodedRFC822String);
-
+ /**
+ Parses a string that contains an addresses encoded following RFC 822 rules and create a
+ corresponding list of addresses.
+ */
public native static List<Address> addressesWithRFC822String(String rfc822String);
+ /**
+ Parses a string that contains an addresses encoded following RFC 822 rules and create a
+ corresponding list of addresses. It assumes that the addresses are not MIME-encoded.
+ */
public native static List<Address> addressesWithNonEncodedRFC822String(String nonEncodedRFC822String);
+ /**
+ Returns the given list of addresses encoded using RFC 822.
+ */
public native static String RFC822StringForAddresses(List<Address> addresses);
+ /**
+ Returns the given list of addresses encoded using RFC 822. MIME encoding won't be applied.
+ */
public native static String nonEncodedRFC822StringForAddresses(List<Address> addresses);
-
+
public Address()
{
setupNative();
}
+ /** Returns the display name. */
public native String displayName();
+ /** Sets the display name. */
public native void setDisplayName(String displayName);
+ /** Returns the mailbox. */
public native String mailbox();
+ /** Sets the mailbox. */
public native void setMailbox(String address);
+ /** Returns the address encoded using RFC 822. */
public native String RFC822String();
+ /** Returns the address encoded using RFC 822. MIME encoding won't be applied. */
public native String nonEncodedRFC822String();
private native void setupNative();
diff --git a/src/java/com/libmailcore/Attachment.java b/src/java/com/libmailcore/Attachment.java
index 4ce03ced..1b40bc60 100644
--- a/src/java/com/libmailcore/Attachment.java
+++ b/src/java/com/libmailcore/Attachment.java
@@ -1,16 +1,29 @@
package com.libmailcore;
+/** Attachment when parsing or building a RFC 822 message. */
public class Attachment extends AbstractPart {
+ /** Returns the MIME type for the given filename. */
public static native String mimeTypeForFilename(String filename);
+ /** Returns an attachment with the content of the given file. */
public native static Attachment attachmentWithContentsOfFile(String filename);
+ /** Returns an attachment with the given data and the given filename. */
public native static Attachment attachmentWithData(String filename, byte[] data);
+ /** Returns an HTML text part with the given HTML. */
public native static Attachment attachmentWithHTMLString(String htmlString);
+ /** Returns RFC 822 message part with the given message data. the message data is encoded with RFC 822. */
public native static Attachment attachmentWithRFC822Message(byte[] messageData);
+ /** Returns a text part with the given text. */
public native static Attachment attachmentWithText(String text);
+ /** Returns the data. */
public native byte[] data();
+ /** Sets the data. */
public native void setData(byte[] data);
+ /**
+ Returns the content of the attachment decoded using the charset encoding.
+ @see com.libmailcore.AbstractPart#charset()
+ */
public native String decodedString();
} \ No newline at end of file
diff --git a/src/java/com/libmailcore/AuthType.java b/src/java/com/libmailcore/AuthType.java
new file mode 100644
index 00000000..6394a4c7
--- /dev/null
+++ b/src/java/com/libmailcore/AuthType.java
@@ -0,0 +1,16 @@
+package com.libmailcore;
+
+/** Authentication type. */
+public class AuthType {
+ public static int AuthTypeSASLNone = 0;
+ public static int AuthTypeSASLCRAMMD5 = 1 << 0;
+ public static int AuthTypeSASLPlain = 1 << 1;
+ public static int AuthTypeSASLGSSAPI = 1 << 2;
+ public static int AuthTypeSASLDIGESTMD5 = 1 << 3;
+ public static int AuthTypeSASLLogin = 1 << 4;
+ public static int AuthTypeSASLSRP = 1 << 5;
+ public static int AuthTypeSASLNTLM = 1 << 6;
+ public static int AuthTypeSASLKerberosV4 = 1 << 7;
+ public static int AuthTypeXOAuth2 = 1 << 8;
+ public static int AuthTypeXOAuth2Outlook = 1 << 9;
+}
diff --git a/src/java/com/libmailcore/ConnectionLogType.java b/src/java/com/libmailcore/ConnectionLogType.java
index 31262889..886b9903 100644
--- a/src/java/com/libmailcore/ConnectionLogType.java
+++ b/src/java/com/libmailcore/ConnectionLogType.java
@@ -1,10 +1,18 @@
package com.libmailcore;
+/** Logs type for the connection logger.
+ @see com.libmailcore.ConnectionLogger#log(long connectionID, int type, byte[] data) */
public class ConnectionLogType {
+ /** Received data. */
final public static int ConnectionLogTypeReceived = 0;
+ /** Sent data. */
final public static int ConnectionLogTypeSent = 1;
+ /** Sent private data (such as a password). */
final public static int ConnectionLogTypeSentPrivate = 2;
+ /** Error when parsing. */
final public static int ConnectionLogTypeErrorParse = 3;
+ /** Error while receiving. */
final public static int ConnectionLogTypeErrorReceived = 4;
+ /** Error while sending. */
final public static int ConnectionLogTypeErrorSent = 5;
}
diff --git a/src/java/com/libmailcore/ConnectionLogger.java b/src/java/com/libmailcore/ConnectionLogger.java
index aa85725c..81932935 100644
--- a/src/java/com/libmailcore/ConnectionLogger.java
+++ b/src/java/com/libmailcore/ConnectionLogger.java
@@ -1,5 +1,11 @@
package com.libmailcore;
+/** Callbacks interface for the connection logger. */
public interface ConnectionLogger {
+ /**
+ Called when a new connection logs is added.
+ @param type has one of the value of ConnectionLogType.
+ @see com.libmailcore.ConnectionLogType
+ */
void log(long connectionID, int type, byte[] data);
}
diff --git a/src/java/com/libmailcore/ConnectionType.java b/src/java/com/libmailcore/ConnectionType.java
index d5eb979b..cc309158 100644
--- a/src/java/com/libmailcore/ConnectionType.java
+++ b/src/java/com/libmailcore/ConnectionType.java
@@ -1,7 +1,11 @@
package com.libmailcore;
+/** Connection type. */
public class ConnectionType {
+ /** Clear-text connection. */
final public static int ConnectionTypeClear = 1 << 0;
+ /** Connection starts in clear-text and is switched to SSL when it starts sending sensitive data. */
final public static int ConnectionTypeStartTLS = 1 << 1;
+ /** SSL connection. */
final public static int ConnectionTypeTLS = 1 << 2;
}
diff --git a/src/java/com/libmailcore/Encoding.java b/src/java/com/libmailcore/Encoding.java
index bbc469f6..c6d40912 100644
--- a/src/java/com/libmailcore/Encoding.java
+++ b/src/java/com/libmailcore/Encoding.java
@@ -1,6 +1,9 @@
package com.libmailcore;
+/** MIME encoding.
+ See IMAPPart#encoding() */
public class Encoding {
+ /** 7-bit encoding. */
final public static int Encoding7Bit = 0;
final public static int Encoding8Bit = 1;
final public static int EncodingBinary = 2;
diff --git a/src/java/com/libmailcore/ErrorCode.java b/src/java/com/libmailcore/ErrorCode.java
index 85686411..ec0833ab 100644
--- a/src/java/com/libmailcore/ErrorCode.java
+++ b/src/java/com/libmailcore/ErrorCode.java
@@ -1,46 +1,96 @@
package com.libmailcore;
+/** Error codes.
+ @see com.libmailcore.MailException#errorCode() */
public class ErrorCode {
+ /** No error occurred.*/
public final static int ErrorNone = 0; // 0
+ /**
+ An error related to the connection occurred.
+ It could not connect or it's been disconnected.
+ */
public final static int ErrorConnection = 1;
+ /** TLS/SSL connection was not available.*/
public final static int ErrorTLSNotAvailable = 2;
+ /** The protocol could not be parsed.*/
public final static int ErrorParse = 3;
+ /** Certificate was not valid.*/
public final static int ErrorCertificate = 4;
+ /** An authentication error occurred.*/
public final static int ErrorAuthentication = 5;
+ /** Specific to Gmail: IMAP not enabled.*/
public final static int ErrorGmailIMAPNotEnabled = 6;
+ /** Specific to Gmail: Exceeded bandwidth limit.*/
public final static int ErrorGmailExceededBandwidthLimit = 7;
+ /** Specific to Gmail: Too many simultaneous connections.*/
public final static int ErrorGmailTooManySimultaneousConnections = 8;
+ /** Specific to Mobile Me: Moved to iCloud.*/
public final static int ErrorMobileMeMoved = 9;
+ /** Specific to Yahoo: not available.*/
public final static int ErrorYahooUnavailable = 10; // 10
+ /** Non existant folder, select failed.*/
public final static int ErrorNonExistantFolder = 11;
+ /** IMAP: Error occurred while renaming a folder.*/
public final static int ErrorRename = 12;
+ /** IMAP: Error occurred while deleting a folder.*/
public final static int ErrorDelete = 13;
+ /** IMAP: Error occurred while creating a folder.*/
public final static int ErrorCreate = 14;
+ /** IMAP: Error occurred while subscribing/unsubcribing to a folder.*/
public final static int ErrorSubscribe = 15;
+ /** IMAP: Error occurred while adding a message to a folder.*/
public final static int ErrorAppend = 16;
+ /** IMAP: Error occurred while copying a message.*/
public final static int ErrorCopy = 17;
+ /** IMAP: Error occurred while expunging.*/
public final static int ErrorExpunge = 18;
+ /** IMAP: Error occurred while fetching messages.*/
public final static int ErrorFetch = 19;
+ /** IMAP: Error occurred while IDLing.*/
public final static int ErrorIdle = 20; // 20
+ /** IMAP: Error occurred while sending/getting identity.*/
public final static int ErrorIdentity = 21;
+ /** IMAP: Error occurred while getting namespace.*/
public final static int ErrorNamespace = 22;
+ /** IMAP: Error occurred while storing flags.*/
public final static int ErrorStore = 23;
+ /** IMAP: Error wile getting capabilities.*/
public final static int ErrorCapability = 24;
+ /** STARTTLS is not available.*/
public final static int ErrorStartTLSNotAvailable = 25;
+ /** SMTP: Illegal attachment: certain kind of attachment cannot be sent.*/
public final static int ErrorSendMessageIllegalAttachment = 26;
+ /** SMTP: Storage limit: message is probably too big.*/
public final static int ErrorStorageLimit = 27;
+ /** SMTP: Sending message is not allowed.*/
public final static int ErrorSendMessageNotAllowed = 28;
+ /** SMTP: Specific to hotmail. Needs to connect to webmail.*/
public final static int ErrorNeedsConnectToWebmail = 29;
+ /** SMTP: Error while sending message.*/
public final static int ErrorSendMessage = 30; // 30
+ /** SMTP: Authentication required.*/
public final static int ErrorAuthenticationRequired = 31;
+ /** POP: Error occurred while fetching message list.*/
public final static int ErrorFetchMessageList = 32;
+ /** POP: Error occurred while deleting message.*/
public final static int ErrorDeleteMessage = 33;
+ /** SMTP: Error while checking account.*/
public final static int ErrorInvalidAccount = 34;
+ /** Error when accessing/reading/writing file.*/
public final static int ErrorFile = 35;
+ /** IMAP: Error when trying to enable compression.*/
public final static int ErrorCompression = 36;
+ /** SMTP: Error when no sender has been specified.*/
public final static int ErrorNoSender = 37;
+ /** SMTP: Error when no recipient has been specified.*/
public final static int ErrorNoRecipient = 38;
+ /** IMAP: Error when a noop operation fails.*/
public final static int ErrorNoop = 39;
+ /**
+ IMAP: Error when the password has been entered but second factor
+ authentication is enabled: an application specific password is required.
+ */
public final static int ErrorGmailApplicationSpecificPasswordRequired = 40; // 40
+ /** NNTP: error when requesting date */
public final static int ErrorServerDate = 41;
}
diff --git a/src/java/com/libmailcore/HTMLRendererIMAPCallback.java b/src/java/com/libmailcore/HTMLRendererIMAPCallback.java
index 35b8c27a..c8c28360 100644
--- a/src/java/com/libmailcore/HTMLRendererIMAPCallback.java
+++ b/src/java/com/libmailcore/HTMLRendererIMAPCallback.java
@@ -1,7 +1,15 @@
package com.libmailcore;
+/** Callbacks to provide IMAP data for message rendering. */
public interface HTMLRendererIMAPCallback {
+ /**
+ Called when the data for the given part are needed. The implementation
+ should return the data of the part or returns nil if the data is
+ not available.
+ */
byte[] dataForIMAPPart(String folder, IMAPPart part);
+ /** Called when the given text part should be fetched. */
void prefetchAttachmentIMAPPart(String folder, IMAPPart part);
+ /** Called when the given image should be fetched. */
void prefetchImageIMAPPart(String folder, IMAPPart part);
}
diff --git a/src/java/com/libmailcore/HTMLRendererTemplateCallback.java b/src/java/com/libmailcore/HTMLRendererTemplateCallback.java
index 9e98586c..57caebb1 100644
--- a/src/java/com/libmailcore/HTMLRendererTemplateCallback.java
+++ b/src/java/com/libmailcore/HTMLRendererTemplateCallback.java
@@ -2,19 +2,51 @@ package com.libmailcore;
import java.util.Map;
+/**
+ Callbacks to provide templates for message rendering. Default implementations are
+ provided in HTMLRendererTemplteCallbackUtils
+*/
public interface HTMLRendererTemplateCallback {
+ /** Returns true if an attachment should be rendered using the image template. */
boolean canPreviewPart(AbstractPart part);
+ /** Returns true if an attachment should (such as an image) be shown. */
boolean shouldShowPart(AbstractPart part);
+ /** Returns the values used in the header template for a given template. */
Map<String, String> templateValuesForHeader(MessageHeader header);
+ /** Returns the values used in the attachment template for a given attachment. */
Map<String, String> templateValuesForPart(AbstractPart part);
+ /** Returns the template for the main header of the message. */
String templateForMainHeader(MessageHeader header);
+ /** Returns the template to render an image. */
String templateForImage(AbstractPart part);
+ /** Returns the template to render a non-image attachment. */
String templateForAttachment(AbstractPart part);
+ /**
+ Returns the template to render a message.
+ It should include HEADER and a BODY values.
+ */
String templateForMessage(AbstractMessage message);
+ /**
+ Returns the template to render an embedded message.
+ It should include HEADER and a BODY values.
+ */
String templateForEmbeddedMessage(AbstractMessagePart messagePart);
+ /** Returns the template for the header of an embedded message. */
String templateForEmbeddedMessageHeader(MessageHeader header);
+ /** Returns the separator between the text of the message and the attachments. */
String templateForAttachmentSeparator();
+ /**
+ Clean a HTML string.
+ The default implementation fixes broken tags, add missing &lt;html&gt;, &lt;body&gt; tags.
+ */
String cleanHTML(String html);
+ /**
+ Filter the HTML when rendering a given part. For example, it could filter out
+ dangerous HTML tags or CSS style.
+ */
String filterHTMLForPart(String html);
+ /**
+ Filter the HTML when rendering a the whole message.
+ */
String filterHTMLForMessage(String html);
}
diff --git a/src/java/com/libmailcore/HTMLRendererTemplateCallbackUtils.java b/src/java/com/libmailcore/HTMLRendererTemplateCallbackUtils.java
index f2fece70..0cb44a33 100644
--- a/src/java/com/libmailcore/HTMLRendererTemplateCallbackUtils.java
+++ b/src/java/com/libmailcore/HTMLRendererTemplateCallbackUtils.java
@@ -2,6 +2,7 @@ package com.libmailcore;
import java.util.Map;
+/** Default implementations for HTMLRendererTemplateCallback */
public class HTMLRendererTemplateCallbackUtils {
native static boolean canPreviewPart(AbstractPart part);
native static boolean shouldShowPart(AbstractPart part);
diff --git a/src/java/com/libmailcore/IMAPAppendMessageOperation.java b/src/java/com/libmailcore/IMAPAppendMessageOperation.java
index 1e735864..b626277a 100644
--- a/src/java/com/libmailcore/IMAPAppendMessageOperation.java
+++ b/src/java/com/libmailcore/IMAPAppendMessageOperation.java
@@ -2,9 +2,41 @@ package com.libmailcore;
import java.util.Date;
+/** Operation to append an message using IMAP. */
public class IMAPAppendMessageOperation extends IMAPOperation {
+ protected void finalize() throws Throwable
+ {
+ finalizeNative();
+ super.finalize();
+ }
+
+ /** Sets the progress listener. */
+ public void setProgressListener(IMAPOperationProgressListener aListener)
+ {
+ listener = aListener;
+ setupNativeOperationProgressListener();
+ }
+
+ /** Returns the progress listener. */
+ public IMAPOperationProgressListener progressListener()
+ {
+ return listener;
+ }
+
+ /** Sets the received date of the message to append. */
public native void setDate(Date date);
+ /** Returns the received date of the message to append. */
public native Date date();
+ /**
+ Returns the UID of the created message. It will have a correct value once
+ the operation finished.
+ */
public native long createdUID();
+
+ private native void finalizeNative();
+
+ private IMAPOperationProgressListener listener;
+ private native void setupNativeOperationProgressListener();
+ private long nativeOperationProgressListener;
}
diff --git a/src/java/com/libmailcore/IMAPCapability.java b/src/java/com/libmailcore/IMAPCapability.java
index 0a1cf349..d0e55134 100644
--- a/src/java/com/libmailcore/IMAPCapability.java
+++ b/src/java/com/libmailcore/IMAPCapability.java
@@ -1,5 +1,6 @@
package com.libmailcore;
+/** Capabilities of the IMAP server. */
public class IMAPCapability {
final public static int IMAPCapabilityACL = 0;
final public static int IMAPCapabilityBinary = 1;
diff --git a/src/java/com/libmailcore/IMAPCapabilityOperation.java b/src/java/com/libmailcore/IMAPCapabilityOperation.java
index 37c4b2a5..c3bb1712 100644
--- a/src/java/com/libmailcore/IMAPCapabilityOperation.java
+++ b/src/java/com/libmailcore/IMAPCapabilityOperation.java
@@ -1,5 +1,8 @@
package com.libmailcore;
+/** Operation to fetch the capabilities of the IMAP server. */
public class IMAPCapabilityOperation extends IMAPOperation {
+ /** The result set will contains values of IMAPCabilityOperation.
+ @see com.libmailcore.IMAPCapabilityOperation */
public native IndexSet capabilities();
}
diff --git a/src/java/com/libmailcore/IMAPCopyMessagesOperation.java b/src/java/com/libmailcore/IMAPCopyMessagesOperation.java
index 76fb41aa..49faf4ae 100644
--- a/src/java/com/libmailcore/IMAPCopyMessagesOperation.java
+++ b/src/java/com/libmailcore/IMAPCopyMessagesOperation.java
@@ -2,6 +2,11 @@ package com.libmailcore;
import java.util.Map;
+/** Operation to copy IMAP messages. */
public class IMAPCopyMessagesOperation extends IMAPOperation {
+ /**
+ Returns a map of the UIDs of the messages in the source folder to the UIDs of
+ the messages in the destination folder.
+ */
public native Map<Long,Long> uidMapping();
}
diff --git a/src/java/com/libmailcore/IMAPFetchContentOperation.java b/src/java/com/libmailcore/IMAPFetchContentOperation.java
index 07afcc0e..02238c1a 100644
--- a/src/java/com/libmailcore/IMAPFetchContentOperation.java
+++ b/src/java/com/libmailcore/IMAPFetchContentOperation.java
@@ -1,5 +1,6 @@
package com.libmailcore;
+/** Operation to fetch a message or an attachment from the IMAP server. */
public class IMAPFetchContentOperation extends IMAPOperation {
protected void finalize() throws Throwable
{
@@ -7,17 +8,20 @@ public class IMAPFetchContentOperation extends IMAPOperation {
super.finalize();
}
+ /** Sets the progress listener. */
public void setProgressListener(IMAPOperationProgressListener aListener)
{
listener = aListener;
setupNativeOperationProgressListener();
}
+ /** Returns the progress listener. */
public IMAPOperationProgressListener progressListener()
{
return listener;
}
+ /** Content of the message or the attachment. */
public native byte[] data();
private native void finalizeNative();
diff --git a/src/java/com/libmailcore/IMAPFetchFoldersOperation.java b/src/java/com/libmailcore/IMAPFetchFoldersOperation.java
index efccef5c..fc6e811b 100644
--- a/src/java/com/libmailcore/IMAPFetchFoldersOperation.java
+++ b/src/java/com/libmailcore/IMAPFetchFoldersOperation.java
@@ -2,6 +2,8 @@ package com.libmailcore;
import java.util.List;
+/** Operation to fetch the list of folders (or subscribed folders). */
public class IMAPFetchFoldersOperation extends IMAPOperation {
+ /** List of folders. */
public native List<IMAPFolder> folders();
}
diff --git a/src/java/com/libmailcore/IMAPFetchMessagesOperation.java b/src/java/com/libmailcore/IMAPFetchMessagesOperation.java
index daf8ae58..397ec152 100644
--- a/src/java/com/libmailcore/IMAPFetchMessagesOperation.java
+++ b/src/java/com/libmailcore/IMAPFetchMessagesOperation.java
@@ -2,6 +2,7 @@ package com.libmailcore;
import java.util.List;
+/** Operation to fetch the list of messages in a folder. */
public class IMAPFetchMessagesOperation extends IMAPOperation {
protected void finalize() throws Throwable
{
@@ -9,16 +10,25 @@ public class IMAPFetchMessagesOperation extends IMAPOperation {
super.finalize();
}
+ /** Sets progress listener. */
public void setProgressListener(IMAPOperationItemProgressListener aListener) {
listener = aListener;
setupNativeOperationProgressListener();
}
+ /** Returns the progress listener. */
public IMAPOperationItemProgressListener progressListener() {
return listener;
}
+ /** Sets the list of extra headers to fetch. They must be set before starting the operation. */
+ public native void setExtraHeaders(List<String> extraHeaders);
+ /** Returns the list of extra headers to fetch. */
+ public native List<String> extraHeaders();
+
+ /** Returns the list of messages. */
public native List<IMAPMessage> messages();
+ /** Returns the list of UIDs of the deleted messages on an IMAP server that supports QRESYNC. */
public native IndexSet vanishedMessages();
private native void finalizeNative();
diff --git a/src/java/com/libmailcore/IMAPFetchNamespaceOperation.java b/src/java/com/libmailcore/IMAPFetchNamespaceOperation.java
index a973b115..27646a3d 100644
--- a/src/java/com/libmailcore/IMAPFetchNamespaceOperation.java
+++ b/src/java/com/libmailcore/IMAPFetchNamespaceOperation.java
@@ -2,6 +2,7 @@ package com.libmailcore;
import java.util.Map;
+/** Operation to fetch the namespace. */
public class IMAPFetchNamespaceOperation extends IMAPOperation {
public native Map<String,IMAPNamespace> namespaces();
}
diff --git a/src/java/com/libmailcore/IMAPFetchParsedContentOperation.java b/src/java/com/libmailcore/IMAPFetchParsedContentOperation.java
index 39b5b3ec..1c1c8b55 100644
--- a/src/java/com/libmailcore/IMAPFetchParsedContentOperation.java
+++ b/src/java/com/libmailcore/IMAPFetchParsedContentOperation.java
@@ -1,5 +1,6 @@
package com.libmailcore;
+/** Operation to fetch a message and parse it. */
public class IMAPFetchParsedContentOperation extends IMAPOperation {
protected void finalize() throws Throwable
{
@@ -7,17 +8,20 @@ public class IMAPFetchParsedContentOperation extends IMAPOperation {
super.finalize();
}
+ /** Sets the progress listener. */
public void setProgressListener(IMAPOperationProgressListener aListener)
{
listener = aListener;
setupNativeOperationProgressListener();
}
+ /** Returns the progress listener. */
public IMAPOperationProgressListener progressListener()
{
return listener;
}
+ /** Returns the parsed message. */
public native MessageParser parser();
private native void finalizeNative();
diff --git a/src/java/com/libmailcore/IMAPFolder.java b/src/java/com/libmailcore/IMAPFolder.java
index 948da48d..e472167b 100644
--- a/src/java/com/libmailcore/IMAPFolder.java
+++ b/src/java/com/libmailcore/IMAPFolder.java
@@ -1,18 +1,31 @@
package com.libmailcore;
+/** IMAP folder. */
public class IMAPFolder extends NativeObject {
public IMAPFolder()
{
setupNative();
}
+ /** Sets the path of the folder. */
public native void setPath(String path);
+ /** Returns the path of the folder. */
public native String path();
+ /** Sets the delimiter of the folder. */
public native void setDelimiter(char delimiter);
+ /** Returns the delimiter of the folder. */
public native char delimiter();
+ /**
+ Sets the flags of the folder.
+ @see com.libmailcore.IMAPFolderFlags
+ */
public native void setFlags(int flags);
+ /**
+ Returns the flags of the folder.
+ @see com.libmailcore.IMAPFolderFlags
+ */
public native int flags();
private native void setupNative();
diff --git a/src/java/com/libmailcore/IMAPFolderFlags.java b/src/java/com/libmailcore/IMAPFolderFlags.java
index e91ad4c2..cb1743ce 100644
--- a/src/java/com/libmailcore/IMAPFolderFlags.java
+++ b/src/java/com/libmailcore/IMAPFolderFlags.java
@@ -1,23 +1,49 @@
package com.libmailcore;
+/** Flags of a folder.
+ @see com.libmailcore.IMAPFolder#flags() */
public class IMAPFolderFlags {
public final static int IMAPFolderFlagNone = 0;
public final static int IMAPFolderFlagMarked = 1 << 0;
public final static int IMAPFolderFlagUnmarked = 1 << 1;
+ /** The folder can't be selected and can't hold messages. */
public final static int IMAPFolderFlagNoSelect = 1 << 2;
+ /** The folder has no children. */
public final static int IMAPFolderFlagNoInferiors = 1 << 3;
+ /** The folder is INBOX. */
public final static int IMAPFolderFlagInbox = 1 << 4;
+ /** The folder is the sent folder. */
public final static int IMAPFolderFlagSentMail = 1 << 5;
+ /** The folder is the starred folder. */
public final static int IMAPFolderFlagStarred = 1 << 6;
+ /** The folder is the folder containg all mails. */
public final static int IMAPFolderFlagAllMail = 1 << 7;
+ /** The folder is the trash folder. */
public final static int IMAPFolderFlagTrash = 1 << 8;
+ /** The folder is the drafts folder. */
public final static int IMAPFolderFlagDrafts = 1 << 9;
+ /** The folder is the spam folder. */
public final static int IMAPFolderFlagSpam = 1 << 10;
+ /** The folder is the important folder. */
public final static int IMAPFolderFlagImportant = 1 << 11;
+ /** The folder is the archive folder. */
public final static int IMAPFolderFlagArchive = 1 << 12;
+ /**
+ Same as IMAPFolderFlagAllMail.
+ @see com.libmailcore.IMAPFolderFlags#IMAPFolderFlagAllMail
+ */
public final static int IMAPFolderFlagAll = IMAPFolderFlagAllMail;
+ /**
+ Same as IMAPFolderFlagSpam.
+ @see com.libmailcore.IMAPFolderFlags#IMAPFolderFlagSpam
+ */
public final static int IMAPFolderFlagJunk = IMAPFolderFlagSpam;
+ /**
+ Same as IMAPFolderFlagStarred.
+ @see com.libmailcore.IMAPFolderFlags#IMAPFolderFlagStarred
+ */
public final static int IMAPFolderFlagFlagged = IMAPFolderFlagStarred;
+ /** Mask for the types of folder. */
public final static int IMAPFolderFlagFolderTypeMask = IMAPFolderFlagInbox | IMAPFolderFlagSentMail | IMAPFolderFlagStarred | IMAPFolderFlagAllMail |
IMAPFolderFlagTrash| IMAPFolderFlagDrafts | IMAPFolderFlagSpam | IMAPFolderFlagImportant | IMAPFolderFlagArchive;
}
diff --git a/src/java/com/libmailcore/IMAPFolderInfo.java b/src/java/com/libmailcore/IMAPFolderInfo.java
index 1ecba511..01e85940 100644
--- a/src/java/com/libmailcore/IMAPFolderInfo.java
+++ b/src/java/com/libmailcore/IMAPFolderInfo.java
@@ -1,28 +1,47 @@
package com.libmailcore;
+/** Folders info such as message count, uid validity, etc. */
public class IMAPFolderInfo extends NativeObject {
public IMAPFolderInfo()
{
setupNative();
}
+ /**
+ Returns the message UID that will be likely used if a message is
+ added to that folder.
+ */
public native long uidNext();
+ /** Sets the next UID value. */
public native void setUidNext(long uidNext);
+ /**
+ Returns the UID validity of the folder. If that value change for a given folder path,
+ it means that the uids of the messages that you may have cached are not valid any more.
+ */
public native long uidValidity();
+ /** Sets the UID validity */
public native void setUidValidity(long uidValidity);
+ /** Returns the modification sequence value for CONDSTORE and QRESYNC. */
public native long modSequenceValue();
+ /** Sets the modification sequence value. */
public native void setModSequenceValue(long modSequenceValue);
+ /** Returns the number of messages. */
public native int messageCount();
+ /** Sets the number of messages. */
public native void setMessageCount(int messageCount);
+ /** Returns the UID of the first unseen message. */
public native long firstUnseenUid();
+ /** Sets the UID of the first unseen message. */
public native void setFirstUnseenUid(long firstUnseenUid);
+ /** Returns whether adding custom flags to messages is allowed. */
public native boolean allowsNewPermanentFlags();
+ /** Sets whether adding custom flags to messages is allowed. */
public native void setAllowsNewPermanentFlags(boolean allowsNewPermanentFlags);
-
+
private native void setupNative();
}
diff --git a/src/java/com/libmailcore/IMAPFolderInfoOperation.java b/src/java/com/libmailcore/IMAPFolderInfoOperation.java
index 36d01081..9d981b6c 100644
--- a/src/java/com/libmailcore/IMAPFolderInfoOperation.java
+++ b/src/java/com/libmailcore/IMAPFolderInfoOperation.java
@@ -1,5 +1,7 @@
package com.libmailcore;
+/** Operation to get info of a folder. The info will be fetched using SELECT. */
public class IMAPFolderInfoOperation extends IMAPOperation {
+ /** Info of the folder. */
public native IMAPFolderInfo info();
}
diff --git a/src/java/com/libmailcore/IMAPFolderStatus.java b/src/java/com/libmailcore/IMAPFolderStatus.java
index 09589252..b3ce5abc 100644
--- a/src/java/com/libmailcore/IMAPFolderStatus.java
+++ b/src/java/com/libmailcore/IMAPFolderStatus.java
@@ -1,27 +1,46 @@
package com.libmailcore;
+/** Folder status. */
public class IMAPFolderStatus extends NativeObject {
public IMAPFolderStatus()
{
setupNative();
}
+ /** Sets the number of unseen messages. */
public native void setUnseenCount(long unseen);
+ /** Returns the number of unseen messages. */
public native long unseenCount();
+ /** Sets the number of messages in the folder. */
public native void setMessageCount(long messages);
+ /** Returns the number of messages in the folder. */
public native long messageCount();
+ /** Sets the number of recent messages. */
public native void setRecentCount(long recent);
+ /** Returns the number of recent messages. */
public native long recentCount();
+ /** Sets the netx uid value. */
public native void setUidNext(long uidNext);
+ /**
+ Returns the message UID that will be likely used if a message is
+ added to that folder.
+ */
public native long uidNext();
+ /** Sets the UID validity */
public native void setUidValidity(long uidValidity);
+ /**
+ Returns the UID validity of the folder. If that value change for a given folder path,
+ it means that the uids of the messages that you may have cached are not valid any more.
+ */
public native long uidValidity();
+ /** Sets the highest modification sequence value of the messages in the folder. */
public native void setHighestModSeqValue(long highestModSeqValue);
+ /** Returns the highest modification sequence value of the messages in the folder. */
public native long highestModSeqValue();
private native void setupNative();
diff --git a/src/java/com/libmailcore/IMAPFolderStatusOperation.java b/src/java/com/libmailcore/IMAPFolderStatusOperation.java
index 3d39892f..5bf3bcf9 100644
--- a/src/java/com/libmailcore/IMAPFolderStatusOperation.java
+++ b/src/java/com/libmailcore/IMAPFolderStatusOperation.java
@@ -1,5 +1,6 @@
package com.libmailcore;
+/** Operation to fetch a folder status. */
public class IMAPFolderStatusOperation extends IMAPOperation {
public native IMAPFolderStatus status();
}
diff --git a/src/java/com/libmailcore/IMAPIdentity.java b/src/java/com/libmailcore/IMAPIdentity.java
index b8191b8b..5a3352aa 100644
--- a/src/java/com/libmailcore/IMAPIdentity.java
+++ b/src/java/com/libmailcore/IMAPIdentity.java
@@ -2,25 +2,36 @@ package com.libmailcore;
import java.util.List;
+/** Identity of an IMAP client or an IMAP server. */
public class IMAPIdentity extends NativeObject {
public IMAPIdentity()
{
setupNative();
}
+ /** Sets the vendor. */
public native void setVendor(String vendor);
+ /** Returns the vendor. */
public native String vendor();
+ /** Sets the name of the software. */
public native void setName(String name);
+ /** Returns the name of the software. */
public native String name();
+ /** Sets the version of the software. */
public native void setVersion(String version);
+ /** Returns the version of the software. */
public native String version();
+ /** Clear infos. */
public native void removeAllInfos();
+ /** Returns all infos names. */
public native List<String> allInfoKeys();
+ /** Returns a value for a name of an info. */
public native String infoForKey(String key);
+ /** Sets a value of an info. */
public native void setInfoForKey(String key, String value);
private native void setupNative();
diff --git a/src/java/com/libmailcore/IMAPIdentityOperation.java b/src/java/com/libmailcore/IMAPIdentityOperation.java
index 443676d7..d07b063a 100644
--- a/src/java/com/libmailcore/IMAPIdentityOperation.java
+++ b/src/java/com/libmailcore/IMAPIdentityOperation.java
@@ -1,5 +1,6 @@
package com.libmailcore;
+/** Operation to notify the identity of the client and get the identity of the server. */
public class IMAPIdentityOperation extends IMAPOperation {
public native IMAPIdentity serverIdentity();
}
diff --git a/src/java/com/libmailcore/IMAPIdleOperation.java b/src/java/com/libmailcore/IMAPIdleOperation.java
index 30b43c43..f2d968a8 100644
--- a/src/java/com/libmailcore/IMAPIdleOperation.java
+++ b/src/java/com/libmailcore/IMAPIdleOperation.java
@@ -1,5 +1,6 @@
package com.libmailcore;
+/** Operation for IMAP IDLE (wait for incoming messages). */
public class IMAPIdleOperation extends IMAPOperation {
public native void interruptIdle();
}
diff --git a/src/java/com/libmailcore/IMAPMessage.java b/src/java/com/libmailcore/IMAPMessage.java
index 80860afc..c6d638ec 100644
--- a/src/java/com/libmailcore/IMAPMessage.java
+++ b/src/java/com/libmailcore/IMAPMessage.java
@@ -2,49 +2,102 @@ package com.libmailcore;
import java.util.List;
+/** IMAP messages. */
public class IMAPMessage extends AbstractMessage {
+ /** IMAP sequence number. */
public native long sequenceNumber();
+ /** Sets the IMAP sequence number. */
public native void setSequenceNumber(long sequenceNumber);
+ /** UID of the message. */
public native long uid();
+ /** Sets the UID of the message. */
public native void setUid(long uid);
+ /** Size of the message. */
public native long size();
+ /** Sets the size of the message. */
public native void setSize(long size);
+ /**
+ Sets flags of the message.
+ @see com.libmailcore.MessageFlag
+ */
public native void setFlags(int flags);
+ /**
+ Flags of the message.
+ @see com.libmailcore.MessageFlag
+ */
public native int flags();
+ /**
+ Set original message flags.
+ @see com.libmailcore.MessageFlag
+ */
public native void setOriginalFlags(int flags);
+ /**
+ Original message flags.
+ @see com.libmailcore.MessageFlag
+ */
public native int originalFlags();
+ /**
+ Sets custom flags.
+ */
public native void setCustomFlags(List<String> customFlags);
+ /**
+ Returns custom flags.
+ */
public native List<String> customFlags();
+ /** Returns the modification sequence value. */
public native long modSeqValue();
+ /** Sets the modification sequence value. */
public native void setModSeqValue(long uid);
+ /** Sets the main part of the message. */
public native void setMainPart(AbstractPart mainPart);
+ /** Returns the main part of the message. */
public native AbstractPart mainPart();
+ /** Sets the labels of the message in case that's a Gmail server. */
public native void setGmailLabels(List<String> labels);
+ /** Returns the labels of the message in case that's a Gmail server. */
public native List<String> gmailLabels();
+ /** Sets the message identifier on Gmail server. */
public native void setGmailMessageID(long msgID);
+ /** Returns the message identifier on Gmail server. */
public native long gmailMessageID();
+ /** Sets the message thread identifier on Gmail server. */
public native void setGmailThreadID(long threadID);
+ /** Returns the message thread identifier on Gmail server. */
public native long gmailThreadID();
+ /**
+ Returns the MIME part with the given partID.
+ @see com.libmailcore.IMAPPart#partID()
+ @see com.libmailcore.IMAPMessagePart#partID()
+ @see com.libmailcore.IMAPMultipart#partID()
+ */
public native AbstractPart partForPartID(String partID);
- public native AbstractPart partForContentID(String contentID);
- public native AbstractPart partForUniqueID(String uniqueID);
-
+ /**
+ Returns the HTML rendering of the message.
+ @param folder is the folder containing the message.
+ @param dataCallback callbacks for the IMAP data.
+ @param htmlCallback callbacks for the HTML template.
+ */
public native String htmlRendering(String folder,
HTMLRendererIMAPCallback dataCallback,
HTMLRendererTemplateCallback htmlCallback);
+ /**
+ Returns the HTML rendering of the message.
+ @param folder is the folder containing the message.
+ @param dataCallback callbacks for the IMAP data.
+ */
public String htmlRendering(String folder,
HTMLRendererIMAPCallback dataCallback)
{
diff --git a/src/java/com/libmailcore/IMAPMessagePart.java b/src/java/com/libmailcore/IMAPMessagePart.java
index 50126cc4..5bc22d24 100644
--- a/src/java/com/libmailcore/IMAPMessagePart.java
+++ b/src/java/com/libmailcore/IMAPMessagePart.java
@@ -1,7 +1,10 @@
package com.libmailcore;
+/** IMAP embedded message part. */
public class IMAPMessagePart extends AbstractMessagePart {
+ /** Sets part ID. */
public native void setPartID(String partID);
+ /** Returns part ID. */
public native String partID();
private static final long serialVersionUID = 1L;
diff --git a/src/java/com/libmailcore/IMAPMessageRenderingOperation.java b/src/java/com/libmailcore/IMAPMessageRenderingOperation.java
index fe66ba04..4b2a0779 100644
--- a/src/java/com/libmailcore/IMAPMessageRenderingOperation.java
+++ b/src/java/com/libmailcore/IMAPMessageRenderingOperation.java
@@ -1,5 +1,6 @@
package com.libmailcore;
+/** Operation to render an IMAP message. */
public class IMAPMessageRenderingOperation extends IMAPOperation {
public native String result();
}
diff --git a/src/java/com/libmailcore/IMAPMessagesRequestKind.java b/src/java/com/libmailcore/IMAPMessagesRequestKind.java
index a30f45c9..82199030 100644
--- a/src/java/com/libmailcore/IMAPMessagesRequestKind.java
+++ b/src/java/com/libmailcore/IMAPMessagesRequestKind.java
@@ -1,16 +1,37 @@
package com.libmailcore;
+/**
+ Items to request when fetching the list of messages.
+ @see com.libmailcore.IMAPSession#fetchMessagesByUIDOperation(String folder, int requestKind, IndexSet indexes)
+ @see com.libmailcore.IMAPSession#fetchMessagesByNumberOperation(String folder, int requestKind, IndexSet indexes)
+ @see com.libmailcore.IMAPSession#syncMessagesByUIDOperation(String folder, int requestKind, IndexSet indexes, long modSeq)
+*/
public class IMAPMessagesRequestKind {
+ /** Requests UID of the messages. */
public final static int IMAPMessagesRequestKindUid = 0;
+ /** Requests the flags of the messages. */
public final static int IMAPMessagesRequestKindFlags = 1 << 0;
+ /** Requests the headers of the messages (ENVELOPE). */
public final static int IMAPMessagesRequestKindHeaders = 1 << 1;
+ /** Requests the MIME Structure of the messages (BODYSTRUCTURE). */
public final static int IMAPMessagesRequestKindStructure = 1 << 2;
+ /** Requests the received date of the messages (INTERNALDATE). */
public final static int IMAPMessagesRequestKindInternalDate = 1 << 3;
+ /** Requests the headers of the messages. They will be parsed by MailCore. */
public final static int IMAPMessagesRequestKindFullHeaders = 1 << 4;
+ /** Requests the header "Subject". */
public final static int IMAPMessagesRequestKindHeaderSubject = 1 << 5;
+ /** Requests the Labels on Gmail server. */
public final static int IMAPMessagesRequestKindGmailLabels = 1 << 6;
+ /** Requests the message identifier on Gmail server. */
public final static int IMAPMessagesRequestKindGmailMessageID = 1 << 7;
+ /** Requests the message thread identifier on Gmail server. */
public final static int IMAPMessagesRequestKindGmailThreadID = 1 << 8;
+ /**
+ Requests extra headers.
+ @see com.libmailcore.IMAPFetchMessagesOperation#setExtraHeaders
+ */
public final static int IMAPMessagesRequestKindExtraHeaders = 1 << 9;
+ /** Requests the size of the messages. */
public final static int IMAPMessagesRequestKindSize = 1 << 10;
}
diff --git a/src/java/com/libmailcore/IMAPMultipart.java b/src/java/com/libmailcore/IMAPMultipart.java
index 5e30815e..f10e3514 100644
--- a/src/java/com/libmailcore/IMAPMultipart.java
+++ b/src/java/com/libmailcore/IMAPMultipart.java
@@ -1,7 +1,10 @@
package com.libmailcore;
+/** IMAP multipart */
public class IMAPMultipart extends AbstractMultipart {
+ /** Sets part ID. */
public native void setPartID(String partID);
+ /** Returns part ID. */
public native String partID();
private native void setupNative();
diff --git a/src/java/com/libmailcore/IMAPNamespace.java b/src/java/com/libmailcore/IMAPNamespace.java
index 5658b1aa..f590eb6e 100644
--- a/src/java/com/libmailcore/IMAPNamespace.java
+++ b/src/java/com/libmailcore/IMAPNamespace.java
@@ -2,18 +2,33 @@ package com.libmailcore;
import java.util.List;
+/** IMAP Namespace */
public class IMAPNamespace extends NativeObject {
+ /** Returns the prefix of the main namespace item. */
public native String mainPrefix();
+ /** Returns the delimiter of the main namespace item. */
public native char mainDelimiter();
+ /** Returns the list of prefixes. */
public native List<String> prefixes();
+ /**
+ Returns the folder path for the given list of path components in the context
+ of the main item of the namespace.
+ */
public native String pathForComponents(List<String> components);
+ /**
+ Returns the folder path for the given list of path components and a prefix.
+ It will use the best item matching the prefix to compute the path.
+ */
public native String pathForComponentsAndPrefix(List<String> components, String prefix);
+ /** Returns the components given a folder path. */
public native List<String> componentsFromPath(String path);
+ /** Returns true if the namespace contains the given folder path. */
public native boolean containsFolderPath(String path);
+ /** Returns a namespace (with a single namespace item) with a prefix and a delimiter. */
public static native IMAPNamespace namespaceWithPrefix(String prefix, char delimiter);
}
diff --git a/src/java/com/libmailcore/IMAPNamespaceItem.java b/src/java/com/libmailcore/IMAPNamespaceItem.java
index e8d0bfe7..4249a790 100644
--- a/src/java/com/libmailcore/IMAPNamespaceItem.java
+++ b/src/java/com/libmailcore/IMAPNamespaceItem.java
@@ -4,14 +4,21 @@ import java.util.List;
public class IMAPNamespaceItem extends NativeObject {
+ /** Sets prefix. */
public native void setPrefix(String prefix);
+ /** Returns prefix. */
public native String prefix();
+ /** Sets delimiter. */
public native void setDelimiter(char delimiter);
+ /** Returns delimiter. */
public native char delimiter();
+ /** Returns the folder path for the given list of path components. */
public native String pathForComponents(List<String> components);
+ /** Returns the components given a folder path. */
public native List<String> componentsForPath(String path);
+ /** Returns true if the namespace contains the given folder path. */
public native boolean containsFolder(String folder);
}
diff --git a/src/java/com/libmailcore/IMAPOperation.java b/src/java/com/libmailcore/IMAPOperation.java
index 4fea241f..22433066 100644
--- a/src/java/com/libmailcore/IMAPOperation.java
+++ b/src/java/com/libmailcore/IMAPOperation.java
@@ -1,6 +1,11 @@
package com.libmailcore;
+/** IMAP Operation. */
public class IMAPOperation extends Operation {
+ /**
+ Returns error once the operation finished running. It will return null if the operation
+ successfully ran.
+ */
public MailException exception() {
if (errorCode() == ErrorCode.ErrorNone) {
return null;
@@ -10,6 +15,11 @@ public class IMAPOperation extends Operation {
private native int errorCode();
+ /**
+ Calls the method succeeded() of the callback if the operation succeeded or failed()
+ if the operation failed.
+ @see com.libmailcore.OperationCallback
+ */
protected void callCallback()
{
if (callback != null) {
diff --git a/src/java/com/libmailcore/IMAPOperationItemProgressListener.java b/src/java/com/libmailcore/IMAPOperationItemProgressListener.java
index 00a862ca..b26cd502 100644
--- a/src/java/com/libmailcore/IMAPOperationItemProgressListener.java
+++ b/src/java/com/libmailcore/IMAPOperationItemProgressListener.java
@@ -1,5 +1,7 @@
package com.libmailcore;
+/** Progress listener for IMAP operations working with items such as IMAPFetchMessagesOperation. */
public interface IMAPOperationItemProgressListener {
+ /** Called when a progress has been notified. */
void itemProgress(long current, long maximum);
}
diff --git a/src/java/com/libmailcore/IMAPOperationProgressListener.java b/src/java/com/libmailcore/IMAPOperationProgressListener.java
index 2754403b..a9154354 100644
--- a/src/java/com/libmailcore/IMAPOperationProgressListener.java
+++ b/src/java/com/libmailcore/IMAPOperationProgressListener.java
@@ -1,5 +1,7 @@
package com.libmailcore;
+/** Progress listener for IMAP operations working with stream of data. */
public interface IMAPOperationProgressListener {
+ /** Called when a progress has been notified. */
void bodyProgress(long current, long maximum);
}
diff --git a/src/java/com/libmailcore/IMAPPart.java b/src/java/com/libmailcore/IMAPPart.java
index 27765f41..50faf95c 100644
--- a/src/java/com/libmailcore/IMAPPart.java
+++ b/src/java/com/libmailcore/IMAPPart.java
@@ -1,15 +1,29 @@
package com.libmailcore;
+/** IMAP part. */
public class IMAPPart extends AbstractPart {
+ /** Sets part ID. */
public native void setPartID(String partID);
+ /** Returns part ID. */
public native String partID();
+ /** Sets encoded size of the part. */
public native void setSize(long size);
+ /** Returns encoded size of the part. */
public native long size();
+ /** Returns decoded size. */
public native long decodedSize();
+ /**
+ Sets encoding used (base64, quoted-printable, etc).
+ @see com.libmailcore.Encoding
+ */
public native void setEncoding(int encoding);
+ /**
+ Returns encoding used (base64, quoted-printable, etc.)
+ @see com.libmailcore.Encoding
+ */
public native int encoding();
private static final long serialVersionUID = 1L;
diff --git a/src/java/com/libmailcore/IMAPQuotaOperation.java b/src/java/com/libmailcore/IMAPQuotaOperation.java
index b5f4e03a..97e7fbb4 100644
--- a/src/java/com/libmailcore/IMAPQuotaOperation.java
+++ b/src/java/com/libmailcore/IMAPQuotaOperation.java
@@ -1,6 +1,9 @@
package com.libmailcore;
+/** IMAP QUOTA Operation. */
public class IMAPQuotaOperation extends IMAPOperation {
+ /** Returns quota usage. */
public native int usage();
+ /** Returns quota limit. */
public native int limit();
}
diff --git a/src/java/com/libmailcore/IMAPSearchExpression.java b/src/java/com/libmailcore/IMAPSearchExpression.java
index 1319eb08..0d4d5e5d 100644
--- a/src/java/com/libmailcore/IMAPSearchExpression.java
+++ b/src/java/com/libmailcore/IMAPSearchExpression.java
@@ -3,46 +3,74 @@ package com.libmailcore;
import java.util.Date;
public class IMAPSearchExpression extends NativeObject {
- public IMAPSearchExpression()
- {
- setupNative();
- }
-
+ /** Returns search expression to return all emails. */
public static native IMAPSearchExpression searchAll();
+ /** Returns search expression to return emails matching the From header. */
public static native IMAPSearchExpression searchFrom(String value);
+ /** Returns search expression to return emails matching the To header. */
public static native IMAPSearchExpression searchTo(String value);
+ /** Returns search expression to return emails matching the Cc header. */
public static native IMAPSearchExpression searchCc(String value);
+ /** Returns search expression to return emails matching the Bcc header. */
public static native IMAPSearchExpression searchBcc(String value);
+ /** Returns search expression to return emails matching any recipient header. */
public static native IMAPSearchExpression searchRecipient(String value);
+ /** Returns search expression to return emails matching the Subject header. */
public static native IMAPSearchExpression searchSubject(String value);
+ /** Returns search expression to return emails matching the content. */
public static native IMAPSearchExpression searchContent(String value);
+ /** Returns search expression to return emails matching the body. */
public static native IMAPSearchExpression searchBody(String value);
+ /** Returns search expression to return emails matching a given header. */
public static native IMAPSearchExpression searchHeader(String header, String value);
+ /** Returns search expression to return emails matching a set of UIDs. */
public static native IMAPSearchExpression searchUIDs(IndexSet uids);
+ /** Returns search expression to return read emails. */
public static native IMAPSearchExpression searchRead();
+ /** Returns search expression to return unread emails. */
public static native IMAPSearchExpression searchUnread();
+ /** Returns search expression to return flagged emails. */
public static native IMAPSearchExpression searchFlagged();
+ /** Returns search expression to return unflagged emails. */
public static native IMAPSearchExpression searchUnflagged();
+ /** Returns search expression to return answered emails. */
public static native IMAPSearchExpression searchAnswered();
+ /** Returns search expression to return unanswered emails. */
public static native IMAPSearchExpression searchUnanswered();
+ /** Returns search expression to return drafts. */
public static native IMAPSearchExpression searchDraft();
+ /** Returns search expression to return undrafts. */
public static native IMAPSearchExpression searchUndraft();
+ /** Returns search expression to return emails marked as deleted. */
public static native IMAPSearchExpression searchDeleted();
+ /** Returns search expression to return emails marked as spam. */
public static native IMAPSearchExpression searchSpam();
+ /** Returns search expression to return emails older than a specific date. */
public static native IMAPSearchExpression searchBeforeDate(Date date);
+ /** Returns search expression to return emails that matches a specific date. */
public static native IMAPSearchExpression searchOnDate(Date date);
+ /** Returns search expression to return emails more recent that a specific date. */
public static native IMAPSearchExpression searchSinceDate(Date date);
+ /** Returns search expression to return emails with received date older than a specific date. */
public static native IMAPSearchExpression searchBeforeReceivedDate(Date date);
+ /** Returns search expression to return emails with received date that matches a specific date. */
public static native IMAPSearchExpression searchOnReceivedDate(Date date);
+ /** Returns search expression to return emails with received date more recent than a specific date. */
public static native IMAPSearchExpression searchSinceReceivedDate(Date date);
+ /** Returns search expression to return emails larger than a given size. */
public static native IMAPSearchExpression searchSizeLarger(long size);
+ /** Returns search expression to return emails smaller than a given size. */
public static native IMAPSearchExpression searchSizeSmaller(long size);
+ /** Returns search expression to return emails with a specific thread identifier. */
public static native IMAPSearchExpression searchGmailThreadID(long number);
+ /** Returns search expression to return emails with a specific message identifier. */
public static native IMAPSearchExpression searchGmailMessageID(long number);
+ /** Returns search expression to return emails that match a Gmail search expression. */
public static native IMAPSearchExpression searchGmailRaw(String expr);
+ /** Returns search expression to return emails that match both expressions. */
public static native IMAPSearchExpression searchAnd(IMAPSearchExpression left, IMAPSearchExpression right);
+ /** Returns search expression to return emails that match one of the expressions. */
public static native IMAPSearchExpression searchOr(IMAPSearchExpression left, IMAPSearchExpression right);
+ /** Returns search expression to return emails that don't match a given expression. */
public static native IMAPSearchExpression searchNot(IMAPSearchExpression notExpr);
-
- private native void setupNative();
}
diff --git a/src/java/com/libmailcore/IMAPSearchKind.java b/src/java/com/libmailcore/IMAPSearchKind.java
index fe71fdcd..bbc8e7f8 100644
--- a/src/java/com/libmailcore/IMAPSearchKind.java
+++ b/src/java/com/libmailcore/IMAPSearchKind.java
@@ -1,5 +1,7 @@
package com.libmailcore;
+/** Search types.
+ @see com.libmailcore.IMAPSession#searchOperation(String folder, int kind, String searchString) */
public class IMAPSearchKind {
public final static int IMAPSearchKindAll = 0;
public final static int IMAPSearchKindNone = 1;
diff --git a/src/java/com/libmailcore/IMAPSearchOperation.java b/src/java/com/libmailcore/IMAPSearchOperation.java
index 2b9de495..81e314c6 100644
--- a/src/java/com/libmailcore/IMAPSearchOperation.java
+++ b/src/java/com/libmailcore/IMAPSearchOperation.java
@@ -1,5 +1,7 @@
package com.libmailcore;
+/** IMAP Search operation. */
public class IMAPSearchOperation extends IMAPOperation {
+ /** Returns UIDs matching the search query. */
public native IndexSet uids();
} \ No newline at end of file
diff --git a/src/java/com/libmailcore/IMAPSession.java b/src/java/com/libmailcore/IMAPSession.java
index f3e305a4..27ab8461 100644
--- a/src/java/com/libmailcore/IMAPSession.java
+++ b/src/java/com/libmailcore/IMAPSession.java
@@ -2,7 +2,9 @@ package com.libmailcore;
import java.util.List;
+/** IMAP session. */
public class IMAPSession extends NativeObject {
+ /** Constructor for the IMAPSession. */
public IMAPSession()
{
setupNative();
@@ -14,172 +16,268 @@ public class IMAPSession extends NativeObject {
super.finalize();
}
+ /** Sets the IMAP server hostname. */
public native void setHostname(String hostname);
+ /** Returns the IMAP server hostname. */
public native String hostname();
+ /** Sets the port. */
public native void setPort(int port);
+ /** Returns the port. */
public native int port();
+ /** Sets the username. */
public native void setUsername(String username);
+ /** Returns the username. */
public native String username();
+ /** Sets the password. */
public native void setPassword(String password);
+ /** Returns the password. */
public native String password();
+ /** Sets the OAuth2 token. */
public native void setOAuth2Token(String token);
+ /** Returns the OAuth2 token. */
public native String OAuth2Token();
+ /**
+ Sets the authentication type.
+ @see com.libmailcore.AuthType
+ */
public native void setAuthType(int authType);
+ /**
+ Returns authentication type.
+ @see com.libmailcore.AuthType
+ */
public native int authType();
+ /**
+ Set connection type (clear-text, SSL or STARTTLS).
+ @see com.libmailcore.ConnectionType
+ */
public native void setConnectionType(int connectionType);
+ /**
+ Returns connection type (clear-text, SSL or STARTTLS).
+ @see com.libmailcore.ConnectionType
+ */
public native int connectionType();
+ /** Sets network timeout in seconds. */
public native void setTimeout(long seconds);
+ /** Returns network timeout in seconds. */
public native long timeout();
+ /** Sets whether the certificate of the server should be checked. */
public native void setCheckCertificateEnabled(boolean enabled);
+ /** Returns whether the certificate of the server should be checked. */
public native boolean isCheckCertificateEnabled();
+ /** Sets the default namespace. */
public native void setDefaultNamespace(IMAPNamespace ns);
+ /** Returns the default namespace. */
public native IMAPNamespace defaultNamespace();
+ /** Set whether the IMAP session can access folders using several IMAP connections. */
public native void setAllowsFolderConcurrentAccessEnabled(boolean enabled);
+ /** Returns whether the IMAP session can access folders using several IMAP connections. */
public native boolean allowsFolderConcurrentAccessEnabled();
+ /** Sets the maximum number of IMAP connections to use. */
public native void setMaximumConnections(int maxConnections);
+ /** Returns the maximum number of IMAP connections to use. */
public native int maximumConnections();
+ /** Sets the connection logger. */
public void setConnectionLogger(ConnectionLogger logger)
{
connectionLogger = logger;
setupNativeConnectionLogger();
}
+ /** Returns the connection logger. */
public ConnectionLogger connectionLogger()
{
return connectionLogger;
}
+ /** Sets the IMAP operations queue listener. */
public void setOperationQueueListener(OperationQueueListener listener)
{
operationQueueListener = listener;
setupNativeOperationQueueListener();
}
+ /** Returns the IMAP operations queue listener. */
public OperationQueueListener operationQueueListener()
{
return operationQueueListener;
}
+ /** Returns whether the operation queue is running. */
public native boolean isOperationQueueRunning();
+ /** Cancels all queued operations. */
public native void cancelAllOperations();
+ /** Returns server identity. */
public native IMAPIdentity serverIdentity();
+ /** Returns client identity. It can be modified before establishing connection. */
public native IMAPIdentity clientIdentity();
+
+ /** Returns the Gmail user display name. */
public native String gmailUserDisplayName();
+ /** Returns an operation to request the folder info. */
public native IMAPFolderInfoOperation folderInfoOperation(String folder);
+ /** Returns an operation to request the folder status. */
public native IMAPFolderStatusOperation folderStatusOperation(String folder);
+ /** Returns an operation to request the list of subscribed folders. */
public native IMAPFetchFoldersOperation fetchSubscribedFoldersOperation();
+ /** Returns an operation to request the list of all folders. */
public native IMAPFetchFoldersOperation fetchAllFoldersOperation();
+ /** Returns an operation to rename a folder. */
public native IMAPOperation renameFolderOperation(String folder, String otherName);
+ /** Returns an operation to delete a folder. */
public native IMAPOperation deleteFolderOperation(String folder);
+ /** Returns an operation to create a folder. */
public native IMAPOperation createFolderOperation(String folder);
+ /** Returns an operation to subscribe a folder. */
public native IMAPOperation subscribeFolderOperation(String folder);
+ /** Returns an operation to unsubscribe a folder. */
public native IMAPOperation unsubscribeFolderOperation(String folder);
+ /** Returns an operation to append a message to a folder. */
public native IMAPAppendMessageOperation appendMessageOperation(String folder, byte[] messageData, int messageFlags, List<String> customFlags);
+ /** Returns an operation to append a message to a folder. */
public IMAPAppendMessageOperation appendMessageOperation(String folder, byte[] messageData, int messageFlags)
{
return appendMessageOperation(folder, messageData, messageFlags, null);
}
+ /** Returns an operation to copy messages to a folder. */
public native IMAPCopyMessagesOperation copyMessagesOperation(String folder, IndexSet uids, String destFolder);
+ /** Returns an operation to expunge messages after they've been marked as deleted. */
public native IMAPOperation expungeOperation(String folder);
+ /** Returns an operation to fetch a list of messages by UID. */
public native IMAPFetchMessagesOperation fetchMessagesByUIDOperation(String folder, int requestKind, IndexSet indexes);
+ /** Returns an operation to fetch a list of messages by sequence number. */
public native IMAPFetchMessagesOperation fetchMessagesByNumberOperation(String folder, int requestKind, IndexSet indexes);
+ /** Returns an operation to sync a list of messages. */
public native IMAPFetchMessagesOperation syncMessagesByUIDOperation(String folder, int requestKind, IndexSet indexes, long modSeq);
+ /** Returns an operation to fetch a message content by UID. */
public native IMAPFetchContentOperation fetchMessageByUIDOperation(String folder, long uid, boolean urgent);
+ /** Returns an operation to fetch a message content by UID. */
public IMAPFetchContentOperation fetchMessageByUIDOperation(String folder, long uid)
{
return fetchMessageByUIDOperation(folder, uid, false);
}
+ /** Returns an operation to fetch an attachment content using the UID of a message. */
public native IMAPFetchContentOperation fetchMessageAttachmentByUIDOperation(String folder, long uid, String partID,
int encoding, boolean urgent);
+ /** Returns an operation to fetch an attachment content using the UID of a message. */
public IMAPFetchContentOperation fetchMessageAttachmentByUIDOperation(String folder, long uid, String partID,
int encoding)
{
return fetchMessageAttachmentByUIDOperation(folder, uid, partID, encoding, false);
}
+ /** Returns an operation to fetch a message content by sequence number. */
public native IMAPFetchContentOperation fetchMessageByNumberOperation(String folder, long number, boolean urgent);
+ /** Returns an operation to fetch a message content by sequence number. */
public IMAPFetchContentOperation fetchMessageByNumberOperation(String folder, long number)
{
return fetchMessageByNumberOperation(folder, number, false);
}
+ /** Returns an operation to fetch an attachment content using the sequence number of a message. */
public native IMAPFetchContentOperation fetchMessageAttachmentByNumberOperation(String folder, long number, String partID,
int encoding, boolean urgent);
+ /** Returns an operation to fetch an attachment content using the sequence number of a message. */
public IMAPFetchContentOperation fetchMessageAttachmentByNumberOperation(String folder, long number, String partID,
int encoding)
{
return fetchMessageAttachmentByNumberOperation(folder, number, partID, encoding, false);
}
+ /** Returns an operation to fetch a message content by UID and parse it. */
public native IMAPFetchParsedContentOperation fetchParsedMessageByUIDOperation(String folder, long uid, boolean urgent);
+ /** Returns an operation to fetch a message content by UID and parse it. */
public IMAPFetchParsedContentOperation fetchParsedMessageByUIDOperation(String folder, long uid)
{
return fetchParsedMessageByUIDOperation(folder, uid, false);
}
+ /** Returns an operation to fetch a message content by sequence number and parse it. */
public native IMAPFetchParsedContentOperation fetchParsedMessageByNumberOperation(String folder, long number, boolean urgent);
+ /** Returns an operation to fetch a message content by sequence number and parse it. */
public IMAPFetchParsedContentOperation fetchParsedMessageByNumberOperation(String folder, long number)
{
return fetchParsedMessageByNumberOperation(folder, number, false);
}
+ /** Returns an operation to store flags to a set of messages designated by UIDs. */
public native IMAPOperation storeFlagsByUIDOperation(String folder, IndexSet uids, int kind, int flags, List<String> customFlags);
+ /** Returns an operation to store flags to a set of messages designated by UIDs. */
public IMAPOperation storeFlagsByUIDOperation(String folder, IndexSet uids, int kind, int flags)
{
return storeFlagsByUIDOperation(folder, uids, kind, flags, null);
}
+ /** Returns an operation to store flags to a set of messages designated by sequence numbers. */
public native IMAPOperation storeFlagsByNumberOperation(String folder, IndexSet numbers, int kind, int flags, List<String> customFlags);
+ /** Returns an operation to store flags to a set of messages designated by sequence numbers. */
public IMAPOperation storeFlagsByNumberOperation(String folder, IndexSet numbers, int kind, int flags)
{
return storeFlagsByNumberOperation(folder, numbers, kind, flags, null);
}
+ /** Returns an operation to store labels to a set of messages designated by UIDs. */
public native IMAPOperation storeLabelsByUIDOperation(String folder, IndexSet uids, int kind, List<String> labels);
+ /** Returns an operation to store labels to a set of messages designated by sequence numbers. */
public native IMAPOperation storeLabelsByNumberOperation(String folder, IndexSet numbers, int kind, List<String> labels);
+ /** Returns a simple search operation. */
public native IMAPSearchOperation searchOperation(String folder, int kind, String searchString);
+ /** Returns a search operation using an expression. */
public native IMAPSearchOperation searchOperation(String folder, IMAPSearchExpression expression);
+ /** Returns an IDLE operation (wait for a new message). */
public native IMAPIdleOperation idleOperation(String folder, long lastKnownUID);
+ /** Returns an operation to fetch the namespace. */
public native IMAPFetchNamespaceOperation fetchNamespaceOperation();
+ /** Returns an operation to send to the server the identity of the client and to get the identity of
+ the server. */
public native IMAPIdentityOperation identityOperation(IMAPIdentity identity);
+ /** Returns an operation to connect to the server. */
public native IMAPOperation connectOperation();
+ /** Returns an operation to check whether the credentials of the account are correct. */
public native IMAPOperation checkAccountOperation();
+ /** Returns an operation to disconnect from the server. */
public native IMAPOperation disconnectOperation();
+ /** Returns an operation to fetch the capabilities. */
public native IMAPCapabilityOperation capabilityOperation();
+ /** Returns an operation to fetch the quota information. */
public native IMAPQuotaOperation quotaOperation();
+ /** Returns an IMAP NOOP operation. */
public native IMAPOperation noopOperation();
+ /** Returns an operation to render a message as HTML. */
public native IMAPMessageRenderingOperation htmlRenderingOperation(IMAPMessage message, String folder);
+ /** Returns an operation to render the body of a message as HTML. */
public native IMAPMessageRenderingOperation htmlBodyRenderingOperation(IMAPMessage message, String folder);
+ /** Returns an operation to render a message as text. */
public native IMAPMessageRenderingOperation plainTextRenderingOperation(IMAPMessage message, String folder);
+ /** Returns an operation to render the body of a message as text. */
public native IMAPMessageRenderingOperation plainTextBodyRenderingOperation(IMAPMessage message, String folder, boolean stripWhitespace);
private native void setupNative();
diff --git a/src/java/com/libmailcore/IMAPStoreFlagsRequestKind.java b/src/java/com/libmailcore/IMAPStoreFlagsRequestKind.java
index dd0a2b81..6e826004 100644
--- a/src/java/com/libmailcore/IMAPStoreFlagsRequestKind.java
+++ b/src/java/com/libmailcore/IMAPStoreFlagsRequestKind.java
@@ -1,5 +1,7 @@
package com.libmailcore;
+/** Store request kind.
+ @see com.libmailcore.IMAPSession#storeFlagsByUIDOperation(String folder, IndexSet uids, int kind, int flags) */
public class IMAPStoreFlagsRequestKind {
public final static int IMAPStoreFlagsRequestKindAdd = 0;
public final static int IMAPStoreFlagsRequestKindRemove = 1;
diff --git a/src/java/com/libmailcore/IndexSet.java b/src/java/com/libmailcore/IndexSet.java
index 78e9a84f..76506bca 100644
--- a/src/java/com/libmailcore/IndexSet.java
+++ b/src/java/com/libmailcore/IndexSet.java
@@ -2,30 +2,49 @@ package com.libmailcore;
import java.util.List;
+/** Unordered set of indexes. */
public class IndexSet extends NativeObject {
+ /** Constructor. */
public IndexSet() {
setupNative();
}
+ /** Returns an empty set of indexes. */
public static native IndexSet indexSet();
+ /** Returns a set of indexes with a range. */
public static native IndexSet indexSetWithRange(Range range);
+ /** Returns a set of indexes with a single value. */
public static native IndexSet indexSetWithIndex(long idx);
+ /** Returns the number of indexes. */
public native int count();
+ /** Adds an index. */
public native void addIndex(long idx);
+ /** Removes an index. */
public native void removeIndex(long idx);
+ /** Returns whether the set of indexes holds the given value. */
public native boolean containsIndex(long idx);
+ /** Adds a range of values. */
public native void addRange(Range range);
+ /** Remove a range of values. */
public native void removeRange(Range range);
+ /** Intersects with the given range. The set is modified to contains only indexes that
+ are part of the given range. */
public native void intersectsRange(Range range);
+ /** Adds indexes of the given set of indexes. */
public native void addIndexSet(IndexSet indexSet);
+ /** Removes indexes of the given set. */
public native void removeIndexSet(IndexSet indexSet);
+ /** Intersects with the given set of indexes. */
public native void intersectsIndexSet(IndexSet indexSet);
+ /** Returns all the ranges that the set contains. */
public native List<Range> allRanges();
+ /** Returns the number of ranges that the set contains. */
public native int rangesCount();
+ /** Empties the set. */
public native void removeAllIndexes();
private native void setupNative();
diff --git a/src/java/com/libmailcore/Log.java b/src/java/com/libmailcore/Log.java
index 5d202242..ceace7f7 100644
--- a/src/java/com/libmailcore/Log.java
+++ b/src/java/com/libmailcore/Log.java
@@ -1,6 +1,9 @@
package com.libmailcore;
+/** Logging. */
public class Log {
+ /** Set whether debug logs are enabled. */
static public native void setEnabled(boolean enabled);
+ /** Returns whether debug logs are enabled. */
static public native boolean isEnabled();
}
diff --git a/src/java/com/libmailcore/MailException.java b/src/java/com/libmailcore/MailException.java
index a101b3e3..0dd97967 100644
--- a/src/java/com/libmailcore/MailException.java
+++ b/src/java/com/libmailcore/MailException.java
@@ -1,17 +1,23 @@
package com.libmailcore;
public class MailException extends Exception {
+ /**
+ Error code.
+ @see com.libmailcore.ErrorCode
+ */
public int errorCode()
{
return errorCode;
}
+ /** Constructor of an exception with the given code and message. */
public MailException(String message, int anErrorCode)
{
super(message);
errorCode = anErrorCode;
}
+ /** Constructor of an exception with the given code. It will generate a message based on the code. */
public MailException(int anErrorCode)
{
super(messageForErrorCode(anErrorCode));
diff --git a/src/java/com/libmailcore/MainThreadUtils.java b/src/java/com/libmailcore/MainThreadUtils.java
index 00a9ead2..97327d7a 100644
--- a/src/java/com/libmailcore/MainThreadUtils.java
+++ b/src/java/com/libmailcore/MainThreadUtils.java
@@ -5,12 +5,12 @@ import android.os.Looper;
import android.util.Log;
import java.util.HashMap;
-public class MainThreadUtils {
+class MainThreadUtils {
private static volatile MainThreadUtils instance = new MainThreadUtils();
private Handler handler;
private HashMap<Long, Runnable> runnablesForIdentifiers = new HashMap<Long, Runnable>();
- static public MainThreadUtils singleton() {
+ static MainThreadUtils singleton() {
return instance;
}
diff --git a/src/java/com/libmailcore/MessageBuilder.java b/src/java/com/libmailcore/MessageBuilder.java
index 66539fc7..3ea586e7 100644
--- a/src/java/com/libmailcore/MessageBuilder.java
+++ b/src/java/com/libmailcore/MessageBuilder.java
@@ -2,39 +2,66 @@ package com.libmailcore;
import java.util.List;
+/** RFC 822 Message builder. */
public class MessageBuilder extends AbstractMessage {
+ /** Constructor. */
public MessageBuilder()
{
setupNative();
}
+ /** Sets HTML body. */
public native void setHTMLBody(String htmlBody);
+ /** Returns HTML body. */
public native String htmlBody();
+ /** Sets plain/text body. */
public native void setTextBody(String textBody);
+ /** Returns plain/text body. */
public native String textBody();
+ /** Sets the list of attachments. */
public native void setAttachments(List<Attachment> attachments);
+ /** Returns the list of attachments. */
public native List<AbstractPart> attachments();
+ /** Adds an attachment. */
public native void addAttachment(Attachment attachment);
+ /** Sets the list of related attachments (for example, images included in the HTML body). */
public native void setRelatedAttachments(List<Attachment> attachments);
+ /** Returns the list of related attachments. */
public native List<Attachment> relatedAttachments();
+ /** Adds a related attachment. */
public native void addRelatedAttachment(Attachment attachment);
+ /** Set the prefix to use when generating the boundary separator. */
public native void setBoundaryPrefix(String boundaryPrefix);
+ /** Returns the prefix to use when generating the boundary separator. */
public native String boundaryPrefix();
+ /** Returns RFC 822 data. */
public native byte[] data();
+ /** Returns RFC 822 data that can be used safely for encryption/signature. */
public native byte[] dataForEncryption();
+ /** Renders the message to HTML. */
public native String htmlRendering(HTMLRendererTemplateCallback callback);
+ /** Renders the body to HTML. */
public native String htmlBodyRendering();
+ /** Renders the message to plain text. */
public native String plainTextRendering();
+ /** Render the body to plain text. If stripWhitespace is true, all end of line and extra blank
+ space will be removed. */
public native String plainTextBodyRendering(boolean stripWhitespace);
+ /** Returns the RFC 822 message signed using PGP given the signature. The signature
+ needs to be computed using an external component. It will make to sure generate
+ the message format to conform to OpenPGP standard. */
public native byte[] openPGPSignedMessageDataWithSignatureData(byte[] signature);
+ /** Returns the RFC 822 message encrypted using PGP given the encrypted data. The encrypted data
+ needs to be computed using an external component. It will make to sure generate
+ the message format to conform to OpenPGP standard. */
public native byte[] openPGPEncryptedMessageDataWithEncryptedData(byte[] encryptedData);
private native void setupNative();
diff --git a/src/java/com/libmailcore/MessageFlag.java b/src/java/com/libmailcore/MessageFlag.java
index 22c2ffc0..c06f1a76 100644
--- a/src/java/com/libmailcore/MessageFlag.java
+++ b/src/java/com/libmailcore/MessageFlag.java
@@ -1,17 +1,19 @@
package com.libmailcore;
+/** Flags of a message.
+ @see com.libmailcore.IMAPMessage#flags() */
public class MessageFlag {
- final public static int MessageFlagNone = 0;
- final public static int MessageFlagSeen = 1 << 0;
- final public static int MessageFlagAnswered = 1 << 1;
- final public static int MessageFlagFlagged = 1 << 2;
- final public static int MessageFlagDeleted = 1 << 3;
- final public static int MessageFlagDraft = 1 << 4;
- final public static int MessageFlagMDNSent = 1 << 5;
- final public static int MessageFlagForwarded = 1 << 6;
- final public static int MessageFlagSubmitPending = 1 << 7;
- final public static int MessageFlagSubmitted = 1 << 8;
- final public static int MessageFlagMaskAll = MessageFlagSeen | MessageFlagAnswered | MessageFlagFlagged |
+ final public static int MessageFlagNone = 0;
+ final public static int MessageFlagSeen = 1 << 0;
+ final public static int MessageFlagAnswered = 1 << 1;
+ final public static int MessageFlagFlagged = 1 << 2;
+ final public static int MessageFlagDeleted = 1 << 3;
+ final public static int MessageFlagDraft = 1 << 4;
+ final public static int MessageFlagMDNSent = 1 << 5;
+ final public static int MessageFlagForwarded = 1 << 6;
+ final public static int MessageFlagSubmitPending = 1 << 7;
+ final public static int MessageFlagSubmitted = 1 << 8;
+ final public static int MessageFlagMaskAll = MessageFlagSeen | MessageFlagAnswered | MessageFlagFlagged |
MessageFlagDeleted | MessageFlagDraft | MessageFlagMDNSent | MessageFlagForwarded |
- MessageFlagSubmitPending | MessageFlagSubmitted;
+ MessageFlagSubmitPending | MessageFlagSubmitted;
}
diff --git a/src/java/com/libmailcore/MessageHeader.java b/src/java/com/libmailcore/MessageHeader.java
index 89f44694..5498ecf3 100644
--- a/src/java/com/libmailcore/MessageHeader.java
+++ b/src/java/com/libmailcore/MessageHeader.java
@@ -3,69 +3,109 @@ package com.libmailcore;
import java.util.List;
import java.util.Date;
+/** Message header. */
public class MessageHeader extends NativeObject {
+ /** Constuctor. */
public MessageHeader() {
setupNative();
}
+ /** The constructor will parse the data encoded using RFC 822 and initializes
+ the content using those data. */
public MessageHeader(byte[] headersData) {
setupNative();
importHeadersData(headersData);
}
+ /** Returns the Message-ID. */
public native String messageID();
+ /** Sets the Message-ID. */
public native void setMessageID(String messageID);
+ /** Returns whether the Message-ID has been generated. */
public native boolean isMessageIDAutoGenerated();
+ /** Returns the References. */
public native List<String> references();
+ /** Sets the References. */
public native void setReferences(List<String> references);
+ /** Returns In-Reply-To. */
public native List<String> inReplyTo();
+ /** Sets In-Reply-To. */
public native void setInReplyTo(List<String> inReplyTo);
+ /** Returns Date. */
public native Date date();
+ /** Sets Date. */
public native void setDate(Date date);
+ /** Sets the received date (it's not part of the RFC 822 headers). */
public native Date receivedDate();
+ /** Returns the received date (it's not part of the RFC 822 headers). */
public native void setReceivedDate(Date date);
+ /** Returns Sender. */
public native Address sender();
+ /** Set Sender. */
public native void setSender(Address sender);
+ /** Return From. */
public native Address from();
+ /** Sets From. */
public native void setFrom(Address from);
+ /** Returns To. */
public native List<Address> to();
+ /** Sets To. */
public native void setTo(List<Address> to);
+ /** Returns Cc. */
public native List<Address> cc();
+ /** Sets Cc. */
public native void setCc(List<Address> cc);
+ /** Returns Bcc. */
public native List<Address> bcc();
+ /** Sets Bcc. */
public native void setBcc(List<Address> bcc);
+ /** Returns Reply-To. */
public native List<Address> replyTo();
+ /** Sets Reply-To. */
public native void setReplyTo(List<Address> replyTo);
+ /** Returns Subject. */
public native String subject();
+ /** Sets Subject. */
public native void setSubject(String subject);
+ /** Returns X-Mailer. */
public native String userAgent();
+ /** Sets X-Mailer. */
public native void setUserAgent(String userAgent);
+ /** Sets a custom header value. */
public native void setExtraHeader(String name, String value);
+ /** Remove a custom header. */
public native void removeExtraHeader(String name);
+ /** Returns the value of a custom header. */
public native String extraHeaderValueForName(String name);
+ /** Returns all the names of the custom headers. */
public native List<String> allExtraHeadersNames();
+ /** Returns the extracted subject (removing all the Re:, Fwd:, etc). Also removes brackets. */
public native String extractedSubject();
+ /** Returns extracted subject but do not remove brackets. */
public native String partialExtractedSubject();
+ /** Parsed the given data in RFC 822 format and sets the headers. */
public native void importHeadersData(byte[] data);
+ /** Generates a header that could be used for a reply message. */
public native MessageHeader replyHeader(boolean replyAll, List<Address> excludedRecipients);
+ /** Generates a header that could be used as a base for a forwarded message. */
public native MessageHeader forwardHeader();
private native void setupNative();
diff --git a/src/java/com/libmailcore/MessageParser.java b/src/java/com/libmailcore/MessageParser.java
index 2586a6d9..650e089a 100644
--- a/src/java/com/libmailcore/MessageParser.java
+++ b/src/java/com/libmailcore/MessageParser.java
@@ -1,19 +1,28 @@
package com.libmailcore;
+/** RFC 822 message parser. */
public class MessageParser extends AbstractMessage {
+ /** Returns a MessageParser that parses the given RFC 822 message data. */
public static native MessageParser messageParserWithData(byte[] messageData);
+ /** Returns a MessageParser that parses the given file containing RFC 822 message data. */
public static native MessageParser messageParserWithContentsOfFile(String filename);
+ /** Returns the main part of the message. */
public native AbstractPart mainPart();
+ /** Returns the data of the message. */
public native byte[] data();
+ /** Renders the message as HTML. */
public native String htmlRendering(HTMLRendererTemplateCallback callback);
public String htmlRendering()
{
return htmlRendering(null);
}
+ /** Renders the body of the message as HTML. */
public native String htmlBodyRendering();
+ /** Renders the message as plain text. */
public native String plainTextRendering();
+ /** Renders the body of the message as plain text. */
public native String plainTextBodyRendering(boolean stripWhitespace);
private native void setupNative(byte[] messageData);
diff --git a/src/java/com/libmailcore/MessagePart.java b/src/java/com/libmailcore/MessagePart.java
index 533134e7..e9605292 100644
--- a/src/java/com/libmailcore/MessagePart.java
+++ b/src/java/com/libmailcore/MessagePart.java
@@ -1,4 +1,5 @@
package com.libmailcore;
+/** Parsed embedded message part. */
public class MessagePart extends AbstractMessagePart {
}
diff --git a/src/java/com/libmailcore/Multipart.java b/src/java/com/libmailcore/Multipart.java
index 5251d1b2..d348b303 100644
--- a/src/java/com/libmailcore/Multipart.java
+++ b/src/java/com/libmailcore/Multipart.java
@@ -1,4 +1,5 @@
package com.libmailcore;
+/** Parsed multipart. */
public class Multipart extends AbstractMultipart {
}
diff --git a/src/java/com/libmailcore/NNTPFetchAllArticlesOperation.java b/src/java/com/libmailcore/NNTPFetchAllArticlesOperation.java
index 697af5bb..abc37ad2 100644
--- a/src/java/com/libmailcore/NNTPFetchAllArticlesOperation.java
+++ b/src/java/com/libmailcore/NNTPFetchAllArticlesOperation.java
@@ -1,5 +1,7 @@
package com.libmailcore;
+/** Operation to fetch all numbers of all the articles of a newsgroup. */
public class NNTPFetchAllArticlesOperation extends NNTPOperation {
+ /** numbers of all the articles. */
public native IndexSet articles();
}
diff --git a/src/java/com/libmailcore/NNTPFetchArticleOperation.java b/src/java/com/libmailcore/NNTPFetchArticleOperation.java
index 56f147db..2f60e38b 100644
--- a/src/java/com/libmailcore/NNTPFetchArticleOperation.java
+++ b/src/java/com/libmailcore/NNTPFetchArticleOperation.java
@@ -1,5 +1,7 @@
package com.libmailcore;
+/** Operation to fetch the content of a given article. */
public class NNTPFetchArticleOperation extends NNTPOperation {
+ /** Content of the article in RFC 822 format. */
public native byte[] data();
}
diff --git a/src/java/com/libmailcore/NNTPFetchHeaderOperation.java b/src/java/com/libmailcore/NNTPFetchHeaderOperation.java
index f0c40f31..a05f6a30 100644
--- a/src/java/com/libmailcore/NNTPFetchHeaderOperation.java
+++ b/src/java/com/libmailcore/NNTPFetchHeaderOperation.java
@@ -1,5 +1,7 @@
package com.libmailcore;
+/** Operation to fetch header of a given article. */
public class NNTPFetchHeaderOperation extends NNTPOperation {
+ /** Parsed header of the article. */
public native MessageHeader header();
}
diff --git a/src/java/com/libmailcore/NNTPFetchOverviewOperation.java b/src/java/com/libmailcore/NNTPFetchOverviewOperation.java
index 2707723e..4abe85b8 100644
--- a/src/java/com/libmailcore/NNTPFetchOverviewOperation.java
+++ b/src/java/com/libmailcore/NNTPFetchOverviewOperation.java
@@ -2,6 +2,7 @@ package com.libmailcore;
import java.util.List;
+/** Operation to fetch list of summary headers of a set of articles of a newsgroup. */
public class NNTPFetchOverviewOperation extends NNTPOperation {
public native List<MessageHeader> articles();
}
diff --git a/src/java/com/libmailcore/NNTPFetchServerTimeOperation.java b/src/java/com/libmailcore/NNTPFetchServerTimeOperation.java
index 72fd5b85..41af4152 100644
--- a/src/java/com/libmailcore/NNTPFetchServerTimeOperation.java
+++ b/src/java/com/libmailcore/NNTPFetchServerTimeOperation.java
@@ -2,6 +2,7 @@ package com.libmailcore;
import java.util.Date;
+/** Operation to fetch the server time. */
public class NNTPFetchServerTimeOperation extends NNTPOperation {
public native Date time();
}
diff --git a/src/java/com/libmailcore/NNTPGroupInfo.java b/src/java/com/libmailcore/NNTPGroupInfo.java
index f5bbfccb..b7bb1dba 100644
--- a/src/java/com/libmailcore/NNTPGroupInfo.java
+++ b/src/java/com/libmailcore/NNTPGroupInfo.java
@@ -1,15 +1,21 @@
package com.libmailcore;
+/** Newsgroup infos. */
public class NNTPGroupInfo extends NativeObject {
+ /** Constructor. */
public NNTPGroupInfo()
{
setupNative();
}
+ /** Sets the name of the newsgroup. */
public native void setName(String name);
+ /** Returns the name of the newsgroup. */
public native String name();
+ /** Sets the number of messages in the newsgroup. */
public native void setMessageCount(long count);
+ /** Returns the number of messages in the newsgroup. */
public native long messageCount();
private native void setupNative();
diff --git a/src/java/com/libmailcore/NNTPListNewsgroupsOperation.java b/src/java/com/libmailcore/NNTPListNewsgroupsOperation.java
index f5bf4b97..ae21ba12 100644
--- a/src/java/com/libmailcore/NNTPListNewsgroupsOperation.java
+++ b/src/java/com/libmailcore/NNTPListNewsgroupsOperation.java
@@ -2,6 +2,7 @@ package com.libmailcore;
import java.util.List;
+/** Operation to list newsgroups. */
public class NNTPListNewsgroupsOperation extends NNTPOperation {
public native List<NNTPGroupInfo> groups();
}
diff --git a/src/java/com/libmailcore/NNTPOperation.java b/src/java/com/libmailcore/NNTPOperation.java
index 5787e03a..9c6a07aa 100644
--- a/src/java/com/libmailcore/NNTPOperation.java
+++ b/src/java/com/libmailcore/NNTPOperation.java
@@ -1,6 +1,11 @@
package com.libmailcore;
+/** NNTP Operation. */
public class NNTPOperation extends Operation {
+ /**
+ Returns error once the operation finished running. It will return null if the operation
+ successfully ran.
+ */
public MailException exception() {
if (errorCode() == ErrorCode.ErrorNone) {
return null;
@@ -10,6 +15,11 @@ public class NNTPOperation extends Operation {
private native int errorCode();
+ /**
+ Calls the method succeeded() of the callback if the operation succeeded or failed()
+ if the operation failed.
+ @see com.libmailcore.OperationCallback
+ */
protected void callCallback()
{
if (callback != null) {
diff --git a/src/java/com/libmailcore/NNTPSession.java b/src/java/com/libmailcore/NNTPSession.java
index eb7d3d2e..325a6b5a 100644
--- a/src/java/com/libmailcore/NNTPSession.java
+++ b/src/java/com/libmailcore/NNTPSession.java
@@ -12,61 +12,97 @@ public class NNTPSession extends NativeObject {
super.finalize();
}
+ /** Sets the NNTP server hostname. */
public native void setHostname(String hostname);
+ /** Returns the NNTP server hostname. */
public native String hostname();
+ /** Sets the port. */
public native void setPort(int port);
+ /** Returns the port. */
public native int port();
+ /** Sets the username. */
public native void setUsername(String username);
+ /** Returns the username. */
public native String username();
+ /** Sets the password. */
public native void setPassword(String password);
+ /** Returns the password. */
public native String password();
+ /**
+ Set connection type (clear-text, SSL or STARTTLS).
+ @see com.libmailcore.ConnectionType
+ */
public native void setConnectionType(int connectionType);
+ /**
+ Returns connection type (clear-text, SSL or STARTTLS).
+ @see com.libmailcore.ConnectionType
+ */
public native int connectionType();
+ /** Sets network timeout in seconds. */
public native void setTimeout(long seconds);
+ /** Returns network timeout in seconds. */
public native long timeout();
+ /** Sets whether the certificate of the server should be checked. */
public native void setCheckCertificateEnabled(boolean enabled);
+ /** Returns whether the certificate of the server should be checked. */
public native boolean isCheckCertificateEnabled();
+ /** Sets the connection logger. */
public void setConnectionLogger(ConnectionLogger logger)
{
connectionLogger = logger;
setupNativeConnectionLogger();
}
+ /** Returns the connection logger. */
public ConnectionLogger connectionLogger()
{
return connectionLogger;
}
+ /** Sets the IMAP operations queue listener. */
public void setOperationQueueListener(OperationQueueListener listener)
{
operationQueueListener = listener;
setupNativeOperationQueueListener();
}
+ /** Returns the IMAP operations queue listener. */
public OperationQueueListener operationQueueListener()
{
return operationQueueListener;
}
+ /** Returns whether the operation queue is running. */
public native boolean isOperationQueueRunning();
+ /** Cancels all queued operations. */
public native void cancelAllOperations();
+ /** Returns an operation to fetch the list of numbers of all articles of a newsgroup. */
public native NNTPFetchAllArticlesOperation fetchAllArticlesOperation(String group);
+ /** Returns an operation to fetch the headers of a given article. */
public native NNTPFetchHeaderOperation fetchHeaderOperation(String group, int idx);
+ /** Returns an operation to fetch the content of a given article. */
public native NNTPFetchArticleOperation fetchArticleOperation(String group, int idx);
+ /** Returns an operation to fetch the content of a given articl using the Message-ID. */
public native NNTPFetchArticleOperation fetchArticleByMessageIDOperation(String group, String messageID);
+ /** Returns an operation to fetch the summary headers of set of articles of a newsgroup. */
public native NNTPFetchOverviewOperation fetchOverviewOperationWithIndexes(String group, IndexSet indexes);
+ /** Returns an operation to fetch the server date. */
public native NNTPFetchServerTimeOperation fetchServerDateOperation();
+ /** Returns an operation to fetch the list of all newsgroups. */
public native NNTPListNewsgroupsOperation listAllNewsgroupsOperation();
+ /** Returns an operation to fetch the ist of default newsgroups. */
public native NNTPListNewsgroupsOperation listDefaultNewsgroupsOperation();
+ /** Returns an operation to disconnect. */
public native NNTPOperation disconnectOperation();
+ /** Returns an operation to check credentials. */
public native NNTPOperation checkAccountOperation();
private native void setupNative();
diff --git a/src/java/com/libmailcore/NativeObject.java b/src/java/com/libmailcore/NativeObject.java
index a1923056..9e92cbd7 100644
--- a/src/java/com/libmailcore/NativeObject.java
+++ b/src/java/com/libmailcore/NativeObject.java
@@ -4,6 +4,7 @@ import java.util.Map;
import java.io.Serializable;
import java.io.IOException;
+/** Native C++ Object wrapper. */
public class NativeObject implements Cloneable, Serializable {
protected void finalize() throws Throwable
{
@@ -13,7 +14,9 @@ public class NativeObject implements Cloneable, Serializable {
protected native void initWithNative(long nativeHandle);
private native void unsetupNative();
+ /** Returns a string representing the object. */
public native String toString();
+ /** Create a copy of the object. */
public native Object clone() throws CloneNotSupportedException;
private long nativeHandle;
diff --git a/src/java/com/libmailcore/Operation.java b/src/java/com/libmailcore/Operation.java
index 9ea4c35d..587a139e 100644
--- a/src/java/com/libmailcore/Operation.java
+++ b/src/java/com/libmailcore/Operation.java
@@ -1,9 +1,13 @@
package com.libmailcore;
public class Operation extends NativeObject {
+ /** Cancel the operation. */
public native void cancel();
+ /** Returns whether the operation has been cancelled. */
public native boolean isCancelled();
+ /** Starts the operation. Calls the aCallback.succeeded() when the operation is finished.
+ @see com.libmailcore.OperationCallback#succeeded() */
public void start(OperationCallback aCallback)
{
callback = aCallback;
diff --git a/src/java/com/libmailcore/OperationCallback.java b/src/java/com/libmailcore/OperationCallback.java
index 3b70e5c5..0843513c 100644
--- a/src/java/com/libmailcore/OperationCallback.java
+++ b/src/java/com/libmailcore/OperationCallback.java
@@ -1,6 +1,9 @@
package com.libmailcore;
+/** Callbacks of an operation. */
public interface OperationCallback {
+ /** Called when the operation succeeded. */
void succeeded();
+ /** Called when the operation failed. */
void failed(MailException exception);
}
diff --git a/src/java/com/libmailcore/OperationQueueListener.java b/src/java/com/libmailcore/OperationQueueListener.java
index 1e939952..a23e1963 100644
--- a/src/java/com/libmailcore/OperationQueueListener.java
+++ b/src/java/com/libmailcore/OperationQueueListener.java
@@ -1,7 +1,10 @@
package com.libmailcore;
+/** Listener of the queue of operations. */
public interface OperationQueueListener {
+ /** Called when an operation has just been added and operations start running. */
void queueStartRunning();
+ /** Called when all operations have ben run. */
void queueStoppedRunning();
}
diff --git a/src/java/com/libmailcore/POPFetchHeaderOperation.java b/src/java/com/libmailcore/POPFetchHeaderOperation.java
index 4750ca8e..d43ba1d4 100644
--- a/src/java/com/libmailcore/POPFetchHeaderOperation.java
+++ b/src/java/com/libmailcore/POPFetchHeaderOperation.java
@@ -1,5 +1,7 @@
package com.libmailcore;
+/** Operation to fetch the header of a message. */
public class POPFetchHeaderOperation extends POPOperation {
+ /** Parsed header of the message. */
public native MessageHeader header();
}
diff --git a/src/java/com/libmailcore/POPFetchMessageOperation.java b/src/java/com/libmailcore/POPFetchMessageOperation.java
index f0bbed6b..b1a39814 100644
--- a/src/java/com/libmailcore/POPFetchMessageOperation.java
+++ b/src/java/com/libmailcore/POPFetchMessageOperation.java
@@ -1,5 +1,7 @@
package com.libmailcore;
+/** Operation to fetch a message. */
public class POPFetchMessageOperation extends POPOperation {
+ /** Content of the message in RFC 822 format. */
public native byte[] data();
}
diff --git a/src/java/com/libmailcore/POPFetchMessagesOperation.java b/src/java/com/libmailcore/POPFetchMessagesOperation.java
index 4844db24..c120d233 100644
--- a/src/java/com/libmailcore/POPFetchMessagesOperation.java
+++ b/src/java/com/libmailcore/POPFetchMessagesOperation.java
@@ -2,6 +2,7 @@ package com.libmailcore;
import java.util.List;
+/** Operation to fetch the list of messages. */
public class POPFetchMessagesOperation extends POPOperation {
public native List<POPMessageInfo> messages();
}
diff --git a/src/java/com/libmailcore/POPMessageInfo.java b/src/java/com/libmailcore/POPMessageInfo.java
index cbb2aa31..70230fe7 100644
--- a/src/java/com/libmailcore/POPMessageInfo.java
+++ b/src/java/com/libmailcore/POPMessageInfo.java
@@ -1,18 +1,26 @@
package com.libmailcore;
+/** Info about a message. */
public class POPMessageInfo extends NativeObject {
+ /** Constructor. */
public POPMessageInfo()
{
setupNative();
}
+ /** Sets the index of the message. */
public native void setIndex(int index);
+ /** Returns the index of the message, valid during the POP session. */
public native int index();
+ /** Sets the size of the message. */
public native void setSize(long size);
+ /** Returns the size of the message. */
public native long size();
+ /** Sets the unique identifier of the message. */
public native void setUid(String uid);
+ /** Returns the unique identifier of the message. */
public native String uid();
private native void setupNative();
diff --git a/src/java/com/libmailcore/POPOperation.java b/src/java/com/libmailcore/POPOperation.java
index e349a0c8..dd618703 100644
--- a/src/java/com/libmailcore/POPOperation.java
+++ b/src/java/com/libmailcore/POPOperation.java
@@ -1,6 +1,11 @@
package com.libmailcore;
+/** POP Operation. */
public class POPOperation extends Operation {
+ /**
+ Returns error once the operation finished running. It will return null if the operation
+ successfully ran.
+ */
public MailException exception() {
if (errorCode() == ErrorCode.ErrorNone) {
return null;
@@ -10,6 +15,11 @@ public class POPOperation extends Operation {
private native int errorCode();
+ /**
+ Calls the method succeeded() of the callback if the operation succeeded or failed()
+ if the operation failed.
+ @see com.libmailcore.OperationCallback
+ */
protected void callCallback()
{
if (callback != null) {
diff --git a/src/java/com/libmailcore/POPSession.java b/src/java/com/libmailcore/POPSession.java
index b18c25e2..16e5a531 100644
--- a/src/java/com/libmailcore/POPSession.java
+++ b/src/java/com/libmailcore/POPSession.java
@@ -12,61 +12,102 @@ public class POPSession extends NativeObject {
super.finalize();
}
+ /** Sets the POP server hostname. */
public native void setHostname(String hostname);
+ /** Returns the POP server hostname. */
public native String hostname();
+ /** Sets the port. */
public native void setPort(int port);
+ /** Returns the port. */
public native int port();
+ /** Sets the username. */
public native void setUsername(String username);
+ /** Returns the username. */
public native String username();
+ /** Sets the password. */
public native void setPassword(String password);
+ /** Returns the password. */
public native String password();
+ /**
+ Sets the authentication type.
+ @see com.libmailcore.AuthType
+ */
public native void setAuthType(int authType);
+ /**
+ Returns authentication type.
+ @see com.libmailcore.AuthType
+ */
public native int authType();
+ /**
+ Set connection type (clear-text, SSL or STARTTLS).
+ @see com.libmailcore.ConnectionType
+ */
public native void setConnectionType(int connectionType);
+ /**
+ Returns connection type (clear-text, SSL or STARTTLS).
+ @see com.libmailcore.ConnectionType
+ */
public native int connectionType();
+ /** Sets network timeout in seconds. */
public native void setTimeout(long seconds);
+ /** Returns network timeout in seconds. */
public native long timeout();
+ /** Sets whether the certificate of the server should be checked. */
public native void setCheckCertificateEnabled(boolean enabled);
+ /** Returns whether the certificate of the server should be checked. */
public native boolean isCheckCertificateEnabled();
+ /** Sets the connection logger. */
public void setConnectionLogger(ConnectionLogger logger)
{
connectionLogger = logger;
setupNativeConnectionLogger();
}
+ /** Returns the connection logger. */
public ConnectionLogger connectionLogger()
{
return connectionLogger;
}
+ /** Sets the IMAP operations queue listener. */
public void setOperationQueueListener(OperationQueueListener listener)
{
operationQueueListener = listener;
setupNativeOperationQueueListener();
}
+ /** Returns the IMAP operations queue listener. */
public OperationQueueListener operationQueueListener()
{
return operationQueueListener;
}
+ /** Returns whether the operation queue is running. */
public native boolean isOperationQueueRunning();
+ /** Cancels all queued operations. */
public native void cancelAllOperations();
+ /** Returns an operation to fetch the list of messages. */
public native POPFetchMessagesOperation fetchMessagesOperation();
+ /** Returns an operation to fetch headers of a given message. */
public native POPFetchHeaderOperation fetchHeaderOperation(int index);
+ /** Returns an operation to fetch the content of a given message. */
public native POPFetchMessageOperation fetchMessageOperation(int index);
+ /** Returns an operation to delete messages. */
public native POPOperation deleteMessagesOperation(IndexSet indexes);
+ /** Returns an operation to disconnect. */
public native POPOperation disconnectOperation();
+ /** Returns an operation to check credentials. */
public native POPOperation checkAccountOperation();
+ /** Returns a POP NOOP operation. */
public native POPOperation noopOperation();
private native void setupNative();
diff --git a/src/java/com/libmailcore/PartType.java b/src/java/com/libmailcore/PartType.java
index b9ce8fcc..3486551f 100644
--- a/src/java/com/libmailcore/PartType.java
+++ b/src/java/com/libmailcore/PartType.java
@@ -1,5 +1,7 @@
package com.libmailcore;
+/** MIME Part type.
+ @see com.libmailcore.AbstractPart#partType() */
public class PartType {
public final static int PartTypeSingle = 0;
public final static int PartTypeMessage = 1;
diff --git a/src/java/com/libmailcore/Range.java b/src/java/com/libmailcore/Range.java
index d81e9fbc..3e508f9b 100644
--- a/src/java/com/libmailcore/Range.java
+++ b/src/java/com/libmailcore/Range.java
@@ -1,26 +1,40 @@
package com.libmailcore;
+/** Range of integer values. */
public class Range {
+ /** Location. */
public long location;
+ /** Length of the range. A length of 0 is a range with only one item: the location. */
public long length;
+ /** When using RangeMax as the length of the range, it means that the range is infinite. */
static public long RangeMax = 1 >> 63 - 1;
+ /** Constructor for a range starting at 0 and of length 0. */
public Range() {}
+ /** Constructor */
public Range(long aLocation, long aLength)
{
location = aLocation;
length = aLength;
}
+ /** Subtract otherRange from this range and returns the resulting set of indexes. */
public native IndexSet removeRange(Range otherRange);
+ /** Union of otherRange and this range and returns the resulting set of indexes. */
public native IndexSet union(Range otherRange);
+ /** Returns the range resulting from the intersection. */
public native Range intersection(Range otherRange);
+ /** Returns whether the intersection is non-empty. */
public native boolean hasIntersection(Range otherRange);
+ /** Returns the included left bound of the range. */
public native long leftBound();
+ /** Returns the included right bound of the range. */
public native long rightBound();
+ /** Returns a string representation of range. */
public native String toString();
+ /** Create a range using a string representation. */
public static native Range rangeWithString(String rangeString);
static {
diff --git a/src/java/com/libmailcore/SMTPOperation.java b/src/java/com/libmailcore/SMTPOperation.java
index 16567b5f..3eecb792 100644
--- a/src/java/com/libmailcore/SMTPOperation.java
+++ b/src/java/com/libmailcore/SMTPOperation.java
@@ -1,6 +1,10 @@
package com.libmailcore;
public class SMTPOperation extends Operation {
+ /**
+ Returns error once the operation finished running. It will return null if the operation
+ successfully ran.
+ */
public MailException exception() {
if (errorCode() == ErrorCode.ErrorNone) {
return null;
@@ -10,6 +14,11 @@ public class SMTPOperation extends Operation {
private native int errorCode();
+ /**
+ Calls the method succeeded() of the callback if the operation succeeded or failed()
+ if the operation failed.
+ @see com.libmailcore.OperationCallback
+ */
protected void callCallback()
{
if (callback != null) {
diff --git a/src/java/com/libmailcore/SMTPSession.java b/src/java/com/libmailcore/SMTPSession.java
index 7eb8afe9..62a99245 100644
--- a/src/java/com/libmailcore/SMTPSession.java
+++ b/src/java/com/libmailcore/SMTPSession.java
@@ -14,65 +14,108 @@ public class SMTPSession extends NativeObject {
super.finalize();
}
+ /** Sets the SMTP server hostname. */
public native void setHostname(String hostname);
+ /** Returns the SMTP server hostname. */
public native String hostname();
+ /** Sets the port. */
public native void setPort(int port);
+ /** Returns the port. */
public native int port();
+ /** Sets the username. */
public native void setUsername(String username);
+ /** Returns the username. */
public native String username();
+ /** Sets the password. */
public native void setPassword(String password);
+ /** Returns the password. */
public native String password();
+ /** Sets the OAuth2 token. */
public native void setOAuth2Token(String token);
+ /** Returns the OAuth2 token. */
public native String OAuth2Token();
+ /**
+ Sets the authentication type.
+ @see com.libmailcore.AuthType
+ */
public native void setAuthType(int authType);
+ /**
+ Returns authentication type.
+ @see com.libmailcore.AuthType
+ */
public native int authType();
+ /**
+ Set connection type (clear-text, SSL or STARTTLS).
+ @see com.libmailcore.ConnectionType
+ */
public native void setConnectionType(int connectionType);
+ /**
+ Returns connection type (clear-text, SSL or STARTTLS).
+ @see com.libmailcore.ConnectionType
+ */
public native int connectionType();
+ /** Sets network timeout in seconds. */
public native void setTimeout(long seconds);
+ /** Returns network timeout in seconds. */
public native long timeout();
+ /** Sets whether the certificate of the server should be checked. */
public native void setCheckCertificateEnabled(boolean enabled);
+ /** Returns whether the certificate of the server should be checked. */
public native boolean isCheckCertificateEnabled();
+ /** Sets whether it should use the IP address while using EHLO. */
public native void setUseHeloIPEnabled(boolean enabled);
+ /** Returns whether it should use the IP address while using EHLO. */
public native boolean useHeloIPEnabled();
+ /** Sets the connection logger. */
public void setConnectionLogger(ConnectionLogger logger)
{
connectionLogger = logger;
setupNativeConnectionLogger();
}
+ /** Returns the connection logger. */
public ConnectionLogger connectionLogger()
{
return connectionLogger;
}
+ /** Sets the IMAP operations queue listener. */
public void setOperationQueueListener(OperationQueueListener listener)
{
operationQueueListener = listener;
setupNativeOperationQueueListener();
}
+ /** Returns the IMAP operations queue listener. */
public OperationQueueListener operationQueueListener()
{
return operationQueueListener;
}
+ /** Returns whether the operation queue is running. */
public native boolean isOperationQueueRunning();
+ /** Cancels all queued operations. */
public native void cancelAllOperations();
+ /** Returns an operation to authenticate. */
public native SMTPOperation loginOperation();
+ /** Returns an operation to send a message. The recipient is detected in the data of the message. */
public native SMTPOperation sendMessageOperation(byte[] messageData);
+ /** Returns an operation to send a message. */
public native SMTPOperation sendMessageOperation(Address from, List<Address> recipients, byte[] messageData);
+ /** Returns an operation to check whether the credentials of the account are correct. */
public native SMTPOperation checkAccountOperation(Address from);
+ /** Returns a SMTP NOOP operation. */
public native SMTPOperation noopOperation();
private native void setupNative();
diff --git a/src/java/native/com_libmailcore_AuthType.h b/src/java/native/com_libmailcore_AuthType.h
new file mode 100644
index 00000000..23310879
--- /dev/null
+++ b/src/java/native/com_libmailcore_AuthType.h
@@ -0,0 +1,13 @@
+/* DO NOT EDIT THIS FILE - it is machine generated */
+#include <jni.h>
+/* Header for class com_libmailcore_AuthType */
+
+#ifndef _Included_com_libmailcore_AuthType
+#define _Included_com_libmailcore_AuthType
+#ifdef __cplusplus
+extern "C" {
+#endif
+#ifdef __cplusplus
+}
+#endif
+#endif
diff --git a/src/java/native/com_libmailcore_IMAPAppendMessageOperation.cpp b/src/java/native/com_libmailcore_IMAPAppendMessageOperation.cpp
index 7a99a578..16da4df2 100644
--- a/src/java/native/com_libmailcore_IMAPAppendMessageOperation.cpp
+++ b/src/java/native/com_libmailcore_IMAPAppendMessageOperation.cpp
@@ -3,6 +3,7 @@
#include "MCBaseTypes.h"
#include "JavaHandle.h"
#include "TypesUtils.h"
+#include "JavaIMAPOperationCallback.h"
#include "MCIMAPAppendMessageOperation.h"
using namespace mailcore;
@@ -36,4 +37,30 @@ JNIEXPORT jlong JNICALL Java_com_libmailcore_IMAPAppendMessageOperation_createdU
return result;
}
+JNIEXPORT void JNICALL Java_com_libmailcore_IMAPAppendMessageOperation_finalizeNative
+ (JNIEnv * env, jobject obj)
+{
+ MC_POOL_BEGIN;
+ JavaIMAPOperationCallback * callback = (JavaIMAPOperationCallback *) MC_JAVA_NATIVE_INSTANCE->imapCallback();
+ MC_SAFE_RELEASE(callback);
+ MC_JAVA_NATIVE_INSTANCE->setImapCallback(NULL);
+ MC_POOL_END;
+}
+
+JNIEXPORT void JNICALL Java_com_libmailcore_IMAPAppendMessageOperation_setupNativeOperationProgressListener
+ (JNIEnv * env, jobject obj)
+{
+ MC_POOL_BEGIN;
+ JavaIMAPOperationCallback * callback = (JavaIMAPOperationCallback *) MC_JAVA_NATIVE_INSTANCE->imapCallback();
+ MC_SAFE_RELEASE(callback);
+ MC_JAVA_NATIVE_INSTANCE->setImapCallback(NULL);
+
+ jobject javaListener = getObjectField(env, obj, "listener");
+ if (javaListener != NULL) {
+ callback = new JavaIMAPOperationCallback(env, javaListener);
+ MC_JAVA_NATIVE_INSTANCE->setImapCallback(callback);
+ }
+ MC_POOL_END;
+}
+
MC_JAVA_BRIDGE
diff --git a/src/java/native/com_libmailcore_IMAPAppendMessageOperation.h b/src/java/native/com_libmailcore_IMAPAppendMessageOperation.h
index 2f649547..44c5b3c6 100644
--- a/src/java/native/com_libmailcore_IMAPAppendMessageOperation.h
+++ b/src/java/native/com_libmailcore_IMAPAppendMessageOperation.h
@@ -33,6 +33,22 @@ JNIEXPORT jobject JNICALL Java_com_libmailcore_IMAPAppendMessageOperation_date
JNIEXPORT jlong JNICALL Java_com_libmailcore_IMAPAppendMessageOperation_createdUID
(JNIEnv *, jobject);
+/*
+ * Class: com_libmailcore_IMAPAppendMessageOperation
+ * Method: finalizeNative
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_com_libmailcore_IMAPAppendMessageOperation_finalizeNative
+ (JNIEnv *, jobject);
+
+/*
+ * Class: com_libmailcore_IMAPAppendMessageOperation
+ * Method: setupNativeOperationProgressListener
+ * Signature: ()V
+ */
+JNIEXPORT void JNICALL Java_com_libmailcore_IMAPAppendMessageOperation_setupNativeOperationProgressListener
+ (JNIEnv *, jobject);
+
#ifdef __cplusplus
}
#endif
diff --git a/src/java/native/com_libmailcore_IMAPFetchMessagesOperation.cpp b/src/java/native/com_libmailcore_IMAPFetchMessagesOperation.cpp
index b0f2fe46..ed0fae09 100644
--- a/src/java/native/com_libmailcore_IMAPFetchMessagesOperation.cpp
+++ b/src/java/native/com_libmailcore_IMAPFetchMessagesOperation.cpp
@@ -11,6 +11,8 @@ using namespace mailcore;
#define nativeType IMAPFetchMessagesOperation
#define javaType nativeType
+MC_JAVA_SYNTHESIZE(Array, setExtraHeaders, extraHeaders)
+
JNIEXPORT jobject JNICALL Java_com_libmailcore_IMAPFetchMessagesOperation_messages
(JNIEnv * env, jobject obj)
{
diff --git a/src/java/native/com_libmailcore_IMAPFetchMessagesOperation.h b/src/java/native/com_libmailcore_IMAPFetchMessagesOperation.h
index a45629a4..6bb79572 100644
--- a/src/java/native/com_libmailcore_IMAPFetchMessagesOperation.h
+++ b/src/java/native/com_libmailcore_IMAPFetchMessagesOperation.h
@@ -11,6 +11,22 @@ extern "C" {
#define com_libmailcore_IMAPFetchMessagesOperation_serialVersionUID 1LL
/*
* Class: com_libmailcore_IMAPFetchMessagesOperation
+ * Method: setExtraHeaders
+ * Signature: (Ljava/util/List;)V
+ */
+JNIEXPORT void JNICALL Java_com_libmailcore_IMAPFetchMessagesOperation_setExtraHeaders
+ (JNIEnv *, jobject, jobject);
+
+/*
+ * Class: com_libmailcore_IMAPFetchMessagesOperation
+ * Method: extraHeaders
+ * Signature: ()Ljava/util/List;
+ */
+JNIEXPORT jobject JNICALL Java_com_libmailcore_IMAPFetchMessagesOperation_extraHeaders
+ (JNIEnv *, jobject);
+
+/*
+ * Class: com_libmailcore_IMAPFetchMessagesOperation
* Method: messages
* Signature: ()Ljava/util/List;
*/
diff --git a/src/java/native/com_libmailcore_IMAPMessage.cpp b/src/java/native/com_libmailcore_IMAPMessage.cpp
index f7e3fdd9..b578b8f3 100644
--- a/src/java/native/com_libmailcore_IMAPMessage.cpp
+++ b/src/java/native/com_libmailcore_IMAPMessage.cpp
@@ -33,24 +33,6 @@ JNIEXPORT jobject JNICALL Java_com_libmailcore_IMAPMessage_partForPartID
return result;
}
-JNIEXPORT jobject JNICALL Java_com_libmailcore_IMAPMessage_partForContentID
- (JNIEnv * env, jobject obj, jstring contentID)
-{
- MC_POOL_BEGIN;
- jobject result = MC_TO_JAVA(MC_JAVA_NATIVE_INSTANCE->partForContentID(MC_FROM_JAVA(String, contentID)));
- MC_POOL_END;
- return result;
-}
-
-JNIEXPORT jobject JNICALL Java_com_libmailcore_IMAPMessage_partForUniqueID
- (JNIEnv * env, jobject obj, jstring uniqueID)
-{
- MC_POOL_BEGIN;
- jobject result = MC_TO_JAVA(MC_JAVA_NATIVE_INSTANCE->partForUniqueID(MC_FROM_JAVA(String, uniqueID)));
- MC_POOL_END;
- return result;
-}
-
JNIEXPORT jstring JNICALL Java_com_libmailcore_IMAPMessage_htmlRendering
(JNIEnv * env, jobject obj, jstring folder, jobject dataCallback, jobject htmlTemplateCallback)
{
diff --git a/src/java/native/com_libmailcore_IMAPMessage.h b/src/java/native/com_libmailcore_IMAPMessage.h
index c075e5cc..02fb3ce9 100644
--- a/src/java/native/com_libmailcore_IMAPMessage.h
+++ b/src/java/native/com_libmailcore_IMAPMessage.h
@@ -197,22 +197,6 @@ JNIEXPORT jobject JNICALL Java_com_libmailcore_IMAPMessage_partForPartID
/*
* Class: com_libmailcore_IMAPMessage
- * Method: partForContentID
- * Signature: (Ljava/lang/String;)Lcom/libmailcore/AbstractPart;
- */
-JNIEXPORT jobject JNICALL Java_com_libmailcore_IMAPMessage_partForContentID
- (JNIEnv *, jobject, jstring);
-
-/*
- * Class: com_libmailcore_IMAPMessage
- * Method: partForUniqueID
- * Signature: (Ljava/lang/String;)Lcom/libmailcore/AbstractPart;
- */
-JNIEXPORT jobject JNICALL Java_com_libmailcore_IMAPMessage_partForUniqueID
- (JNIEnv *, jobject, jstring);
-
-/*
- * Class: com_libmailcore_IMAPMessage
* Method: htmlRendering
* Signature: (Ljava/lang/String;Lcom/libmailcore/HTMLRendererIMAPCallback;Lcom/libmailcore/HTMLRendererTemplateCallback;)Ljava/lang/String;
*/
diff --git a/src/java/native/com_libmailcore_IMAPSearchExpression.h b/src/java/native/com_libmailcore_IMAPSearchExpression.h
index 88b321e4..519a023a 100644
--- a/src/java/native/com_libmailcore_IMAPSearchExpression.h
+++ b/src/java/native/com_libmailcore_IMAPSearchExpression.h
@@ -289,14 +289,6 @@ JNIEXPORT jobject JNICALL Java_com_libmailcore_IMAPSearchExpression_searchOr
JNIEXPORT jobject JNICALL Java_com_libmailcore_IMAPSearchExpression_searchNot
(JNIEnv *, jclass, jobject);
-/*
- * Class: com_libmailcore_IMAPSearchExpression
- * Method: setupNative
- * Signature: ()V
- */
-JNIEXPORT void JNICALL Java_com_libmailcore_IMAPSearchExpression_setupNative
- (JNIEnv *, jobject);
-
#ifdef __cplusplus
}
#endif
diff --git a/src/objc/abstract/MCOHTMLRendererDelegate.h b/src/objc/abstract/MCOHTMLRendererDelegate.h
index 95f55b53..eb62cb75 100644
--- a/src/objc/abstract/MCOHTMLRendererDelegate.h
+++ b/src/objc/abstract/MCOHTMLRendererDelegate.h
@@ -80,8 +80,7 @@ If not, the attachment template will be used.*/
See the content of MCHTMLRendererCallback.cpp for the default values of the template.*/
- (NSString *) MCOAbstractMessage:(MCOAbstractMessage *)msg templateForEmbeddedMessageHeader:(MCOMessageHeader *)header;
-/** This delegate method returns the separator between the text of the message and the attachments.
- This delegate method returns the template for the header of an embedded message.*/
+/** This delegate method returns the separator between the text of the message and the attachments.*/
- (NSString *) MCOAbstractMessage_templateForAttachmentSeparator:(MCOAbstractMessage *)msg;
/** This delegate method cleans HTML content.