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/base/src/nsMessengerUnixIntegration.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/base/src/nsMessengerUnixIntegration.h')
-rw-r--r-- | mailnews/base/src/nsMessengerUnixIntegration.h | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/mailnews/base/src/nsMessengerUnixIntegration.h b/mailnews/base/src/nsMessengerUnixIntegration.h new file mode 100644 index 000000000..ba9f0f3f5 --- /dev/null +++ b/mailnews/base/src/nsMessengerUnixIntegration.h @@ -0,0 +1,63 @@ +/* -*- 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 __nsMessengerUnixIntegration_h +#define __nsMessengerUnixIntegration_h + +#include "nsIMessengerOSIntegration.h" +#include "nsIFolderListener.h" +#include "nsIUrlListener.h" +#include "nsIMutableArray.h" +#include "nsIStringBundle.h" +#include "nsIObserver.h" +#include "nsIAtom.h" +#include "nsDataHashtable.h" +#include "nsTArray.h" + +#define NS_MESSENGERUNIXINTEGRATION_CID \ + {0xf62f3d3a, 0x1dd1, 0x11b2, \ + {0xa5, 0x16, 0xef, 0xad, 0xb1, 0x31, 0x61, 0x5c}} + +class nsIStringBundle; + +class nsMessengerUnixIntegration : public nsIFolderListener, + public nsIObserver, + public nsIUrlListener, + public nsIMessengerOSIntegration +{ +public: + nsMessengerUnixIntegration(); + virtual nsresult Init(); + + NS_DECL_ISUPPORTS + NS_DECL_NSIMESSENGEROSINTEGRATION + NS_DECL_NSIFOLDERLISTENER + NS_DECL_NSIOBSERVER + NS_DECL_NSIURLLISTENER + +private: + virtual ~nsMessengerUnixIntegration() {} + nsresult ShowAlertMessage(const nsAString& aAlertTitle, const nsAString& aAlertText, const nsACString& aFolderURI); + nsresult GetFirstFolderWithNewMail(nsACString& aFolderURI); + nsresult GetStringBundle(nsIStringBundle **aBundle); + nsresult AlertFinished(); + nsresult AlertClicked(); + void FillToolTipInfo(); + nsresult GetMRUTimestampForFolder(nsIMsgFolder *aFolder, uint32_t *aLastMRUTime); + + bool BuildNotificationBody(nsIMsgDBHdr *aHdr, nsIStringBundle *Bundle, nsString &aBody); + bool BuildNotificationTitle(nsIMsgFolder *aFolder, nsIStringBundle *aBundle, nsString &aTitle); + nsresult ShowNewAlertNotification(bool aUserInitiated); + nsresult PutMRUTimestampForFolder(nsIMsgFolder *aFolder, uint32_t aLastMRUTime); + + nsCOMPtr<nsIMutableArray> mFoldersWithNewMail; // keep track of all the root folders with pending new mail + nsCOMPtr<nsIAtom> mBiffStateAtom; + nsCOMPtr<nsIAtom> mNewMailReceivedAtom; + bool mAlertInProgress; + nsDataHashtable<nsCStringHashKey, uint32_t> mLastMRUTimes; // We keep track of the last time we did a new mail notification for each account + nsTArray<nsCString> mFetchingURIs; +}; + +#endif // __nsMessengerUnixIntegration_h |