Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/editor/libeditor/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 1 kB image not shown  

Quelle  AutoSelectionRestorer.h   Sprache: 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 mozilla_AutoSelectionRestorer_h__
#define mozilla_AutoSelectionRestorer_h__

#include "EditorBase.h"

namespace mozilla {

/**
 * Stack based helper class for saving/restoring selection.  Note that this
 * assumes that the nodes involved are still around afterwords!
 */

class AutoSelectionRestorer final {
 public:
  AutoSelectionRestorer() = delete;
  explicit AutoSelectionRestorer(const AutoSelectionRestorer& aOther) = delete;
  AutoSelectionRestorer(AutoSelectionRestorer&& aOther) = delete;

  /**
   * Constructor responsible for remembering all state needed to restore
   * aSelection.
   * XXX This constructor and the destructor should be marked as
   *     `MOZ_CAN_RUN_SCRIPT`, but it's impossible due to this may be used
   *     with `Maybe`.
   */

  MOZ_CAN_RUN_SCRIPT_BOUNDARY explicit AutoSelectionRestorer(
      EditorBase* aEditor);

  /**
   * Destructor restores mSelection to its former state
   */

  MOZ_CAN_RUN_SCRIPT_BOUNDARY ~AutoSelectionRestorer();

  /**
   * Abort() cancels to restore the selection.
   */

  void Abort();

  bool MaybeRestoreSelectionLater() const { return !!mEditor; }

 protected:
  // The lifetime must be guaranteed by the creator of this instance.
  MOZ_KNOWN_LIVE EditorBase* mEditor = nullptr;
};
}  // namespace mozilla

#endif

Messung V0.5
C=92 H=98 G=94

¤ Dauer der Verarbeitung: 0.3 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

Beweissystem der NASA

Beweissystem Isabelle

NIST Cobol Testsuite

Cephes Mathematical Library

Wiener Entwicklungsmethode

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.