diff options
author | Matt A. Tobin <email@mattatobin.com> | 2019-11-03 00:17:46 -0400 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2019-11-03 00:17:46 -0400 |
commit | 302bf1b523012e11b60425d6eee1221ebc2724eb (patch) | |
tree | b191a895f8716efcbe42f454f37597a545a6f421 /mailnews/import/becky/src/nsBeckyFilters.h | |
parent | 21b3f6247403c06f85e1f45d219f87549862198f (diff) | |
download | UXP-302bf1b523012e11b60425d6eee1221ebc2724eb.tar UXP-302bf1b523012e11b60425d6eee1221ebc2724eb.tar.gz UXP-302bf1b523012e11b60425d6eee1221ebc2724eb.tar.lz UXP-302bf1b523012e11b60425d6eee1221ebc2724eb.tar.xz UXP-302bf1b523012e11b60425d6eee1221ebc2724eb.zip |
Issue #1258 - Part 1: Import mailnews, ldap, and mork from comm-esr52.9.1
Diffstat (limited to 'mailnews/import/becky/src/nsBeckyFilters.h')
-rw-r--r-- | mailnews/import/becky/src/nsBeckyFilters.h | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/mailnews/import/becky/src/nsBeckyFilters.h b/mailnews/import/becky/src/nsBeckyFilters.h new file mode 100644 index 000000000..20dd6d5ee --- /dev/null +++ b/mailnews/import/becky/src/nsBeckyFilters.h @@ -0,0 +1,77 @@ +/* vim: set ts=2 et sw=2 tw=80: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +#ifndef nsBeckyFilters_h___ +#define nsBeckyFilters_h___ + +#include "nsIImportFilters.h" +#include "nsIFile.h" +#include "nsIMsgIncomingServer.h" +#include "nsMsgFilterCore.h" + +class nsIMsgFilter; +class nsIMsgRuleAction; +class nsCString; + +class nsBeckyFilters final : public nsIImportFilters +{ +public: + nsBeckyFilters(); + static nsresult Create(nsIImportFilters **aImport); + + NS_DECL_ISUPPORTS + NS_DECL_NSIIMPORTFILTERS + +private: + virtual ~nsBeckyFilters(); + + nsCOMPtr<nsIFile> mLocation; + nsCOMPtr<nsIMsgIncomingServer> mServer; + nsCOMPtr<nsIFile> mConvertedFile; + + nsresult GetDefaultFilterLocation(nsIFile **aFile); + nsresult GetFilterFile(bool aIncoming, nsIFile *aLocation, nsIFile **aFile); + nsresult ParseFilterFile(nsIFile *aFile, bool aIncoming); + nsresult ParseRuleLine(const nsCString &aLine, + nsMsgSearchAttribValue *aSearchAttribute, + nsMsgSearchOpValue *aSearchOperator, + nsString &aSearchKeyword); + nsresult CollectServers(); + nsresult FindMessageFolder(const nsAString& aName, + nsIMsgFolder *aParantFolder, + nsIMsgFolder **_retval); + nsresult FindMessageFolderInServer(const nsAString& aName, + nsIMsgIncomingServer *aServer, + nsIMsgFolder **_retval); + nsresult GetMessageFolder(const nsAString& aName, nsIMsgFolder **_retval); + nsresult GetActionTarget(const nsCString &aLine, nsCString &aTarget); + nsresult GetFolderNameFromTarget(const nsCString &aTarget, nsAString &aName); + nsresult GetDistributeTarget(const nsCString &aLine, + nsCString &aTargetFolder); + nsresult GetResendTarget(const nsCString &aLine, + nsCString &aTemplate, + nsCString &aTargetAddress); + nsresult CreateRuleAction(nsIMsgFilter *aFilter, + nsMsgRuleActionType actionType, + nsIMsgRuleAction **_retval); + nsresult CreateDistributeAction(const nsCString &aLine, + nsIMsgFilter *aFilter, + const nsMsgRuleActionType &aActionType, + nsIMsgRuleAction **_retval); + nsresult CreateLeaveOrDeleteAction(const nsCString &aLine, + nsIMsgFilter *aFilter, + nsIMsgRuleAction **_retval); + nsresult CreateResendAction(const nsCString &aLine, + nsIMsgFilter *aFilter, + const nsMsgRuleActionType &aActionType, + nsIMsgRuleAction **_retval); + nsresult CreateFilter(bool aIncoming, nsIMsgFilter **_retval); + nsresult AppendFilter(nsIMsgFilter *aFilter); + nsresult SetRuleAction(const nsCString &aLine, nsIMsgFilter *aFilter); + nsresult SetSearchTerm(const nsCString &aLine, nsIMsgFilter *aFilter); + nsresult RemoveConvertedFile(); +}; + +#endif /* nsBeckyFilters_h___ */ |