editor/libeditor/nsIAbsorbingTransaction.h
author Nicolas B. Pierron <nicolas.b.pierron@mozilla.com>
Tue, 31 Mar 2015 14:30:41 +0200
changeset 266631 87a4a036587ce1e8f0bf98fa2449d251ecd902fa
parent 221386 f05a36b5b90df34e0d5973641d160fdd7787df68
child 270306 d47f66ce3822cd4b95c99b3c0b123584486d119c
permissions -rw-r--r--
Bug 1134626 part 1 - Move all x86-shared files into their own directory. r=jandem

/* -*- 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 nsIAbsorbingTransaction_h__
#define nsIAbsorbingTransaction_h__

#include "nsISupports.h"

/*
Transaction interface to outside world
*/

#define NS_IABSORBINGTRANSACTION_IID \
{ /* a6cf9116-15b3-11d2-932e-00805f8add32 */ \
    0xa6cf9116, \
    0x15b3, \
    0x11d2, \
    {0x93, 0x2e, 0x00, 0x80, 0x5f, 0x8a, 0xdd, 0x32} }

class nsSelectionState;
class nsIEditor;
class nsIAtom;

/**
 * A transaction interface mixin - for transactions that can support. 
 * the placeholder absorbtion idiom. 
 */
class nsIAbsorbingTransaction  : public nsISupports{
public:

  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IABSORBINGTRANSACTION_IID)

  NS_IMETHOD Init(nsIAtom* aName, nsSelectionState* aSelState,
                  nsEditor* aEditor) = 0;
  
  NS_IMETHOD EndPlaceHolderBatch()=0;
  
  NS_IMETHOD GetTxnName(nsIAtom **aName)=0;

  NS_IMETHOD StartSelectionEquals(nsSelectionState *aSelState, bool *aResult)=0;

  NS_IMETHOD ForwardEndBatchTo(nsIAbsorbingTransaction *aForwardingAddress)=0;
  
  NS_IMETHOD Commit()=0;
};

NS_DEFINE_STATIC_IID_ACCESSOR(nsIAbsorbingTransaction,
                              NS_IABSORBINGTRANSACTION_IID)

#endif // nsIAbsorbingTransaction_h__