Back to index

lightning-sunbird  0.9+nobinonly
nsIMsgFilter.idl
Go to the documentation of this file.
00001 /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 
00039 #include "nsISupports.idl"
00040 #include "nsMsgFilterCore.idl"
00041 #include "nsIMsgSearchScopeTerm.idl"
00042 #include "nsIMsgSearchValue.idl"
00043 #include "nsIMsgSearchTerm.idl"
00044 #include "nsISupportsArray.idl"
00045 
00046 interface nsOutputStream;
00047 
00048 [scriptable, uuid(09aa663b-ab04-457d-9557-319e4cc7884e)]
00049 interface nsIMsgRuleAction : nsISupports {
00050 
00051   attribute nsMsgRuleActionType type;
00052 
00053   // target priority.. throws an exception if the action is not priority
00054   attribute nsMsgPriorityValue priority;
00055 
00056   // target folder.. throws an exception if the action is not move to folder
00057   attribute string targetFolderUri;
00058 
00059   // target label. throws an exception if the action is not label
00060   attribute nsMsgLabelValue label;
00061 
00062   attribute long junkScore; 
00063 
00064   attribute string strValue;
00065 
00066 };
00067 
00068 [scriptable, uuid(605db0f8-04a1-11d3-a50a-0060b0fc04b7)]
00069 interface nsIMsgFilter : nsISupports {
00070     attribute nsMsgFilterTypeType filterType;
00077     attribute boolean temporary;
00078     attribute boolean enabled;
00079     attribute wstring filterName;
00080     attribute string filterDesc;
00081     attribute string unparsedBuffer; //holds the entire filter if we don't know how to handle it
00082     attribute boolean unparseable;  //whether we could parse the filter or not
00083 
00084     readonly attribute nsIMsgFilterList filterList; // owning filter list
00085     
00086     void AddTerm(in nsMsgSearchAttribValue attrib,
00087                  in nsMsgSearchOpValue op,
00088                  in nsIMsgSearchValue value,
00089                  in boolean BooleanAND,
00090                  in string arbitraryHeader);
00091 
00092     void GetTerm(in long termIndex,
00093                  out nsMsgSearchAttribValue attrib,
00094                  out nsMsgSearchOpValue op,
00095                  out nsIMsgSearchValue value, // bad! using shared structure
00096                  out boolean BooleanAND,
00097                  out string arbitraryHeader);
00098 
00099     void appendTerm(in nsIMsgSearchTerm term);
00100 
00101     nsIMsgSearchTerm createTerm();
00102 
00103     attribute nsISupportsArray searchTerms;
00104 
00105     attribute nsIMsgSearchScopeTerm scope;
00106 
00107     // marking noscript because "headers" is actually a null-separated
00108     // list of headers, which is not scriptable
00109     [noscript] void MatchHdr(in nsIMsgDBHdr msgHdr, in nsIMsgFolder folder,
00110                   in nsIMsgDatabase db,
00111                   in string headers,
00112                   //                  [array, size_is(headerSize)] in string headers,
00113                   in unsigned long headerSize, out boolean result);
00114 
00115     void logRuleHit(in nsIMsgRuleAction aFilterAction, in nsIMsgDBHdr aHeader);
00116     nsIMsgRuleAction createAction();
00117 
00118     nsIMsgRuleAction getActionAt(in long aIndex);
00119 
00120     void appendAction(in nsIMsgRuleAction action);
00121 
00122     void clearActionList();
00123     void getSortedActionList(in nsISupportsArray actionList);  //will return an action list with moveAction (if present) as last one.
00124     readonly attribute nsISupportsArray actionList;
00125 };
00126