Back to index

lightning-sunbird  0.9+nobinonly
nsMsgSearchCore.idl
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 #include "MailNewsTypes2.idl"
00039 #include "nsIMsgFolder.idl"
00040 
00041 interface nsIMsgHeaderParser;
00042 
00043 %{C++
00044 #include "nsIMsgHeaderParser.h"
00045 %}
00046 interface nsIMsgDatabase;
00047 interface nsIMsgDBHdr;
00048 
00049 [scriptable, uuid(5fe70a74-304e-11d3-9be1-00a0c900d445)]
00050 
00051 interface nsMsgSearchScope {
00052   const nsMsgSearchScopeValue offlineMail = 0;
00053   const nsMsgSearchScopeValue offlineMailFilter = 1;
00054   const nsMsgSearchScopeValue onlineMail = 2;
00055   const nsMsgSearchScopeValue onlineMailFilter = 3;
00056   const nsMsgSearchScopeValue localNews = 4;
00057   const nsMsgSearchScopeValue news = 5;
00058   const nsMsgSearchScopeValue newsEx = 6;
00059   const nsMsgSearchScopeValue LDAP = 7;
00060   const nsMsgSearchScopeValue LocalAB = 8;
00061   const nsMsgSearchScopeValue allSearchableGroups = 9;
00062   const nsMsgSearchScopeValue newsFilter = 10;
00063   const nsMsgSearchScopeValue LocalABAnd = 11;
00064   const nsMsgSearchScopeValue LDAPAnd = 12;
00065 };
00066 
00067 typedef long nsMsgSearchAttribValue;
00068 
00069 [scriptable, uuid(68c8710a-304e-11d3-97bf-00a0c900d445)]
00070 interface nsMsgSearchAttrib {
00071     const nsMsgSearchAttribValue Default = -1;
00072     const nsMsgSearchAttribValue Subject = 0;    /* mail and news */
00073     const nsMsgSearchAttribValue Sender = 1;   
00074     const nsMsgSearchAttribValue Body = 2;       
00075     const nsMsgSearchAttribValue Date = 3;       
00076 
00077     const nsMsgSearchAttribValue Priority = 4;       /* mail only */
00078     const nsMsgSearchAttribValue MsgStatus = 5;  
00079     const nsMsgSearchAttribValue To = 6;
00080     const nsMsgSearchAttribValue CC = 7;
00081     const nsMsgSearchAttribValue ToOrCC = 8;
00082 
00083     const nsMsgSearchAttribValue Location = 9;          /* result list only */
00084     const nsMsgSearchAttribValue MessageKey = 10;        /* message result elems */
00085     const nsMsgSearchAttribValue AgeInDays = 11; 
00086     const nsMsgSearchAttribValue FolderInfo = 12;        /* for "view thread context" from result */
00087     const nsMsgSearchAttribValue Size = 13;
00088     const nsMsgSearchAttribValue AnyText = 14;
00089     const nsMsgSearchAttribValue Keywords = 15; // keywords are the internal representation of tags.
00090 
00091     const nsMsgSearchAttribValue Name = 16;
00092     const nsMsgSearchAttribValue DisplayName = 17;
00093     const nsMsgSearchAttribValue Nickname = 18;
00094     const nsMsgSearchAttribValue ScreenName = 19;
00095     const nsMsgSearchAttribValue Email = 20;
00096     const nsMsgSearchAttribValue AdditionalEmail = 21;
00097     const nsMsgSearchAttribValue PhoneNumber = 22;
00098     const nsMsgSearchAttribValue WorkPhone = 23;
00099     const nsMsgSearchAttribValue HomePhone = 24;
00100     const nsMsgSearchAttribValue Fax = 25;
00101     const nsMsgSearchAttribValue Pager = 26;
00102     const nsMsgSearchAttribValue Mobile = 27;
00103     const nsMsgSearchAttribValue City = 28;
00104     const nsMsgSearchAttribValue Street = 29;    
00105     const nsMsgSearchAttribValue Title = 30;
00106     const nsMsgSearchAttribValue Organization = 31;
00107     const nsMsgSearchAttribValue Department = 32;       
00108 
00109     // 33 - 45, reserved for ab / LDAP;
00110     const nsMsgSearchAttribValue HasAttachmentStatus = 46;
00111     const nsMsgSearchAttribValue JunkStatus = 47;
00112     const nsMsgSearchAttribValue Label = 48; /* mail only...can search by label */
00113     //49 is for showing customize... in ui headers start from 50 onwards up until 99.
00114     const nsMsgSearchAttribValue OtherHeader = 49;  /* for mail and news. MUST ALWAYS BE LAST attribute since we can have an arbitrary # of these... */
00115     const nsMsgSearchAttribValue kNumMsgSearchAttributes = 100;      /* must be last attribute */
00116 };
00117 
00118 /* NB: If you add elements to this enum, add only to the end, since 
00119  *     RULES.DAT stores enum values persistently
00120  */
00121 
00122 typedef long nsMsgSearchOpValue;
00123 
00124 [scriptable, uuid(82cc4518-304e-11d3-831d-00a0c900d445)]
00125 interface nsMsgSearchOp {
00126     const nsMsgSearchOpValue Contains = 0; /* for text attributes      */
00127     const nsMsgSearchOpValue DoesntContain = 1;
00128     const nsMsgSearchOpValue Is = 2; /* is and isn't also apply to some non-text attrs */
00129     const nsMsgSearchOpValue Isnt = 3; 
00130     const nsMsgSearchOpValue IsEmpty = 4;
00131 
00132     const nsMsgSearchOpValue IsBefore = 5; /* for date attributes              */
00133     const nsMsgSearchOpValue IsAfter = 6;
00134     
00135     const nsMsgSearchOpValue IsHigherThan = 7; /* for priority. Is also applies  */
00136     const nsMsgSearchOpValue IsLowerThan = 8;
00137 
00138     const nsMsgSearchOpValue BeginsWith = 9;              
00139     const nsMsgSearchOpValue EndsWith = 10;
00140 
00141     const nsMsgSearchOpValue SoundsLike = 11; /* for LDAP phoenetic matching      */
00142     const nsMsgSearchOpValue LdapDwim = 12; /* Do What I Mean for simple search */
00143 
00144     const nsMsgSearchOpValue IsGreaterThan = 13; 
00145     const nsMsgSearchOpValue IsLessThan = 14;
00146 
00147     const nsMsgSearchOpValue NameCompletion = 15; /* Name Completion operator...as the name implies =) */
00148     const nsMsgSearchOpValue IsInAB = 16;
00149     const nsMsgSearchOpValue IsntInAB = 17;
00150     const nsMsgSearchOpValue kNumMsgSearchOperators  = 18;     /* must be last operator */
00151 };
00152 
00153 typedef long nsMsgSearchWidgetValue;
00154 
00155 /* FEs use this to help build the search dialog box */
00156 [scriptable,uuid(903dd2e8-304e-11d3-92e6-00a0c900d445)]
00157 interface nsMsgSearchWidget {
00158     const nsMsgSearchWidgetValue Text = 0;
00159     const nsMsgSearchWidgetValue Date = 1;
00160     const nsMsgSearchWidgetValue Menu = 2;
00161        const nsMsgSearchWidgetValue Int = 3;          /* added to account for age in days which requires an integer field */
00162     const nsMsgSearchWidgetValue None = 4;
00163 };
00164 
00165 typedef long nsMsgSearchTypeValue;
00166 
00167 
00168 /* Used to specify type of search to be performed */
00169 [scriptable,uuid(964b7f32-304e-11d3-ae13-00a0c900d445)]
00170 interface nsMsgSearchType {
00171        const nsMsgSearchTypeValue None = 0;
00172        const nsMsgSearchTypeValue RootDSE = 1;
00173        const nsMsgSearchTypeValue Normal = 2;
00174        const nsMsgSearchTypeValue LdapVLV = 3;
00175        const nsMsgSearchTypeValue NameCompletion = 4;
00176 };
00177 
00178 typedef long nsMsgSearchBooleanOperator;
00179  
00180 [scriptable, uuid(a37f3f4a-304e-11d3-8f94-00a0c900d445)]
00181 interface nsMsgSearchBooleanOp {
00182     const nsMsgSearchBooleanOperator BooleanOR = 0;
00183     const nsMsgSearchBooleanOperator BooleanAND = 1;
00184 };
00185 
00186 /* Use this to specify the value of a search term */
00187 
00188 [ptr] native nsMsgSearchValue(nsMsgSearchValue);
00189 
00190 %{C++
00191 typedef struct nsMsgSearchValue
00192 {
00193     nsMsgSearchAttribValue attribute;
00194     union
00195     {
00196       nsMsgPriorityValue priority;
00197       PRTime date;
00198       PRUint32 msgStatus; /* see MSG_FLAG in msgcom.h */
00199       PRUint32 size;
00200       nsMsgKey key;
00201                 PRUint32 age; /* in days */
00202                 nsIMsgFolder *folder;
00203                 nsMsgLabelValue label;
00204                 PRUint32 junkStatus;
00205     } u;
00206     char *string;
00207 } nsMsgSearchValue;
00208 %}
00209 
00210 [ptr] native nsMsgSearchTerm(nsMsgSearchTerm);
00211 
00212 %{C++
00213 #define IS_STRING_ATTRIBUTE(_a) \
00214 (!(_a == nsMsgSearchAttrib::Priority || _a == nsMsgSearchAttrib::Date || \
00215    _a == nsMsgSearchAttrib::MsgStatus || _a == nsMsgSearchAttrib::MessageKey || \
00216    _a == nsMsgSearchAttrib::Size || _a == nsMsgSearchAttrib::AgeInDays || \
00217    _a == nsMsgSearchAttrib::FolderInfo || _a == nsMsgSearchAttrib::Location || \
00218    _a == nsMsgSearchAttrib::Label || _a == nsMsgSearchAttrib::JunkStatus || \
00219    _a == nsMsgSearchAttrib::HasAttachmentStatus))
00220 %}
00221 
00222 [ptr] native nsSearchMenuItem(nsSearchMenuItem);
00223