Line data Source code
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/. */
5 :
6 : #ifndef EditAggregateTransaction_h
7 : #define EditAggregateTransaction_h
8 :
9 : #include "mozilla/EditTransactionBase.h"
10 : #include "nsCOMPtr.h"
11 : #include "nsCycleCollectionParticipant.h"
12 : #include "nsIAtom.h"
13 : #include "nsISupportsImpl.h"
14 : #include "nsTArray.h"
15 : #include "nscore.h"
16 :
17 : class nsITransaction;
18 :
19 : namespace mozilla {
20 :
21 : /**
22 : * base class for all document editing transactions that require aggregation.
23 : * provides a list of child transactions.
24 : */
25 : class EditAggregateTransaction : public EditTransactionBase
26 : {
27 : public:
28 : EditAggregateTransaction();
29 :
30 : NS_DECL_ISUPPORTS_INHERITED
31 0 : NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(EditAggregateTransaction,
32 : EditTransactionBase)
33 :
34 : NS_DECL_EDITTRANSACTIONBASE
35 :
36 : NS_IMETHOD RedoTransaction() override;
37 : NS_IMETHOD Merge(nsITransaction* aTransaction, bool* aDidMerge) override;
38 :
39 : /**
40 : * Append a transaction to this aggregate.
41 : */
42 : NS_IMETHOD AppendChild(EditTransactionBase* aTransaction);
43 :
44 : /**
45 : * Get the name assigned to this transaction.
46 : */
47 : NS_IMETHOD GetName(nsIAtom** aName);
48 :
49 : protected:
50 : virtual ~EditAggregateTransaction();
51 :
52 : nsTArray<RefPtr<EditTransactionBase>> mChildren;
53 : nsCOMPtr<nsIAtom> mName;
54 : };
55 :
56 : } // namespace mozilla
57 :
58 : #endif // #ifndef EditAggregateTransaction_h
|