MAPIPropertyValue.cs
author Thomas
Mon, 25 Mar 2019 13:27:16 +0100
branchsync
changeset 2610 09fde2338362
parent 2324 14b4d780a124
permissions -rw-r--r--
Merge with default

´╗┐using System;

namespace pEp
{
    /// <summary>
    /// MAPI helper class containing all defined property values.
    /// </summary>
    internal class MapiPropertyValue
    {
        /// <summary>
        /// Enumeration of flags for PidTagMessageFlags which specifies the status of the Message object.
        /// After the first successful call to the RopSaveChangesMessage ROP ([MS-OXCROPS] section 2.2.6.3), 
        /// as described in section 2.2.3.3, these flags are read-only for the client.
        /// </summary>
        [Flags]
        public enum EnumPidTagMessageFlags : int
        {
            /// <summary>
            /// The message is marked as having been read.
            /// </summary>
            mfRead = 0x00000001,

            /// <summary>
            /// The message has not been modified since it was first saved (if unsent) or it was delivered (if sent).
            /// This flag is always read-only for the client.
            /// </summary>
            mfUnmodified = 0x00000002,

            /// <summary>
            /// The message is marked for sending as a result of a call to the RopSubmitMessage ROP.
            /// This flag is always read-only for the client.
            /// </summary>
            mfSubmitted = 0x00000004,

            /// <summary>
            /// The message is still being composed and is treated as a Draft Message object. 
            /// This bit is cleared by the server when responding to the RopSubmitMessage ROP ([MS-OXCROPS] section 2.2.7.1) with a success code.
            /// </summary>
            mfUnsent = 0x00000008,

            /// <summary>
            /// The message has at least one attachment. This flag corresponds to the message's PidTagHasAttachments property (section 2.2.1.2).
            /// This flag is always read-only for the client.
            /// </summary>
            mfHasAttach = 0x00000010,

            /// <summary>
            /// The user receiving the message was also the user who sent the message.
            /// This flag is always read-only for the client.
            /// </summary>
            mfFromMe = 0x00000020,

            /// <summary>
            /// The message is an FAI (folder associated information) message.
            /// This flag is always read-only for the client.
            /// </summary>
            mfFAI = 0x00000040,

            /// <summary>
            /// The message includes a request for a resend operation with a non-delivery report.
            /// For more details, see [MS-OXOMSG] section 3.2.4.5.
            /// </summary>
            mfResend = 0x00000080,

            /// <summary>
            /// The user who sent the message has requested notification when a recipient (1) first reads it.
            /// This flag is always read-only for the client.
            /// </summary>
            mfNotifyRead = 0x00000100,

            /// <summary>
            /// The user who sent the message has requested notification when a recipient (1) deletes it before reading or the Message object expires.
            /// This flag is always read-only for the client.
            /// </summary>
            mfNotifyUnread = 0x00000200,

            /// <summary>
            /// The message has been read at least once. This flag is set or cleared by the server whenever the mfRead flag is set or cleared. Clients SHOULD ignore this flag.
            /// This flag is always read-only for the client.
            /// </summary>
            mfEverRead = 0x00000400,

            /// <summary>
            /// The incoming message arrived over the Internet and originated either outside the organization or from a source the gateway does not consider trusted.
            /// This flag is always read-only for the client.
            /// </summary>
            mfInternet = 0x00002000,

            /// <summary>
            /// The incoming message arrived over an external link other than X.400 or the Internet. 
            /// It originated either outside the organization or from a source the gateway does not consider trusted.
            /// This flag is always read-only for the client.
            /// </summary>
            mfUntrusted = 0x00008000
        }

        /// <summary>
        /// Enumeration of flags for S/MIME security settings.
        /// No proper documentation available.
        /// </summary>
        [Flags]
        public enum SecurityFlags : int
        {
            Encrypted = 0x00000001,
            Signed = 0x00000002
        }

        /// <summary>
        /// Enumeration of flags for the PidTagIconIndex property.
        /// See: https://docs.microsoft.com/en-us/office/client-developer/outlook/mapi/pidtagiconindex-canonical-property
        /// Note: Not all icons are properly documented by Microsoft.
        /// </summary>
        [Flags]
        public enum PidTagIconIndexFlags : int
        {
            Replied = 0x00000105,
            Forwarded = 0x00000106,
            Encrypted = 0x00000110,
            Signed = 0x00000111,
            EncryptedAndReplied = 0x00000113,
            SignedAndReplied = 0x00000114,
            EncryptedAndForwarded = 0x00000115,
            SignedAndForwarded = 0x00000116,
        }

        /// <summary>
        /// Value for PidTagAttachTag which specifies the attachment is TNEF.
        /// </summary>
        public static readonly byte[] PidTagAttachTagTNEF = {0x2A, 0x86, 0x48, 0x86, 0xF7, 0x14, 0x03, 0x0A, 0x01};

        /// <summary>
        /// Value for PidTagAttachTag which specifies the attachment is in an application-specific format.
        /// </summary>
        public static readonly byte[] PidTagAttachTagAfStorage = {0x2A, 0x86, 0x48, 0x86, 0xF7, 0x14, 0x03, 0x0A, 0x03, 0x02, 0x01};

        /// <summary>
        /// Value for PidTagAttachTag which specifies the attachment is MIME.
        /// </summary>
        public static readonly byte[] PidTagAttachTagMIME = {0x2A, 0x86, 0x48, 0x86, 0xF7, 0x14, 0x03, 0x0A, 0x04};

        /// <summary>
        /// Value for PidTagMessageClass indicating a normal e-mail message.
        /// See: https://msdn.microsoft.com/en-us/library/ee200767
        /// </summary>
        public const string PidTagMessageClassNormalMessage = "IPM.Note";

        /// <summary>
        /// Value for PidTagMessageClass indicating that the message is secure. This is a Microsoft standard
        /// and changes the message icon in the UI.
        /// See: https://msdn.microsoft.com/en-us/library/office/ff861573.aspx
        /// and: https://www.howto-outlook.com/howto/icons.htm
        /// </summary>
        public const string PidTagMessageClassSecure = "IPM.Note.Secure";

        /// <summary>
        /// Value for PidTagMessageClass indicating that the message is secure and from pEp. This is a custom 
        /// defined value and needed for secure messages on untrusted servers in order to load correctly the
        /// form region overlay in the message preview.
        /// </summary>
        public const string PidTagMessageClassSecurePEP = "IPM.Note.Secure.pEp";

        /// <summary>
        /// Value for PidTagMessageClass indicating the message is secure (S/MIME) and can also be signed.
        /// See: https://msdn.microsoft.com/en-us/library/ee200767
        /// </summary>
        public const string PidTagMessageClassSMIME = "IPM.Note.SMIME";

        /// <summary>
        /// Value for PidTagMessageClass indicating the message is secure (S/MIME) and clear signed.
        /// See: https://msdn.microsoft.com/en-us/library/ee200767
        /// </summary>
        public const string PidTagMessageClassSMIMEMultipartSigned = "IPM.Note.SMIME.MultipartSigned";

        /// <summary>
        /// Value for PidTagMessageClass indicating the message is a secure read receipt
        /// See: https://msdn.microsoft.com/en-us/library/ee200767
        /// </summary>
        public const string PidTagMessageClassSMIMEReceipt = "IPM.Note.Receipt.SMIME";
    }
}