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/util/nsMsgTxn.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/util/nsMsgTxn.h')
-rw-r--r-- | mailnews/base/util/nsMsgTxn.h | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/mailnews/base/util/nsMsgTxn.h b/mailnews/base/util/nsMsgTxn.h new file mode 100644 index 000000000..5c34de4d4 --- /dev/null +++ b/mailnews/base/util/nsMsgTxn.h @@ -0,0 +1,73 @@ +/* -*- 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 nsMsgTxn_h__ +#define nsMsgTxn_h__ + +#include "mozilla/Attributes.h" +#include "nsITransaction.h" +#include "msgCore.h" +#include "nsCOMPtr.h" +#include "nsIMsgWindow.h" +#include "nsInterfaceHashtable.h" +#include "MailNewsTypes2.h" +#include "nsIVariant.h" +#include "nsIWritablePropertyBag.h" +#include "nsIWritablePropertyBag2.h" + +#define NS_MESSAGETRANSACTION_IID \ +{ /* da621b30-1efc-11d3-abe4-00805f8ac968 */ \ + 0xda621b30, 0x1efc, 0x11d3, \ + { 0xab, 0xe4, 0x00, 0x80, 0x5f, 0x8a, 0xc9, 0x68 } } +/** + * base class for all message undo/redo transactions. + */ + +#undef IMETHOD_VISIBILITY +#define IMETHOD_VISIBILITY NS_VISIBILITY_DEFAULT + +class NS_MSG_BASE nsMsgTxn : public nsITransaction, + public nsIWritablePropertyBag, + public nsIWritablePropertyBag2 +{ +public: + nsMsgTxn(); + + nsresult Init(); + + NS_IMETHOD DoTransaction(void) override; + + NS_IMETHOD UndoTransaction(void) override = 0; + + NS_IMETHOD RedoTransaction(void) override = 0; + + NS_IMETHOD GetIsTransient(bool *aIsTransient) override; + + NS_IMETHOD Merge(nsITransaction *aTransaction, bool *aDidMerge) override; + + nsresult GetMsgWindow(nsIMsgWindow **msgWindow); + nsresult SetMsgWindow(nsIMsgWindow *msgWindow); + nsresult SetTransactionType(uint32_t txnType); + + NS_DECL_THREADSAFE_ISUPPORTS + NS_DECL_NSIPROPERTYBAG + NS_DECL_NSIPROPERTYBAG2 + NS_DECL_NSIWRITABLEPROPERTYBAG + NS_DECL_NSIWRITABLEPROPERTYBAG2 + +protected: + virtual ~nsMsgTxn(); + + // a hash table of string -> nsIVariant + nsInterfaceHashtable<nsStringHashKey, nsIVariant> mPropertyHash; + nsCOMPtr<nsIMsgWindow> m_msgWindow; + uint32_t m_txnType; + nsresult CheckForToggleDelete(nsIMsgFolder *aFolder, const nsMsgKey &aMsgKey, bool *aResult); +}; + +#undef IMETHOD_VISIBILITY +#define IMETHOD_VISIBILITY NS_VISIBILITY_HIDDEN + +#endif |