1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
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) 1999
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 "MailNewsTypes2.idl"
39 #include "nsIMsgFolder.idl"
40
41 interface nsIMsgHeaderParser;
42
43 %{C++
44 #include "nsIMsgHeaderParser.h"
45 %}
46 interface nsIMsgDatabase;
47 interface nsIMsgDBHdr;
48
49 [scriptable, uuid(5fe70a74-304e-11d3-9be1-00a0c900d445)]
50
51 interface nsMsgSearchScope {
52 const nsMsgSearchScopeValue offlineMail = 0;
53 const nsMsgSearchScopeValue offlineMailFilter = 1;
54 const nsMsgSearchScopeValue onlineMail = 2;
55 const nsMsgSearchScopeValue onlineMailFilter = 3;
56 const nsMsgSearchScopeValue localNews = 4;
57 const nsMsgSearchScopeValue news = 5;
58 const nsMsgSearchScopeValue newsEx = 6;
59 const nsMsgSearchScopeValue LDAP = 7;
60 const nsMsgSearchScopeValue LocalAB = 8;
61 const nsMsgSearchScopeValue allSearchableGroups = 9;
62 const nsMsgSearchScopeValue newsFilter = 10;
63 const nsMsgSearchScopeValue LocalABAnd = 11;
64 const nsMsgSearchScopeValue LDAPAnd = 12;
65 };
66
67 typedef long nsMsgSearchAttribValue;
68
69 [scriptable, uuid(68c8710a-304e-11d3-97bf-00a0c900d445)]
70 interface nsMsgSearchAttrib {
71 const nsMsgSearchAttribValue Default = -1;
72 const nsMsgSearchAttribValue Subject = 0; /* mail and news */
73 const nsMsgSearchAttribValue Sender = 1;
74 const nsMsgSearchAttribValue Body = 2;
75 const nsMsgSearchAttribValue Date = 3;
76
77 const nsMsgSearchAttribValue Priority = 4; /* mail only */
78 const nsMsgSearchAttribValue MsgStatus = 5;
79 const nsMsgSearchAttribValue To = 6;
80 const nsMsgSearchAttribValue CC = 7;
81 const nsMsgSearchAttribValue ToOrCC = 8;
82
83 const nsMsgSearchAttribValue Location = 9; /* result list only */
84 const nsMsgSearchAttribValue MessageKey = 10; /* message result elems */
85 const nsMsgSearchAttribValue AgeInDays = 11;
86 const nsMsgSearchAttribValue FolderInfo = 12; /* for "view thread context" from result */
87 const nsMsgSearchAttribValue Size = 13;
88 const nsMsgSearchAttribValue AnyText = 14;
89 const nsMsgSearchAttribValue Keywords = 15; // keywords are the internal representation of tags.
90
91 const nsMsgSearchAttribValue Name = 16;
92 const nsMsgSearchAttribValue DisplayName = 17;
93 const nsMsgSearchAttribValue Nickname = 18;
94 const nsMsgSearchAttribValue ScreenName = 19;
95 const nsMsgSearchAttribValue Email = 20;
96 const nsMsgSearchAttribValue AdditionalEmail = 21;
97 const nsMsgSearchAttribValue PhoneNumber = 22;
98 const nsMsgSearchAttribValue WorkPhone = 23;
99 const nsMsgSearchAttribValue HomePhone = 24;
100 const nsMsgSearchAttribValue Fax = 25;
101 const nsMsgSearchAttribValue Pager = 26;
102 const nsMsgSearchAttribValue Mobile = 27;
103 const nsMsgSearchAttribValue City = 28;
104 const nsMsgSearchAttribValue Street = 29;
105 const nsMsgSearchAttribValue Title = 30;
106 const nsMsgSearchAttribValue Organization = 31;
107 const nsMsgSearchAttribValue Department = 32;
108
109 // 33 - 45, reserved for ab / LDAP;
110 const nsMsgSearchAttribValue HasAttachmentStatus = 46;
111 const nsMsgSearchAttribValue JunkStatus = 47;
112 const nsMsgSearchAttribValue Label = 48; /* mail only...can search by label */
113 //49 is for showing customize... in ui headers start from 50 onwards up until 99.
114 const nsMsgSearchAttribValue OtherHeader = 49; /* for mail and news. MUST ALWAYS BE LAST attribute since we can have an arbitrary # of these... */
115 const nsMsgSearchAttribValue kNumMsgSearchAttributes = 100; /* must be last attribute */
116 };
117
118 /* NB: If you add elements to this enum, add only to the end, since
119 * RULES.DAT stores enum values persistently
120 */
121
122 typedef long nsMsgSearchOpValue;
123
124 [scriptable, uuid(82cc4518-304e-11d3-831d-00a0c900d445)]
125 interface nsMsgSearchOp {
126 const nsMsgSearchOpValue Contains = 0; /* for text attributes */
127 const nsMsgSearchOpValue DoesntContain = 1;
128 const nsMsgSearchOpValue Is = 2; /* is and isn't also apply to some non-text attrs */
129 const nsMsgSearchOpValue Isnt = 3;
130 const nsMsgSearchOpValue IsEmpty = 4;
131
132 const nsMsgSearchOpValue IsBefore = 5; /* for date attributes */
133 const nsMsgSearchOpValue IsAfter = 6;
134
135 const nsMsgSearchOpValue IsHigherThan = 7; /* for priority. Is also applies */
136 const nsMsgSearchOpValue IsLowerThan = 8;
137
138 const nsMsgSearchOpValue BeginsWith = 9;
139 const nsMsgSearchOpValue EndsWith = 10;
140
141 const nsMsgSearchOpValue SoundsLike = 11; /* for LDAP phoenetic matching */
142 const nsMsgSearchOpValue LdapDwim = 12; /* Do What I Mean for simple search */
143
144 const nsMsgSearchOpValue IsGreaterThan = 13;
145 const nsMsgSearchOpValue IsLessThan = 14;
146
147 const nsMsgSearchOpValue NameCompletion = 15; /* Name Completion operator...as the name implies =) */
148 const nsMsgSearchOpValue IsInAB = 16;
149 const nsMsgSearchOpValue IsntInAB = 17;
150 const nsMsgSearchOpValue kNumMsgSearchOperators = 18; /* must be last operator */
151 };
152
153 typedef long nsMsgSearchWidgetValue;
154
155 /* FEs use this to help build the search dialog box */
156 [scriptable,uuid(903dd2e8-304e-11d3-92e6-00a0c900d445)]
157 interface nsMsgSearchWidget {
158 const nsMsgSearchWidgetValue Text = 0;
159 const nsMsgSearchWidgetValue Date = 1;
160 const nsMsgSearchWidgetValue Menu = 2;
161 const nsMsgSearchWidgetValue Int = 3; /* added to account for age in days which requires an integer field */
162 const nsMsgSearchWidgetValue None = 4;
163 };
164
165 typedef long nsMsgSearchTypeValue;
166
167
168 /* Used to specify type of search to be performed */
169 [scriptable,uuid(964b7f32-304e-11d3-ae13-00a0c900d445)]
170 interface nsMsgSearchType {
171 const nsMsgSearchTypeValue None = 0;
172 const nsMsgSearchTypeValue RootDSE = 1;
173 const nsMsgSearchTypeValue Normal = 2;
174 const nsMsgSearchTypeValue LdapVLV = 3;
175 const nsMsgSearchTypeValue NameCompletion = 4;
176 };
177
178 typedef long nsMsgSearchBooleanOperator;
179
180 [scriptable, uuid(a37f3f4a-304e-11d3-8f94-00a0c900d445)]
181 interface nsMsgSearchBooleanOp {
182 const nsMsgSearchBooleanOperator BooleanOR = 0;
183 const nsMsgSearchBooleanOperator BooleanAND = 1;
184 };
185
186 /* Use this to specify the value of a search term */
187
188 [ptr] native nsMsgSearchValue(nsMsgSearchValue);
189
190 %{C++
191 typedef struct nsMsgSearchValue
192 {
193 nsMsgSearchAttribValue attribute;
194 union
195 {
196 nsMsgPriorityValue priority;
197 PRTime date;
198 PRUint32 msgStatus; /* see MSG_FLAG in msgcom.h */
199 PRUint32 size;
200 nsMsgKey key;
201 PRInt32 age; /* in days */
202 nsIMsgFolder *folder;
203 nsMsgLabelValue label;
204 PRUint32 junkStatus;
205 } u;
206 char *string;
207 } nsMsgSearchValue;
208 %}
209
210 [ptr] native nsMsgSearchTerm(nsMsgSearchTerm);
211
212 %{C++
213 #define IS_STRING_ATTRIBUTE(_a) \
214 (!(_a == nsMsgSearchAttrib::Priority || _a == nsMsgSearchAttrib::Date || \
215 _a == nsMsgSearchAttrib::MsgStatus || _a == nsMsgSearchAttrib::MessageKey || \
216 _a == nsMsgSearchAttrib::Size || _a == nsMsgSearchAttrib::AgeInDays || \
217 _a == nsMsgSearchAttrib::FolderInfo || _a == nsMsgSearchAttrib::Location || \
218 _a == nsMsgSearchAttrib::Label || _a == nsMsgSearchAttrib::JunkStatus || \
219 _a == nsMsgSearchAttrib::HasAttachmentStatus))
220 %}
221
222 [ptr] native nsSearchMenuItem(nsSearchMenuItem);