Back to index

lightning-sunbird  0.9+nobinonly
MailNewsTypes.h
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
00002 /* ***** BEGIN LICENSE BLOCK *****
00003  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
00004  *
00005  * The contents of this file are subject to the Mozilla Public License Version
00006  * 1.1 (the "License"); you may not use this file except in compliance with
00007  * the License. You may obtain a copy of the License at
00008  * http://www.mozilla.org/MPL/
00009  *
00010  * Software distributed under the License is distributed on an "AS IS" basis,
00011  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
00012  * for the specific language governing rights and limitations under the
00013  * License.
00014  *
00015  * The Original Code is mozilla.org code.
00016  *
00017  * The Initial Developer of the Original Code is
00018  * Netscape Communications Corporation.
00019  * Portions created by the Initial Developer are Copyright (C) 1999
00020  * the Initial Developer. All Rights Reserved.
00021  *
00022  * Contributor(s):
00023  *
00024  * Alternatively, the contents of this file may be used under the terms of
00025  * either of the GNU General Public License Version 2 or later (the "GPL"),
00026  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
00027  * in which case the provisions of the GPL or the LGPL are applicable instead
00028  * of those above. If you wish to allow use of your version of this file only
00029  * under the terms of either the GPL or the LGPL, and not to allow others to
00030  * use your version of this file under the terms of the MPL, indicate your
00031  * decision by deleting the provisions above and replace them with the notice
00032  * and other provisions required by the GPL or the LGPL. If you do not delete
00033  * the provisions above, a recipient may use your version of this file under
00034  * the terms of any one of the MPL, the GPL or the LGPL.
00035  *
00036  * ***** END LICENSE BLOCK ***** */
00037 
00038 #ifndef MailNewsTypes_h__
00039 #define MailNewsTypes_h__
00040 
00041 #include "msgCore.h"
00042 #include "prtypes.h"
00043 #include "MailNewsTypes2.h"
00044 
00045 /* nsMsgKey is a unique ID for a particular message in a folder.  If you want
00046    a handle to a message that will remain valid even after resorting the folder
00047    or otherwise changing their indices, you want one of these rather than a
00048    nsMsgViewIndex. nsMsgKeys don't survive local mail folder compression, however.
00049  */
00050 const nsMsgKey nsMsgKey_None = 0xffffffff;
00051 
00052 /* nsMsgViewIndex
00053  *
00054  * A generic index type from which other index types are derived.  All nsMsgViewIndex
00055  * derived types are zero based.
00056  *
00057  * The following index types are currently supported:
00058  *  - nsMsgViewIndex - an index into the list of messages or folders or groups,
00059  *    where zero is the first one to show, one is the second, etc...
00060  *  - AB_SelectionIndex
00061  *  - AB_NameCompletionIndex
00062  */
00063 
00064 
00065 const nsMsgViewIndex nsMsgViewIndex_None = 0xFFFFFFFF;
00066 
00067 // The following enums are all persistent in databases, so don't go changing the values!
00068 enum nsMsgSortOrder {
00069   nsMsgSortOrder_None = 0,
00070   nsMsgSortOrder_Ascending = 1,
00071   nsMsgSortOrder_Descending = 2
00072 };
00073 
00074 // We should be using the property name we're sorting by instead of these types.
00075 enum nsMsgSortType {
00076   nsMsgSortType_Date = 0x12,
00077   nsMsgSortType_Subject = 0x13,
00078   nsMsgSortType_Author = 0x14,
00079   nsMsgSortType_Id = 0x15,
00080   nsMsgSortType_Thread = 0x16,
00081   nsMsgSortType_Priority = 0x17,
00082   nsMsgSortType_Status = 0x18,
00083   nsMsgSortType_Size = 0x19,
00084   nsMsgSortType_Flagged = 0x1a,
00085   nsMsgSortType_Unread = 0x1b,
00086   nsMsgSortType_Recipient
00087 };
00088 
00089 /* Flags about a single message.  These values are used in the MSG_MessageLine
00090    struct and in a folder's mozilla-status line. The summary file database
00091    should use the same set of flags..
00092 */
00093 
00094 #define MSG_FLAG_READ     0x0001    /* has been read */
00095 #define MSG_FLAG_REPLIED  0x0002    /* a reply has been successfully sent */
00096 #define MSG_FLAG_MARKED   0x0004    /* the user-provided mark */
00097 #define MSG_FLAG_EXPUNGED 0x0008    /* already gone (when folder not
00098                                        compacted.)  Since actually
00099                                        removing a message from a
00100                                        folder is a semi-expensive
00101                                        operation, we tend to delay it;
00102                                        messages with this bit set will
00103                                        be removed the next time folder
00104                                        compaction is done.  Once this
00105                                        bit is set, it never gets
00106                                        un-set.  */
00107 #define MSG_FLAG_HAS_RE   0x0010    /* whether subject has "Re:" on
00108                                        the front.  The folder summary
00109                                        uniquifies all of the strings
00110                                        in it, and to help this, any
00111                                        string which begins with "Re:"
00112                                        has that stripped first.  This
00113                                        bit is then set, so that when
00114                                        presenting the message, we know
00115                                        to put it back (since the "Re:"
00116                                        is not itself stored in the
00117                                        file.)  */
00118 #define MSG_FLAG_ELIDED   0x0020    /* Whether the children of this
00119                                        sub-thread are folded in the
00120                                        display.  */
00121 #define MSG_FLAG_EXPIRED  0x0040    /* If this flag is set, then this
00122                                        is not a "real" message, but is
00123                                        a dummy container representing
00124                                        an expired parent in a thread.  */
00125 #define MSG_FLAG_OFFLINE  0x0080   /* db has offline news or imap article
00126                                                                               */
00127 #define MSG_FLAG_WATCHED  0x0100    /* If set, then this thread is watched (in
00128                                                                   3.0, this was MSG_FLAG_UPDATING).*/
00129 #define MSG_FLAG_SENDER_AUTHED    0x0200    /* If set, then this message's sender
00130                                        has been authenticated when sending this msg. */
00131 #define MSG_FLAG_PARTIAL  0x0400    /* If set, then this message's body is
00132                                        only the first ten lines or so of the
00133                                        message, and we need to add a link to
00134                                        let the user download the rest of it
00135                                        from the POP server. */
00136 #define MSG_FLAG_QUEUED   0x0800    /* If set, this message is queued for
00137                                        delivery.  This only ever gets set on
00138                                        messages in the queue folder, but is
00139                                        used to protect against the case of
00140                                        other messages having made their way
00141                                        in there somehow -- if some other
00142                                        program put a message in the queue, we
00143                                        don't want to later deliver it! */
00144 #define MSG_FLAG_FORWARDED  0x1000  /* this message has been forwarded */
00145 #define MSG_FLAG_PRIORITIES 0xE000 /* These are used to remember the message
00146                                                                   priority in the mozilla status flags
00147                                                                   so we can regenerate a priority after a 
00148                                                                   rule (or user) has changed it. They are
00149                                                                   not returned in MSG_MessageLine.flags, 
00150                                                                   just in mozilla-status, so if you need
00151                                                                   more non-persistent flags, you could 
00152                                                                   share these bits. But it would be wrong.
00153                                                                .  */
00154 
00155 #define MSG_FLAG_NEW        0x10000       /* This msg is new since the last time
00156                                                                   the folder was closed.
00157                                                                   */
00158 #define MSG_FLAG_IGNORED    0x40000 /* the thread is ignored */
00159 
00160 
00161 #define MSG_FLAG_IMAP_DELETED      0x200000 /* message is marked deleted on the server */
00162 
00163 #define MSG_FLAG_MDN_REPORT_NEEDED 0x400000 /* This msg required to send an MDN 
00164                                                                               * to the sender of the message
00165                                                                               */
00166 #define MSG_FLAG_MDN_REPORT_SENT   0x800000 /* An MDN report message has been
00167                                                                               * sent for this message. No more
00168                                                                               * MDN report should be sent to the
00169                                                                               * sender
00170                                                                               */
00171 #define MSG_FLAG_TEMPLATE       0x1000000 /* this message is a template */
00172 #define MSG_FLAG_ATTACHMENT        0x10000000    /* this message has files attached to it */
00173 
00174 
00175 #endif