From 302bf1b523012e11b60425d6eee1221ebc2724eb Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Sun, 3 Nov 2019 00:17:46 -0400 Subject: Issue #1258 - Part 1: Import mailnews, ldap, and mork from comm-esr52.9.1 --- mailnews/base/src/nsMessengerUnixIntegration.h | 63 ++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 mailnews/base/src/nsMessengerUnixIntegration.h (limited to 'mailnews/base/src/nsMessengerUnixIntegration.h') 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 mFoldersWithNewMail; // keep track of all the root folders with pending new mail + nsCOMPtr mBiffStateAtom; + nsCOMPtr mNewMailReceivedAtom; + bool mAlertInProgress; + nsDataHashtable mLastMRUTimes; // We keep track of the last time we did a new mail notification for each account + nsTArray mFetchingURIs; +}; + +#endif // __nsMessengerUnixIntegration_h -- cgit v1.2.3