gecko-dev/editor/libeditor/IMETextTxn.h
Ehsan Akhgari 883849ee32 Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj
This patch was automatically generated using the following script:

function convert() {
echo "Converting $1 to $2..."
find . \
       ! -wholename "*/.git*" \
       ! -wholename "obj-ff-dbg*" \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.c" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert MOZ_OVERRIDE override
convert MOZ_FINAL final
2015-03-21 12:28:04 -04:00

88 lines
2.3 KiB
C++

/* -*- 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 IMETextTxn_h__
#define IMETextTxn_h__
#include "EditTxn.h" // base class
#include "nsAutoPtr.h" // mTextNode, mRanges
#include "nsCycleCollectionParticipant.h" // various macros
#include "nsString.h" // mStringToInsert
class nsEditor;
#define NS_IMETEXTTXN_IID \
{ 0xb391355d, 0x346c, 0x43d1, \
{ 0x85, 0xed, 0x9e, 0x65, 0xbe, 0xe7, 0x7e, 0x48 } }
namespace mozilla {
class TextRangeArray;
namespace dom {
class Text;
/**
* A transaction that inserts text into a content node.
*/
class IMETextTxn : public EditTxn
{
public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IMETEXTTXN_IID)
/** @param aTextNode the text content node
* @param aOffset the location in aTextNode to do the insertion
* @param aReplaceLength the length of text to replace (0 == no replacement)
* @param aTextRangeArray clauses and/or caret information. This may be null.
* @param aString the new text to insert
* @param aEditor used to get and set the selection
*/
IMETextTxn(Text& aTextNode, uint32_t aOffset, uint32_t aReplaceLength,
TextRangeArray* aTextRangeArray, const nsAString& aString,
nsEditor& aEditor);
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(IMETextTxn, EditTxn)
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_EDITTXN
NS_IMETHOD Merge(nsITransaction* aTransaction, bool* aDidMerge) override;
void MarkFixed();
private:
~IMETextTxn();
nsresult SetSelectionForRanges();
/** The text element to operate upon */
nsRefPtr<Text> mTextNode;
/** The offsets into mTextNode where the insertion should be placed */
uint32_t mOffset;
uint32_t mReplaceLength;
/** The range list **/
nsRefPtr<mozilla::TextRangeArray> mRanges;
/** The text to insert into mTextNode at mOffset */
nsString mStringToInsert;
/** The editor, which is used to get the selection controller */
nsEditor& mEditor;
bool mFixed;
};
NS_DEFINE_STATIC_IID_ACCESSOR(IMETextTxn, NS_IMETEXTTXN_IID)
}
}
#endif