gecko-dev/editor/txmgr/TransactionManager.h
Masayuki Nakano c525b695b9 Bug 1447924 - part 1: Rename nsTransactionManager to mozilla::TransactionManager r=m_kato
We should rename nsTransactionManager to mozilla::TransactionManager before
adding new non-virtual methods.

MozReview-Commit-ID: JsivNVfDhex

--HG--
rename : editor/txmgr/nsTransactionManager.cpp => editor/txmgr/TransactionManager.cpp
rename : editor/txmgr/nsTransactionManager.h => editor/txmgr/TransactionManager.h
rename : editor/txmgr/nsTransactionManagerFactory.cpp => editor/txmgr/TransactionManagerFactory.cpp
extra : rebase_source : ff5bf76fec8be8f6a1202c17d488cf6c607d8f03
2018-03-22 22:15:54 +09:00

74 lines
2.6 KiB
C++

/* -*- 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 mozilla_TransactionManager_h
#define mozilla_TransactionManager_h
#include "nsCOMArray.h"
#include "nsCOMPtr.h"
#include "nsCycleCollectionParticipant.h"
#include "nsTransactionStack.h"
#include "nsISupportsImpl.h"
#include "nsITransactionManager.h"
#include "nsTransactionStack.h"
#include "nsWeakReference.h"
#include "nscore.h"
class nsITransaction;
class nsITransactionListener;
namespace mozilla {
class TransactionManager final : public nsITransactionManager
, public nsSupportsWeakReference
{
public:
explicit TransactionManager(int32_t aMaxTransactionCount = -1);
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(TransactionManager,
nsITransactionManager)
NS_DECL_NSITRANSACTIONMANAGER
already_AddRefed<nsITransaction> PeekUndoStack();
already_AddRefed<nsITransaction> PeekRedoStack();
nsresult WillDoNotify(nsITransaction* aTransaction, bool* aInterrupt);
nsresult DidDoNotify(nsITransaction* aTransaction, nsresult aExecuteResult);
nsresult WillUndoNotify(nsITransaction* aTransaction, bool* aInterrupt);
nsresult DidUndoNotify(nsITransaction* aTransaction, nsresult aUndoResult);
nsresult WillRedoNotify(nsITransaction* aTransaction, bool *aInterrupt);
nsresult DidRedoNotify(nsITransaction* aTransaction, nsresult aRedoResult);
nsresult WillBeginBatchNotify(bool* aInterrupt);
nsresult DidBeginBatchNotify(nsresult aResult);
nsresult WillEndBatchNotify(bool* aInterrupt);
nsresult DidEndBatchNotify(nsresult aResult);
nsresult WillMergeNotify(nsITransaction* aTop,
nsITransaction* aTransaction,
bool* aInterrupt);
nsresult DidMergeNotify(nsITransaction* aTop,
nsITransaction* aTransaction,
bool aDidMerge,
nsresult aMergeResult);
private:
virtual ~TransactionManager() = default;
nsresult BeginTransaction(nsITransaction* aTransaction,
nsISupports* aData);
nsresult EndTransaction(bool aAllowEmpty);
int32_t mMaxTransactionCount;
nsTransactionStack mDoStack;
nsTransactionStack mUndoStack;
nsTransactionStack mRedoStack;
nsCOMArray<nsITransactionListener> mListeners;
};
} // namespace mozilla
#endif // #ifndef mozilla_TransactionManager_h