gecko-dev/mailnews/base/search/public/nsIMsgFilterList.idl

115 строки
4.6 KiB
Plaintext

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
*
* The contents of this file are subject to the Netscape Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1999 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
#include "nsISupports.idl"
#include "nsMsgFilterCore.idl"
#include "nsIMsgFilter.idl"
#include "nsIMsgFilterHitNotify.idl"
interface nsIOFileStream;
///////////////////////////////////////////////////////////////////////////////
// The Msg Filter List is an interface designed to make accessing filter lists
// easier. Clients typically open a filter list and either enumerate the filters,
// or add new filters, or change the order around...
//
///////////////////////////////////////////////////////////////////////////////
typedef long nsMsgFilterFileAttribValue;
[scriptable, uuid(08ecbcb4-0493-11d3-a50a-0060b0fc04b7)]
interface nsIMsgFilterList : nsISupports {
const nsMsgFilterFileAttribValue attribNone = 0;
const nsMsgFilterFileAttribValue attribVersion = 1;
const nsMsgFilterFileAttribValue attribLogging = 2;
const nsMsgFilterFileAttribValue attribName = 3;
const nsMsgFilterFileAttribValue attribEnabled = 4;
const nsMsgFilterFileAttribValue attribDescription = 5;
const nsMsgFilterFileAttribValue attribType = 6;
const nsMsgFilterFileAttribValue attribScriptFile = 7;
const nsMsgFilterFileAttribValue attribAction = 8;
const nsMsgFilterFileAttribValue attribActionValue = 9;
const nsMsgFilterFileAttribValue attribCondition = 10;
attribute nsIMsgFolder folder;
readonly attribute short version;
readonly attribute unsigned long filterCount;
nsIMsgFilter getFilterAt(in unsigned long filterIndex);
nsIMsgFilter getFilterNamed(in wstring filterName);
void setFilterAt(in unsigned long filterIndex, in nsIMsgFilter filter);
void removeFilter(in nsIMsgFilter filter);
void removeFilterAt(in unsigned long filterIndex);
void moveFilterAt(in unsigned long filterIndex,
in nsMsgFilterMotionValue motion);
void moveFilter(in nsIMsgFilter filter,
in nsMsgFilterMotionValue motion);
void insertFilterAt(in unsigned long filterIndex, in nsIMsgFilter filter);
attribute boolean loggingEnabled;
nsIMsgFilter createFilter(in wstring name);
void saveToFile(in nsIOFileStream stream);
// this is temporary so that we can save the filterlist to disk
// without knowing where the filters were read from intially
// (such as the filter list dialog)
attribute nsIFileSpec defaultFile;
void saveToDefaultFile();
// marking noscript because headers is a null-seperated list
// of strings, which is not scriptable
[noscript]
void applyFiltersToHdr(in nsMsgFilterTypeType filterType,
in nsIMsgDBHdr msgHdr,
in nsIMsgFolder folder,
in nsIMsgDatabase db,
in string headers,
//[array, size_is(headerSize)] in string headers,
in unsigned long headerSize,
in nsIMsgFilterHitNotify listener,
in nsIMsgWindow msgWindow);
// IO routines, used by filter object filing code.
void writeIntAttr(in nsMsgFilterFileAttribValue attrib, in long value, in nsIOFileStream stream);
void writeStrAttr(in nsMsgFilterFileAttribValue attrib, in string value, in nsIOFileStream stream);
void writeWstrAttr(in nsMsgFilterFileAttribValue attrib, in wstring value, in nsIOFileStream stream);
void writeBoolAttr(in nsMsgFilterFileAttribValue attrib, in boolean value, in nsIOFileStream stream);
boolean changeFilterTarget(in string oldUri, in string newUri, in boolean caseInsensitive);
};
/* these longs are all actually of type nsMsgFilterMotionValue */
[scriptable, uuid(d067b528-304e-11d3-a0e1-00a0c900d445)]
interface nsMsgFilterMotion {
const long up = 0;
const long down = 1;
};