#include "pdf/pdf_ink_undo_redo_model.h"
#include <stddef.h>
#include <optional>
#include <set>
#include <vector>
#include "base/check.h"
#include "base/check_op.h"
#include "base/notreached.h"
#include "base/types/strong_alias.h"
#include "third_party/abseil-cpp/absl/types/variant.h"
namespace chrome_pdf {
namespace {
PdfInkUndoRedoModel::DrawCommands& GetModifiableDrawCommands(
PdfInkUndoRedoModel::Commands& commands) { … }
PdfInkUndoRedoModel::EraseCommands& GetModifiableEraseCommands(
PdfInkUndoRedoModel::Commands& commands) { … }
}
PdfInkUndoRedoModel::PdfInkUndoRedoModel() = default;
PdfInkUndoRedoModel::~PdfInkUndoRedoModel() = default;
std::optional<PdfInkUndoRedoModel::DiscardedDrawCommands>
PdfInkUndoRedoModel::StartDraw() { … }
bool PdfInkUndoRedoModel::Draw(size_t id) { … }
bool PdfInkUndoRedoModel::FinishDraw() { … }
std::optional<PdfInkUndoRedoModel::DiscardedDrawCommands>
PdfInkUndoRedoModel::StartErase() { … }
bool PdfInkUndoRedoModel::Erase(size_t id) { … }
bool PdfInkUndoRedoModel::FinishErase() { … }
PdfInkUndoRedoModel::Commands PdfInkUndoRedoModel::Undo() { … }
PdfInkUndoRedoModel::Commands PdfInkUndoRedoModel::Redo() { … }
PdfInkUndoRedoModel::CommandsType PdfInkUndoRedoModel::GetCommandsType(
const Commands& commands) { … }
const PdfInkUndoRedoModel::DrawCommands& PdfInkUndoRedoModel::GetDrawCommands(
const Commands& commands) { … }
const PdfInkUndoRedoModel::EraseCommands& PdfInkUndoRedoModel::GetEraseCommands(
const Commands& commands) { … }
template <typename T>
std::optional<PdfInkUndoRedoModel::DiscardedDrawCommands>
PdfInkUndoRedoModel::StartImpl() { … }
bool PdfInkUndoRedoModel::IsAtTopOfStackWithGivenCommandType(
CommandsType type) const { … }
bool PdfInkUndoRedoModel::HasIdInDrawCommands(size_t id) const { … }
bool PdfInkUndoRedoModel::HasIdInEraseCommands(size_t id) const { … }
}