summaryrefslogtreecommitdiffstats
path: root/mailnews/local/src/nsMailboxUrl.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/local/src/nsMailboxUrl.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/local/src/nsMailboxUrl.h')
-rw-r--r--mailnews/local/src/nsMailboxUrl.h110
1 files changed, 110 insertions, 0 deletions
diff --git a/mailnews/local/src/nsMailboxUrl.h b/mailnews/local/src/nsMailboxUrl.h
new file mode 100644
index 000000000..63973a916
--- /dev/null
+++ b/mailnews/local/src/nsMailboxUrl.h
@@ -0,0 +1,110 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* 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 nsMailboxUrl_h__
+#define nsMailboxUrl_h__
+
+#include "mozilla/Attributes.h"
+#include "nsIMailboxUrl.h"
+#include "nsMsgMailNewsUrl.h"
+#include "nsIStreamListener.h"
+#include "nsIFile.h"
+#include "nsCOMPtr.h"
+#include "MailNewsTypes.h"
+#include "nsTArray.h"
+
+class nsMailboxUrl : public nsIMailboxUrl, public nsMsgMailNewsUrl, public nsIMsgMessageUrl, public nsIMsgI18NUrl
+{
+public:
+ // nsIURI over-ride...
+ NS_IMETHOD SetSpec(const nsACString &aSpec) override;
+ NS_IMETHOD SetQuery(const nsACString &aQuery) override;
+
+ // from nsIMailboxUrl:
+ NS_IMETHOD SetMailboxParser(nsIStreamListener * aConsumer) override;
+ NS_IMETHOD GetMailboxParser(nsIStreamListener ** aConsumer) override;
+ NS_IMETHOD SetMailboxCopyHandler(nsIStreamListener * aConsumer) override;
+ NS_IMETHOD GetMailboxCopyHandler(nsIStreamListener ** aConsumer) override;
+
+ NS_IMETHOD GetMessageKey(nsMsgKey* aMessageKey) override;
+ NS_IMETHOD GetMessageSize(uint32_t *aMessageSize) override;
+ NS_IMETHOD SetMessageSize(uint32_t aMessageSize) override;
+ NS_IMETHOD GetMailboxAction(nsMailboxAction *result) override
+ {
+ NS_ENSURE_ARG_POINTER(result);
+ *result = m_mailboxAction;
+ return NS_OK;
+ }
+ NS_IMETHOD SetMailboxAction(nsMailboxAction aAction) override
+ {
+ m_mailboxAction = aAction;
+ return NS_OK;
+ }
+ NS_IMETHOD IsUrlType(uint32_t type, bool *isType) override;
+ NS_IMETHOD SetMoveCopyMsgKeys(nsMsgKey *keysToFlag, int32_t numKeys) override;
+ NS_IMETHOD GetMoveCopyMsgHdrForIndex(uint32_t msgIndex, nsIMsgDBHdr **msgHdr) override;
+ NS_IMETHOD GetNumMoveCopyMsgs(uint32_t *numMsgs) override;
+ NS_IMETHOD GetCurMoveCopyMsgIndex(uint32_t *result) override
+ {
+ NS_ENSURE_ARG_POINTER(result);
+ *result = m_curMsgIndex;
+ return NS_OK;
+ }
+ NS_IMETHOD SetCurMoveCopyMsgIndex(uint32_t aIndex) override
+ {
+ m_curMsgIndex = aIndex;
+ return NS_OK;
+ }
+
+ NS_IMETHOD GetFolder(nsIMsgFolder **msgFolder) override;
+
+ // nsIMsgMailNewsUrl override
+ NS_IMETHOD CloneInternal(uint32_t aRefHandlingMode,
+ const nsACString& newRef,
+ nsIURI **_retval) override;
+
+ // nsMailboxUrl
+ nsMailboxUrl();
+ NS_DECL_NSIMSGMESSAGEURL
+ NS_DECL_ISUPPORTS_INHERITED
+ NS_DECL_NSIMSGI18NURL
+
+protected:
+ virtual ~nsMailboxUrl();
+ // protocol specific code to parse a url...
+ virtual nsresult ParseUrl();
+ nsresult GetMsgHdrForKey(nsMsgKey msgKey, nsIMsgDBHdr ** aMsgHdr);
+
+ // mailboxurl specific state
+ nsCOMPtr<nsIStreamListener> m_mailboxParser;
+ nsCOMPtr<nsIStreamListener> m_mailboxCopyHandler;
+
+ nsMailboxAction m_mailboxAction; // the action this url represents...parse mailbox, display messages, etc.
+ nsCOMPtr <nsIFile> m_filePath;
+ char *m_messageID;
+ uint32_t m_messageSize;
+ nsMsgKey m_messageKey;
+ nsCString m_file;
+ // This is currently only set when we're doing something with a .eml file.
+ // If that changes, we should change the name of this var.
+ nsCOMPtr<nsIMsgDBHdr> m_dummyHdr;
+
+ // used by save message to disk
+ nsCOMPtr<nsIFile> m_messageFile;
+ bool m_addDummyEnvelope;
+ bool m_canonicalLineEnding;
+ nsresult ParseSearchPart();
+
+ // for multiple msg move/copy
+ nsTArray<nsMsgKey> m_keys;
+ int32_t m_curMsgIndex;
+
+ // truncated message support
+ nsCString m_originalSpec;
+ nsCString mURI; // the RDF URI associated with this url.
+ nsCString mCharsetOverride; // used by nsIMsgI18NUrl...
+};
+
+#endif // nsMailboxUrl_h__