tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

DeleteContentTransactionBase.h (1330B)


      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 DeleteContentTransactionBase_h
      7 #define DeleteContentTransactionBase_h
      8 
      9 #include "EditTransactionBase.h"
     10 
     11 #include "EditorForwards.h"
     12 
     13 #include "mozilla/RefPtr.h"
     14 
     15 #include "nsCycleCollectionParticipant.h"
     16 #include "nsISupportsImpl.h"
     17 
     18 namespace mozilla {
     19 
     20 /**
     21 * An abstract transaction that removes text or node.
     22 */
     23 class DeleteContentTransactionBase : public EditTransactionBase {
     24 public:
     25  /**
     26   * Return a point to put caret if the transaction instance has an idea.
     27   */
     28  virtual EditorDOMPoint SuggestPointToPutCaret() const = 0;
     29 
     30  NS_DECL_ISUPPORTS_INHERITED
     31  NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(DeleteContentTransactionBase,
     32                                           EditTransactionBase)
     33 
     34  NS_DECL_EDITTRANSACTIONBASE_GETASMETHODS_OVERRIDE(
     35      DeleteContentTransactionBase)
     36 
     37 protected:
     38  explicit DeleteContentTransactionBase(EditorBase& aEditorBase);
     39  ~DeleteContentTransactionBase() = default;
     40 
     41  RefPtr<EditorBase> mEditorBase;
     42 };
     43 
     44 }  // namespace mozilla
     45 
     46 #endif  // #ifndef DeleteContentTransactionBase_h