summaryrefslogtreecommitdiffstats
path: root/mailnews/base/src/nsMessenger.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/base/src/nsMessenger.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/base/src/nsMessenger.h')
-rw-r--r--mailnews/base/src/nsMessenger.h102
1 files changed, 102 insertions, 0 deletions
diff --git a/mailnews/base/src/nsMessenger.h b/mailnews/base/src/nsMessenger.h
new file mode 100644
index 000000000..9ba22e26e
--- /dev/null
+++ b/mailnews/base/src/nsMessenger.h
@@ -0,0 +1,102 @@
+/* -*- Mode: C++; tab-width: 2; 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 __nsMsgAppCore_h
+#define __nsMsgAppCore_h
+
+#include "nscore.h"
+#include "nsIMessenger.h"
+#include "nsCOMPtr.h"
+#include "nsITransactionManager.h"
+#include "nsIFile.h"
+#include "nsIDocShell.h"
+#include "nsIStringBundle.h"
+#include "nsIFile.h"
+#include "nsWeakReference.h"
+#include "mozIDOMWindow.h"
+#include "nsTArray.h"
+#include "nsIFolderListener.h"
+
+class nsMessenger : public nsIMessenger, public nsSupportsWeakReference, public nsIFolderListener
+{
+
+public:
+ nsMessenger();
+
+ NS_DECL_ISUPPORTS
+ NS_DECL_NSIMESSENGER
+ NS_DECL_NSIFOLDERLISTENER
+
+ nsresult Alert(const char * stringName);
+
+ nsresult SaveAttachment(nsIFile *file, const nsACString& unescapedUrl,
+ const nsACString& messageUri, const nsACString& contentType,
+ void *closure, nsIUrlListener *aListener);
+ nsresult PromptIfFileExists(nsIFile *file);
+ nsresult DetachAttachments(uint32_t aCount,
+ const char ** aContentTypeArray,
+ const char ** aUrlArray,
+ const char ** aDisplayNameArray,
+ const char ** aMessageUriArray,
+ nsTArray<nsCString> *saveFileUris,
+ bool withoutWarning = false);
+ nsresult SaveAllAttachments(uint32_t count,
+ const char **contentTypeArray,
+ const char **urlArray,
+ const char **displayNameArray,
+ const char **messageUriArray,
+ bool detaching);
+ nsresult SaveOneAttachment(const char* aContentType,
+ const char* aURL,
+ const char* aDisplayName,
+ const char* aMessageUri,
+ bool detaching);
+
+protected:
+ virtual ~nsMessenger();
+
+ void GetString(const nsString& aStringName, nsString& stringValue);
+ nsresult InitStringBundle();
+ nsresult PromptIfDeleteAttachments(bool saveFirst, uint32_t count, const char **displayNameArray);
+
+private:
+ nsresult GetLastSaveDirectory(nsIFile **aLastSaveAsDir);
+ // if aLocalFile is a dir, we use it. otherwise, we use the parent of aLocalFile.
+ nsresult SetLastSaveDirectory(nsIFile *aLocalFile);
+
+ nsresult AdjustFileIfNameTooLong(nsIFile* aFile);
+
+ nsresult GetSaveAsFile(const nsAString& aMsgFilename, int32_t *aSaveAsFileType,
+ nsIFile **aSaveAsFile);
+
+ nsresult GetSaveToDir(nsIFile **aSaveToDir);
+
+ nsString mId;
+ nsCOMPtr<nsITransactionManager> mTxnMgr;
+
+ /* rhp - need this to drive message display */
+ nsCOMPtr<mozIDOMWindowProxy> mWindow;
+ nsCOMPtr<nsIMsgWindow> mMsgWindow;
+ nsCOMPtr<nsIDocShell> mDocShell;
+
+ // String bundles...
+ nsCOMPtr<nsIStringBundle> mStringBundle;
+
+ nsCString mCurrentDisplayCharset;
+
+ nsCOMPtr<nsISupports> mSearchContext;
+ nsCString mLastDisplayURI; // this used when the user attempts to force a charset reload of a message...we need to get the last displayed
+ // uri so we can re-display it..
+ nsCString mNavigatingToUri;
+ nsTArray<nsCString> mLoadedMsgHistory;
+ int32_t mCurHistoryPos;
+};
+
+#define NS_MESSENGER_CID \
+{ /* f436a174-e2c0-4955-9afe-e3feb68aee56 */ \
+ 0xf436a174, 0xe2c0, 0x4955, \
+ {0x9a, 0xfe, 0xe3, 0xfe, 0xb6, 0x8a, 0xee, 0x56}}
+
+#endif