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 nsIAbsorbingTransaction_h__
7 #define nsIAbsorbingTransaction_h__
8 
9 #include "nsISupports.h"
10 
11 /*
12 Transaction interface to outside world
13 */
14 
15 #define NS_IABSORBINGTRANSACTION_IID                 \
16   { /* a6cf9116-15b3-11d2-932e-00805f8add32 */       \
17     0xa6cf9116, 0x15b3, 0x11d2, {                    \
18       0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32 \
19     }                                                \
20   }
21 
22 class nsAtom;
23 
24 namespace mozilla {
25 class EditorBase;
26 class PlaceholderTransaction;
27 class SelectionState;
28 }  // namespace mozilla
29 
30 /**
31  * A transaction interface mixin - for transactions that can support.
32  * the placeholder absorbtion idiom.
33  */
34 class nsIAbsorbingTransaction : public nsISupports {
35  public:
36   NS_DECLARE_STATIC_IID_ACCESSOR(NS_IABSORBINGTRANSACTION_IID)
37 
38   NS_IMETHOD EndPlaceHolderBatch() = 0;
39 
40   NS_IMETHOD GetTxnName(nsAtom** aName) = 0;
41 
42   NS_IMETHOD StartSelectionEquals(mozilla::SelectionState* aSelState,
43                                   bool* aResult) = 0;
44 
45   NS_IMETHOD ForwardEndBatchTo(nsIAbsorbingTransaction* aForwardingAddress) = 0;
46 
47   NS_IMETHOD Commit() = 0;
48 
49   NS_IMETHOD_(mozilla::PlaceholderTransaction*)
50   AsPlaceholderTransaction() = 0;
51 };
52 
53 NS_DEFINE_STATIC_IID_ACCESSOR(nsIAbsorbingTransaction,
54                               NS_IABSORBINGTRANSACTION_IID)
55 
56 #endif  // nsIAbsorbingTransaction_h__
57