// // IMessageSummary.cs // // Author: Jeffrey Stedfast // // Copyright (c) 2013-2020 .NET Foundation and Contributors // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // using System; using System.Collections.Generic; using MimeKit; namespace MailKit { /// /// A summary of a message. /// /// /// The Fetch and /// FetchAsync methods /// return lists of items. /// The properties of the that will be available /// depend on the passed to the aformentioned method. /// public interface IMessageSummary { /// /// Get the folder that the message belongs to. /// /// /// Gets the folder that the message belongs to, if available. /// /// The folder. IMailFolder Folder { get; } /// /// Get a bitmask of fields that have been populated. /// /// /// Gets a bitmask of fields that have been populated. /// /// The fields that have been populated. MessageSummaryItems Fields { get; } /// /// Gets the body structure of the message, if available. /// /// /// The body will be one of , /// , , /// or . /// This property will only be set if either the /// flag or the /// flag is passed to /// one of the Fetch /// or FetchAsync /// methods. /// /// The body structure of the message. BodyPart Body { get; } /// /// Gets the text body part of the message if it exists. /// /// /// Gets the text/plain body part of the message. /// This property will only be usable if the /// flag is passed to /// one of the Fetch /// or FetchAsync /// methods. /// /// /// /// /// The text body if it exists; otherwise, null. BodyPartText TextBody { get; } /// /// Gets the html body part of the message if it exists. /// /// /// Gets the text/html body part of the message. /// This property will only be usable if the /// flag is passed to /// one of the Fetch /// or FetchAsync /// methods. /// /// The html body if it exists; otherwise, null. BodyPartText HtmlBody { get; } /// /// Gets the body parts of the message. /// /// /// Traverses over the , enumerating all of the /// objects. /// This property will only be usable if either the /// flag or the /// flag is passed to /// one of the Fetch /// or FetchAsync /// methods. /// /// The body parts. IEnumerable BodyParts { get; } /// /// Gets the attachments. /// /// /// Traverses over the , enumerating all of the /// objects that have a Content-Disposition /// header set to "attachment". /// This property will only be usable if the /// flag is passed to /// one of the Fetch /// or FetchAsync /// methods. /// /// /// /// /// The attachments. IEnumerable Attachments { get; } /// /// Gets the preview text of the message. /// /// /// The preview text is a short snippet of the beginning of the message /// text, typically shown in a mail client's message list to provide the user /// with a sense of what the message is about. /// This property will only be set if the /// flag is passed to /// one of the Fetch /// or FetchAsync /// methods. /// /// The preview text. string PreviewText { get; } /// /// Gets the envelope of the message, if available. /// /// /// The envelope of a message contains information such as the /// date the message was sent, the subject of the message, /// the sender of the message, who the message was sent to, /// which message(s) the message may be in reply to, /// and the message id. /// This property will only be set if the /// flag is passed to /// one of the Fetch /// or FetchAsync /// methods. /// /// The envelope of the message. Envelope Envelope { get; } /// /// Gets the normalized subject. /// /// /// A normalized Subject header value where prefixes such as "Re:", "Re[#]:" and "FWD:" have been pruned. /// This property is typically used for threading messages by subject. /// /// The normalized subject. string NormalizedSubject { get; } /// /// Gets the Date header value. /// /// /// Gets the Date header value. If the Date header is not present, the arrival date is used. /// If neither are known, is returned. /// /// The date. DateTimeOffset Date { get; } /// /// Gets whether or not the message is a reply. /// /// /// This value should be based on whether the message subject contained any "Re:", "Re[#]:" or "FWD:" prefixes. /// /// true if the message is a reply; otherwise, false. bool IsReply { get; } /// /// Gets the message flags, if available. /// /// /// Gets the message flags, if available. /// This property will only be set if the /// flag is passed to /// one of the Fetch /// or FetchAsync /// methods. /// /// The message flags. MessageFlags? Flags { get; } /// /// Gets the user-defined message flags, if available. /// /// /// Gets the user-defined message flags, if available. /// This property will only be set if the /// flag is passed to /// one of the Fetch /// or FetchAsync /// methods. /// /// The user-defined message flags. HashSet Keywords { get; } /// /// Gets the user-defined message flags, if available. /// /// /// Gets the user-defined message flags, if available. /// This property will only be set if the /// flag is passed to /// one of the Fetch /// or FetchAsync /// methods. /// /// The user-defined message flags. [Obsolete ("Use Keywords instead.")] HashSet UserFlags { get; } /// /// Gets the message annotations, if available. /// /// /// Gets the message annotations, if available. /// This property will only be set if the /// flag is passed to /// one of the Fetch /// or FetchAsync /// methods. /// /// The message annotations. IList Annotations { get; } /// /// Gets the list of headers, if available. /// /// /// Gets the list of headers, if available. /// This property will only be set if /// is specified in a call to one of the /// Fetch /// or FetchAsync /// methods or specific headers are requested via a one of the Fetch or FetchAsync methods /// that accept list of specific headers to request for each message such as /// . /// /// /// The list of headers. HeaderList Headers { get; } /// /// Gets the internal date of the message, if available. /// /// /// Gets the internal date of the message (often the same date as found in the Received header), if available. /// This property will only be set if the /// flag is passed to /// one of the Fetch /// or FetchAsync /// methods. /// /// The internal date of the message. DateTimeOffset? InternalDate { get; } /// /// Gets the size of the message, in bytes, if available. /// /// /// Gets the size of the message, in bytes, if available. /// This property will only be set if the /// flag is passed to /// one of the Fetch /// or FetchAsync /// methods. /// /// The size of the message. uint? Size { get; } /// /// Gets the mod-sequence value for the message, if available. /// /// /// Gets the mod-sequence value for the message, if available. /// This property will only be set if the /// flag is passed to /// one of the Fetch /// or FetchAsync /// methods. /// /// The mod-sequence value. ulong? ModSeq { get; } /// /// Gets the message-ids that the message references, if available. /// /// /// Gets the message-ids that the message references, if available. /// This property will only be set if the /// flag is passed to /// one of the Fetch /// or FetchAsync /// methods. /// /// The references. MessageIdList References { get; } /// /// Get the globally unique identifier for the message, if available. /// /// /// Gets the globally unique identifier of the message, if available. /// This property will only be set if the /// flag is passed to /// one of the Fetch /// or FetchAsync /// methods. /// This property maps to the EMAILID value defined in the /// OBJECTID extension. /// /// The globally unique message identifier. string EmailId { get; } /// /// Get the globally unique identifier for the message, if available. /// /// /// Gets the globally unique identifier of the message, if available. /// This property will only be set if the /// flag is passed to /// one of the Fetch /// or FetchAsync /// methods. /// This property maps to the EMAILID value defined in the /// OBJECTID extension. /// /// The globally unique message identifier. [Obsolete ("Use EmailId instead.")] string Id { get; } /// /// Get the globally unique thread identifier for the message, if available. /// /// /// Gets the globally unique thread identifier for the message, if available. /// This property will only be set if the /// flag is passed to /// one of the Fetch /// or FetchAsync /// methods. /// This property maps to the THREADID value defined in the /// OBJECTID extension. /// /// The globally unique thread identifier. string ThreadId { get; } /// /// Gets the unique identifier of the message, if available. /// /// /// Gets the unique identifier of the message, if available. /// This property will only be set if the /// flag is passed to /// one of the Fetch /// or FetchAsync /// methods. /// /// The uid of the message. UniqueId UniqueId { get; } /// /// Gets the index of the message. /// /// /// Gets the index of the message. /// This property is always set. /// /// The index of the message. int Index { get; } #region GMail extension properties /// /// Gets the GMail message identifier, if available. /// /// /// Gets the GMail message identifier, if available. /// This property will only be set if the /// flag is passed to /// one of the Fetch /// or FetchAsync /// methods. /// /// The GMail message identifier. ulong? GMailMessageId { get; } /// /// Gets the GMail thread identifier, if available. /// /// /// Gets the GMail thread identifier, if available. /// This property will only be set if the /// flag is passed to /// one of the Fetch /// or FetchAsync /// methods. /// /// The GMail thread identifier. ulong? GMailThreadId { get; } /// /// Gets the list of GMail labels, if available. /// /// /// Gets the list of GMail labels, if available. /// This property will only be set if the /// flag is passed to /// one of the Fetch /// or FetchAsync /// methods. /// /// The GMail labels. IList GMailLabels { get; } #endregion } }