41#ifndef WORKSHEETDOCUMENT_H
42#define WORKSHEETDOCUMENT_H
44#include "CellPointers.h"
86 std::unique_ptr<GroupCell> &
TreeOwner() {
return m_tree; }
122 m_lastQuestion = lastQuestion;
153 if (m_currentFile.EndsWith(wxS(
".wxmx")))
166 std::unique_ptr<GroupCell> m_tree;
172 wxString m_currentFile;
174 wxString m_lastQuestion;
176 bool m_questionPrompt =
false;
Implementation of an observing weak Cell pointer.
This file defines the class GroupCell that bundles input and output in the worksheet.
Declares TreeUndoManager: the owner of the cell-tree undo/redo state.
The worksheet's "between the cells" cursor (the horizontally drawn caret).
A weak non-owning pointer that becomes null whenever the observed object is destroyed.
Definition: CellPtr.h:511
The document-model half of the cell-pointer registry.
Definition: CellPointers.h:50
A simple FIFO queue with manual removal of elements.
Definition: EvaluationQueue.h:43
A cell grouping input (and, if there is one, also the output) cell to a foldable item.
Definition: GroupCell.h:87
Owns the cell-tree undo/redo stacks and the active-cell snapshot.
Definition: TreeUndoManager.h:51
The between-the-cells cursor: active flag, position, selection anchors.
Definition: WorksheetCursor.h:49
The view notifications a WorksheetDocument emits when it edits itself.
Definition: WorksheetDocumentView.h:50
The view-independent state and commands of an edited worksheet document.
Definition: WorksheetDocument.h:60
CellPtr< GroupCell > & LastCache() const
The cached pointer to the document's last GroupCell (<0 = unknown).
Definition: WorksheetDocument.h:92
const WorksheetCursor & GetCursor() const
The between-cells cursor (read-only view).
Definition: WorksheetDocument.h:75
void SetSaved(bool saved)
Record whether the document is in its saved state.
Definition: WorksheetDocument.cpp:33
bool QuestionPending() const
Is Maxima currently waiting for an answer to a question?
Definition: WorksheetDocument.h:126
GroupCell * GetLastCell() const
The document's last GroupCell, memoised in m_last (null if empty).
Definition: WorksheetDocument.cpp:41
bool IsSaved() const
True while the document has no unsaved changes.
Definition: WorksheetDocument.h:137
void SetCurrentFile(const wxString &file)
Record the file this document is associated with.
Definition: WorksheetDocument.h:116
EvaluationQueue & GetEvaluationQueue()
The list of cells scheduled to be sent to Maxima for evaluation.
Definition: WorksheetDocument.h:63
DocumentCellPointers & GetCellPointers()
The document-model half of the cell-pointer registry (selection, the active/answer/current-text cell,...
Definition: WorksheetDocument.h:132
GroupCell * InsertCells(std::unique_ptr< GroupCell > &&cells, GroupCell *where)
Insert a list of group cells into the document after where.
Definition: WorksheetDocument.cpp:58
const TreeUndoManager & GetTreeUndo() const
The document's tree-edit undo/redo history (read-only view).
Definition: WorksheetDocument.h:70
void NumberSections() const
Renumber all sectioning cells (titles, sections, ...) from the top.
Definition: WorksheetDocument.cpp:51
TreeUndoManager & GetTreeUndo()
The document's undo/redo history of tree-structure edits.
Definition: WorksheetDocument.h:68
const EvaluationQueue & GetEvaluationQueue() const
The list of cells scheduled for evaluation (read-only view).
Definition: WorksheetDocument.h:65
const wxString & GetCurrentFile() const
The file this document was last loaded from / saved to (empty if none).
Definition: WorksheetDocument.h:114
void SetDocumentView(WorksheetDocumentView *view)
Register the view the document notifies when it edits its own structure.
Definition: WorksheetDocument.h:95
std::unique_ptr< GroupCell > & TreeOwner()
Mutable access to the owning pointer of the cell tree.
Definition: WorksheetDocument.h:86
const wxString & GetLastQuestion() const
The text of the Maxima question the user is currently being asked.
Definition: WorksheetDocument.h:119
void SetQuestionPending(bool pending)
Record whether Maxima is waiting for an answer to a question.
Definition: WorksheetDocument.h:128
WorksheetCursor & GetCursor()
The between-cells cursor (the h-caret) and its group-level selection.
Definition: WorksheetDocument.h:73
GroupCell * GetTree() const
The first GroupCell of the document (null when the document is empty).
Definition: WorksheetDocument.h:78
void SetLastQuestion(const wxString &lastQuestion)
Remember the text of the question Maxima is currently asking.
Definition: WorksheetDocument.h:121
void OutputChanged()
Note that a cell's output changed.
Definition: WorksheetDocument.h:152
const DocumentCellPointers & GetCellPointers() const
The document-model half of the cell-pointer registry (read-only view).
Definition: WorksheetDocument.h:134