aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/java
diff options
context:
space:
mode:
authorGravatar Hoa V. DINH <dinh.viet.hoa@gmail.com>2015-01-14 23:26:38 -0800
committerGravatar Hoa V. DINH <dinh.viet.hoa@gmail.com>2015-01-14 23:26:48 -0800
commit686d0e22b545808486cadb4d1e1a272515ecc7fd (patch)
treef2c7dc5c0349079a959f7365eda6844fd98e5e3f /src/java
parentdfd76892dbab3b7fdc8dd6e12a2f262b1445a3bc (diff)
Work in progress on javadoc
Diffstat (limited to 'src/java')
-rw-r--r--src/java/com/libmailcore/AbstractMessage.java11
-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.java34
-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/ConnectionLogType.java7
-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.java2
-rw-r--r--src/java/com/libmailcore/ErrorCode.java49
-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.java1
-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.java25
-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/MessagePart.java1
-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
43 files changed, 504 insertions, 41 deletions
diff --git a/src/java/com/libmailcore/AbstractMessage.java b/src/java/com/libmailcore/AbstractMessage.java
index 0f995193..7eb2a9af 100644
--- a/src/java/com/libmailcore/AbstractMessage.java
+++ b/src/java/com/libmailcore/AbstractMessage.java
@@ -2,13 +2,24 @@ package com.libmailcore;
import java.util.List;
+/** Abstract message. */
public class AbstractMessage extends NativeObject {
+ /** 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. */
public native AbstractPart partForContentID(String contentID);
+ /**
+ Returns the MIME part with the given uniqueID.
+ @see AbtractPart#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..61ae15d2 100644
--- a/src/java/com/libmailcore/AbstractPart.java
+++ b/src/java/com/libmailcore/AbstractPart.java
@@ -2,35 +2,69 @@ package com.libmailcore;
import java.util.AbstractList;
+/** Abstract MIME part. */
public class AbstractPart extends NativeObject {
+ /**
+ Returns the type of the part.
+ @see PartType.
+ */
public native int partType();
+ /**
+ Sets the type of the part.
+ @see 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. */
public native AbstractPart partForContentID(String contentID);
+ /**
+ Returns the MIME part with the given uniqueID.
+ @see AbtractPart#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..91077ae0 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 AbstractPart#charset()
+ */
public native String decodedString();
} \ No newline at end of file
diff --git a/src/java/com/libmailcore/ConnectionLogType.java b/src/java/com/libmailcore/ConnectionLogType.java
index 31262889..40037e5e 100644
--- a/src/java/com/libmailcore/ConnectionLogType.java
+++ b/src/java/com/libmailcore/ConnectionLogType.java
@@ -1,10 +1,17 @@
package com.libmailcore;
+/** Logs type for the connection logger. */
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..cb4973ca 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 param has one of the value of ConnectionLogType.
+ @see 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..0e1e0c6f 100644
--- a/src/java/com/libmailcore/Encoding.java
+++ b/src/java/com/libmailcore/Encoding.java
@@ -1,6 +1,8 @@
package com.libmailcore;
+/** MIME 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..16ec2b2e 100644
--- a/src/java/com/libmailcore/ErrorCode.java
+++ b/src/java/com/libmailcore/ErrorCode.java
@@ -1,46 +1,95 @@
package com.libmailcore;
+/** Error codes. */
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..cda8f610 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 <html>, <body> 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..a688f7d6 100644
--- a/src/java/com/libmailcore/IMAPCapabilityOperation.java
+++ b/src/java/com/libmailcore/IMAPCapabilityOperation.java
@@ -1,5 +1,6 @@
package com.libmailcore;
+/** Operation to fetch the capabilities of the IMAP server. */
public class IMAPCapabilityOperation extends IMAPOperation {
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..0128c4fb 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 IMAPFolderFlags
+ */
public native void setFlags(int flags);
+ /**
+ Returns the flags of the folder.
+ @see 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..3346bbc3 100644
--- a/src/java/com/libmailcore/IMAPFolderFlags.java
+++ b/src/java/com/libmailcore/IMAPFolderFlags.java
@@ -1,23 +1,48 @@
package com.libmailcore;
+/** Flags of a folder. */
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 IMAPFolderFlagAllMail
+ */
public final static int IMAPFolderFlagAll = IMAPFolderFlagAllMail;
+ /**
+ Same as IMAPFolderFlagSpam.
+ @see IMAPFolderFlagSpam
+ */
public final static int IMAPFolderFlagJunk = IMAPFolderFlagSpam;
+ /**
+ Same as IMAPFolderFlagStarred.
+ @see 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..3745eab9 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 MessageFlag
+ */
public native void setFlags(int flags);
+ /**
+ Flags of the message.
+ @see MessageFlag
+ */
public native int flags();
+ /**
+ Set original message flags.
+ @see MessageFlag
+ */
public native void setOriginalFlags(int flags);
+ /**
+ Original message flags.
+ @see 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 IMAPPart#partID()
+ @see IMAPMessagePart#partID()
+ @see 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..106933aa 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 IMAPSession#fetchMessagesByUIDOperation(String folder, int requestKind, IndexSet indexes)
+ @see IMAPSession#fetchMessagesByNumberOperation(String folder, int requestKind, IndexSet indexes)
+ @see 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 IMAPFetchMessagesOperation#setExtraHeaders(List<String> extraHeaders)
+ */
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/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/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;
*/