1999-06-29 20:31:22 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
1999-11-06 03:43:54 +00:00
|
|
|
* The contents of this file are subject to the Netscape Public
|
|
|
|
* License Version 1.1 (the "License"); you may not use this file
|
|
|
|
* except in compliance with the License. You may obtain a copy of
|
|
|
|
* the License at http://www.mozilla.org/NPL/
|
1999-06-29 20:31:22 +00:00
|
|
|
*
|
1999-11-06 03:43:54 +00:00
|
|
|
* Software distributed under the License is distributed on an "AS
|
|
|
|
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
|
|
|
* implied. See the License for the specific language governing
|
|
|
|
* rights and limitations under the License.
|
1999-06-29 20:31:22 +00:00
|
|
|
*
|
1999-11-06 03:43:54 +00:00
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is Netscape
|
1999-06-29 20:31:22 +00:00
|
|
|
* Communications Corporation. Portions created by Netscape are
|
1999-11-06 03:43:54 +00:00
|
|
|
* Copyright (C) 1998-1999 Netscape Communications Corporation. All
|
|
|
|
* Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
1999-06-29 20:31:22 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef IMECommitTxn_h__
|
|
|
|
#define IMECommitTxn_h__
|
|
|
|
|
|
|
|
#include "EditTxn.h"
|
|
|
|
#include "nsIDOMCharacterData.h"
|
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
|
|
|
|
// {9C4994A1-281C-11d3-9EA3-0060089FE59B}
|
1999-07-15 19:13:46 +00:00
|
|
|
#define IME_COMMIT_TXN_CID \
|
1999-06-29 20:31:22 +00:00
|
|
|
{ 0x9c4994a1, 0x281c, 0x11d3, \
|
|
|
|
{ 0x9e, 0xa3, 0x0, 0x60, 0x8, 0x9f, 0xe5, 0x9b }}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A transaction representing an IME commit operation
|
|
|
|
*/
|
|
|
|
class IMECommitTxn : public EditTxn
|
|
|
|
{
|
|
|
|
public:
|
1999-07-15 19:13:46 +00:00
|
|
|
static const nsIID& GetCID() { static nsIID iid = IME_COMMIT_TXN_CID; return iid; }
|
|
|
|
|
1999-06-29 20:31:22 +00:00
|
|
|
virtual ~IMECommitTxn();
|
|
|
|
|
|
|
|
static nsIAtom *gIMECommitTxnName;
|
|
|
|
|
|
|
|
/** initialize the transaction
|
|
|
|
*/
|
|
|
|
NS_IMETHOD Init(void);
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
IMECommitTxn();
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
NS_IMETHOD Do(void);
|
|
|
|
|
|
|
|
NS_IMETHOD Undo(void);
|
|
|
|
|
|
|
|
NS_IMETHOD Merge(PRBool *aDidMerge, nsITransaction *aTransaction);
|
|
|
|
|
|
|
|
NS_IMETHOD Write(nsIOutputStream *aOutputStream);
|
|
|
|
|
|
|
|
NS_IMETHOD GetUndoString(nsString *aString);
|
|
|
|
|
|
|
|
NS_IMETHOD GetRedoString(nsString *aString);
|
|
|
|
|
|
|
|
// nsISupports declarations
|
|
|
|
|
|
|
|
// override QueryInterface to handle IMECommitTxn request
|
|
|
|
NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr);
|
|
|
|
|
|
|
|
/** must be called before any IMECommitTxn is instantiated */
|
|
|
|
static nsresult ClassInit();
|
|
|
|
|
1999-10-06 20:27:41 +00:00
|
|
|
/** must be called once we are guaranteed all IMECommitTxn have completed */
|
|
|
|
static nsresult ClassShutdown();
|
|
|
|
|
1999-09-21 22:31:27 +00:00
|
|
|
enum { kTransactionID = 11230 };
|
|
|
|
|
1999-06-29 20:31:22 +00:00
|
|
|
protected:
|
|
|
|
|
|
|
|
friend class TransactionFactory;
|
|
|
|
|
|
|
|
friend class nsDerivedSafe<IMECommitTxn>; // work around for a compiler bug
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|