1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include "mozilla/EditTransactionBase.h"
8 #include "ChangeAttributeTransaction.h"
9 #include "ChangeStyleTransaction.h"
10 #include "CompositionTransaction.h"
11 #include "CreateElementTransaction.h"
12 #include "DeleteNodeTransaction.h"
13 #include "DeleteRangeTransaction.h"
14 #include "DeleteTextTransaction.h"
15 #include "EditAggregateTransaction.h"
16 #include "InsertNodeTransaction.h"
17 #include "InsertTextTransaction.h"
18 #include "JoinNodeTransaction.h"
19 #include "PlaceholderTransaction.h"
20 #include "ReplaceTextTransaction.h"
21 #include "SplitNodeTransaction.h"
24 #include "nsISupportsBase.h"
28 NS_IMPL_CYCLE_COLLECTION_CLASS(EditTransactionBase
)
30 NS_IMPL_CYCLE_COLLECTION_UNLINK_0(EditTransactionBase
)
31 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(EditTransactionBase
)
32 // We don't have anything to traverse, but some of our subclasses do.
33 NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
35 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(EditTransactionBase
)
36 NS_INTERFACE_MAP_ENTRY(nsITransaction
)
37 NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports
, nsITransaction
)
40 NS_IMPL_CYCLE_COLLECTING_ADDREF(EditTransactionBase
)
41 NS_IMPL_CYCLE_COLLECTING_RELEASE(EditTransactionBase
)
43 NS_IMETHODIMP
EditTransactionBase::RedoTransaction() { return DoTransaction(); }
45 NS_IMETHODIMP
EditTransactionBase::GetIsTransient(bool* aIsTransient
) {
46 *aIsTransient
= false;
51 NS_IMETHODIMP
EditTransactionBase::Merge(nsITransaction
* aOtherTransaction
,
57 #define NS_IMPL_EDITTRANSACTIONBASE_GETASMETHODS(aClass) \
58 aClass* EditTransactionBase::GetAs##aClass() { return nullptr; } \
59 const aClass* EditTransactionBase::GetAs##aClass() const { return nullptr; }
61 NS_IMPL_EDITTRANSACTIONBASE_GETASMETHODS(ChangeAttributeTransaction
)
62 NS_IMPL_EDITTRANSACTIONBASE_GETASMETHODS(ChangeStyleTransaction
)
63 NS_IMPL_EDITTRANSACTIONBASE_GETASMETHODS(CompositionTransaction
)
64 NS_IMPL_EDITTRANSACTIONBASE_GETASMETHODS(CreateElementTransaction
)
65 NS_IMPL_EDITTRANSACTIONBASE_GETASMETHODS(DeleteNodeTransaction
)
66 NS_IMPL_EDITTRANSACTIONBASE_GETASMETHODS(DeleteRangeTransaction
)
67 NS_IMPL_EDITTRANSACTIONBASE_GETASMETHODS(DeleteTextTransaction
)
68 NS_IMPL_EDITTRANSACTIONBASE_GETASMETHODS(EditAggregateTransaction
)
69 NS_IMPL_EDITTRANSACTIONBASE_GETASMETHODS(InsertNodeTransaction
)
70 NS_IMPL_EDITTRANSACTIONBASE_GETASMETHODS(InsertTextTransaction
)
71 NS_IMPL_EDITTRANSACTIONBASE_GETASMETHODS(JoinNodeTransaction
)
72 NS_IMPL_EDITTRANSACTIONBASE_GETASMETHODS(PlaceholderTransaction
)
73 NS_IMPL_EDITTRANSACTIONBASE_GETASMETHODS(ReplaceTextTransaction
)
74 NS_IMPL_EDITTRANSACTIONBASE_GETASMETHODS(SplitNodeTransaction
)
76 #undef NS_IMPL_EDITTRANSACTIONBASE_GETASMETHODS
78 } // namespace mozilla