1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 *
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
9 *
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
14 *
15 * The Original Code is mozilla.org code.
16 *
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 1998
20 * the Initial Developer. All Rights Reserved.
21 *
22 * Contributor(s):
23 *
24 * Alternatively, the contents of this file may be used under the terms of
25 * either of the GNU General Public License Version 2 or later (the "GPL"),
26 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
27 * in which case the provisions of the GPL or the LGPL are applicable instead
28 * of those above. If you wish to allow use of your version of this file only
29 * under the terms of either the GPL or the LGPL, and not to allow others to
30 * use your version of this file under the terms of the MPL, indicate your
31 * decision by deleting the provisions above and replace them with the notice
32 * and other provisions required by the GPL or the LGPL. If you do not delete
33 * the provisions above, a recipient may use your version of this file under
34 * the terms of any one of the MPL, the GPL or the LGPL.
35 *
36 * ***** END LICENSE BLOCK ***** */
37
38 #include "nsISupports.idl"
39
40 %{C++
41 #include "MailNewsTypes.h"
42 %}
43
44 #include "MailNewsTypes2.idl"
45
46 [ptr] native octetPtr(PRUint8);
47
48 interface nsIMsgFolder;
49
50 [scriptable, uuid(56515ecb-5ad2-4b3e-9877-c6df26bb9443)]
51 interface nsIMsgDBHdr : nsISupports
52 {
53 /* general property routines - I think this can retrieve any
54 header in the db */
55 AString getProperty(in string propertyName);
56 void setProperty(in string propertyName, in AString propertyStr);
57 void setStringProperty(in string propertyName, in string propertyValue);
58 string getStringProperty(in string propertyName);
59 unsigned long getUint32Property(in string propertyName);
60 void setUint32Property(in string propertyName,
61 in unsigned long propertyVal);
62
63 // accessors, to make our JS cleaner
64 readonly attribute boolean isRead;
65 readonly attribute boolean isFlagged;
66
67 // Special accessor that checks if a message is part of an ignored subthread
68 readonly attribute boolean isKilled;
69
70 // Mark message routines
71 void markRead(in boolean read);
72 void markFlagged(in boolean flagged);
73 void markHasAttachments(in boolean hasAttachments);
74
75 attribute nsMsgPriorityValue priority;
76 void setPriorityString(in string priority);
77
78 /* flag handling routines */
79 attribute unsigned long flags;
80 unsigned long OrFlags(in unsigned long flags);
81 unsigned long AndFlags(in unsigned long flags);
82
83 /* various threading stuff */
84 attribute nsMsgKey threadId;
85 attribute nsMsgKey messageKey;
86 attribute nsMsgKey threadParent;
87
88 /* meta information about the message, learned from reading the message */
89 attribute unsigned long messageSize;
90 attribute unsigned long lineCount;
91 attribute unsigned long statusOffset;
92 attribute unsigned long messageOffset;
93 attribute unsigned long offlineMessageSize;
94 /* common headers */
95 attribute PRTime date;
96 readonly attribute unsigned long dateInSeconds;
97 attribute string messageId;
98 attribute string ccList;
99 attribute string author;
100 attribute string subject;
101 attribute string recipients;
102
103 /* anything below here still has to be fixed */
104 void setReferences(in string references);
105 readonly attribute unsigned short numReferences;
106 ACString getStringReference(in long refNum);
107
108 void setRecipientsArray(in string names, in string addresses,
109 in unsigned long numAddresses);
110 void setCCListArray(in string names, in string addresses,
111 in unsigned long numAddresses);
112
113 readonly attribute wstring mime2DecodedAuthor;
114 readonly attribute wstring mime2DecodedSubject;
115 readonly attribute wstring mime2DecodedRecipients;
116
117 [noscript] void getAuthorCollationKey(out octetPtr key, out unsigned long len);
118 [noscript] void getSubjectCollationKey(out octetPtr key, out unsigned long len);
119 [noscript] void getRecipientsCollationKey(out octetPtr key, out unsigned long len);
120
121 attribute string Charset;
122 attribute nsMsgLabelValue label;
123 attribute string accountKey;
124 readonly attribute nsIMsgFolder folder;
125 };
126 /* *******************************************************************************/