Bug 1931425 - Limit how often moz-label's #setStyles runs r=reusable-components-revie...
[gecko.git] / editor / libeditor / EditAggregateTransaction.h
blob2017d4f7ffeaf29ed2dcc505ed32dab55505af4a
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 #ifndef EditAggregateTransaction_h
7 #define EditAggregateTransaction_h
9 #include "EditTransactionBase.h"
11 #include "mozilla/OwningNonNull.h"
12 #include "mozilla/RefPtr.h"
14 #include "nsAtom.h"
15 #include "nsCOMPtr.h"
16 #include "nsCycleCollectionParticipant.h"
17 #include "nsTArray.h"
18 #include "nsISupportsImpl.h"
20 namespace mozilla {
22 /**
23 * base class for all document editing transactions that require aggregation.
24 * provides a list of child transactions.
26 class EditAggregateTransaction : public EditTransactionBase {
27 public:
28 NS_DECL_ISUPPORTS_INHERITED
29 NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(EditAggregateTransaction,
30 EditTransactionBase)
32 NS_DECL_EDITTRANSACTIONBASE
34 MOZ_CAN_RUN_SCRIPT NS_IMETHOD RedoTransaction() override;
35 NS_IMETHOD Merge(nsITransaction* aOtherTransaction, bool* aDidMerge) override;
37 /**
38 * Get the name assigned to this transaction.
40 nsAtom* GetName() const;
42 const nsTArray<OwningNonNull<EditTransactionBase>>& ChildTransactions()
43 const {
44 return mChildren;
47 protected:
48 EditAggregateTransaction() = default;
49 virtual ~EditAggregateTransaction() = default;
51 nsTArray<OwningNonNull<EditTransactionBase>> mChildren;
52 RefPtr<nsAtom> mName;
55 } // namespace mozilla
57 #endif // #ifndef EditAggregateTransaction_h