summaryrefslogtreecommitdiffstats
path: root/mailnews/import/outlook/src/nsOutlookMail.h
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2019-11-03 00:17:46 -0400
committerMatt A. Tobin <email@mattatobin.com>2019-11-03 00:17:46 -0400
commit302bf1b523012e11b60425d6eee1221ebc2724eb (patch)
treeb191a895f8716efcbe42f454f37597a545a6f421 /mailnews/import/outlook/src/nsOutlookMail.h
parent21b3f6247403c06f85e1f45d219f87549862198f (diff)
downloadUXP-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/outlook/src/nsOutlookMail.h')
-rw-r--r--mailnews/import/outlook/src/nsOutlookMail.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/mailnews/import/outlook/src/nsOutlookMail.h b/mailnews/import/outlook/src/nsOutlookMail.h
new file mode 100644
index 000000000..3aa317ece
--- /dev/null
+++ b/mailnews/import/outlook/src/nsOutlookMail.h
@@ -0,0 +1,54 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* 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 nsOutlookMail_h___
+#define nsOutlookMail_h___
+
+#include "nsIArray.h"
+#include "nsStringGlue.h"
+#include "nsOutlookCompose.h"
+#include "nsIFile.h"
+#include "MapiApi.h"
+#include "MapiMessage.h"
+#include "nsIAddrDatabase.h"
+
+class nsIAddrDatabase;
+class nsIImportFieldMap;
+
+class nsOutlookMail {
+public:
+ nsOutlookMail();
+ ~nsOutlookMail();
+
+ nsresult GetMailFolders(nsIArray **pArray);
+ nsresult GetAddressBooks(nsIArray **pArray);
+ nsresult ImportMailbox(uint32_t *pDoneSoFar, bool *pAbort, int32_t index,
+ const char16_t *pName, nsIMsgFolder *pDest,
+ int32_t *pMsgCount);
+ static nsresult ImportMessage(LPMESSAGE lpMsg, nsIOutputStream *destOutputStream, nsMsgDeliverMode mode);
+ nsresult ImportAddresses(uint32_t *pCount, uint32_t *pTotal, const char16_t *pName, uint32_t id, nsIAddrDatabase *pDb, nsString& errors);
+private:
+ void OpenMessageStore(CMapiFolder *pNextFolder);
+ static BOOL WriteData(nsIOutputStream *pDest, const char *pData, int32_t len);
+
+ bool IsAddressBookNameUnique(nsString& name, nsString& list);
+ void MakeAddressBookNameUnique(nsString& name, nsString& list);
+ void SanitizeValue(nsString& val);
+ void SplitString(nsString& val1, nsString& val2);
+ bool BuildCard(const char16_t *pName, nsIAddrDatabase *pDb, nsIMdbRow *newRow, LPMAPIPROP pUser, nsIImportFieldMap *pFieldMap);
+ nsresult CreateList(const char16_t * pName, nsIAddrDatabase *pDb, LPMAPIPROP pUserList, nsIImportFieldMap *pFieldMap);
+
+private:
+ bool m_gotFolders;
+ bool m_gotAddresses;
+ bool m_haveMapi;
+ CMapiApi m_mapi;
+ CMapiFolderList m_folderList;
+ CMapiFolderList m_addressList;
+ CMapiFolderList m_storeList;
+ LPMDB m_lpMdb;
+};
+
+#endif /* nsOutlookMail_h___ */