|
wxMaxima
|
The view-independent state and commands of an edited worksheet document. More...
#include <WorksheetDocument.h>
Public Member Functions | |
| EvaluationQueue & | GetEvaluationQueue () |
| The list of cells scheduled to be sent to Maxima for evaluation. | |
| const EvaluationQueue & | GetEvaluationQueue () const |
| The list of cells scheduled for evaluation (read-only view). | |
| TreeUndoManager & | GetTreeUndo () |
| The document's undo/redo history of tree-structure edits. | |
| const TreeUndoManager & | GetTreeUndo () const |
| The document's tree-edit undo/redo history (read-only view). | |
| WorksheetCursor & | GetCursor () |
| The between-cells cursor (the h-caret) and its group-level selection. | |
| const WorksheetCursor & | GetCursor () const |
| The between-cells cursor (read-only view). | |
| GroupCell * | GetTree () const |
| The first GroupCell of the document (null when the document is empty). | |
| std::unique_ptr< GroupCell > & | TreeOwner () |
| Mutable access to the owning pointer of the cell tree. | |
| CellPtr< GroupCell > & | LastCache () const |
| The cached pointer to the document's last GroupCell (<0 = unknown). | |
| void | SetDocumentView (WorksheetDocumentView *view) |
| Register the view the document notifies when it edits its own structure. | |
| GroupCell * | GetLastCell () const |
| The document's last GroupCell, memoised in m_last (null if empty). | |
| void | NumberSections () const |
| Renumber all sectioning cells (titles, sections, ...) from the top. | |
| GroupCell * | InsertCells (std::unique_ptr< GroupCell > &&cells, GroupCell *where) |
Insert a list of group cells into the document after where. | |
| const wxString & | GetCurrentFile () const |
| The file this document was last loaded from / saved to (empty if none). | |
| void | SetCurrentFile (const wxString &file) |
| Record the file this document is associated with. | |
| const wxString & | GetLastQuestion () const |
| The text of the Maxima question the user is currently being asked. | |
| void | SetLastQuestion (const wxString &lastQuestion) |
| Remember the text of the question Maxima is currently asking. | |
| bool | QuestionPending () const |
| Is Maxima currently waiting for an answer to a question? | |
| void | SetQuestionPending (bool pending) |
| Record whether Maxima is waiting for an answer to a question. | |
| DocumentCellPointers & | GetCellPointers () |
| The document-model half of the cell-pointer registry (selection, the active/answer/current-text cell, working group and error list). | |
| const DocumentCellPointers & | GetCellPointers () const |
| The document-model half of the cell-pointer registry (read-only view). | |
| bool | IsSaved () const |
| True while the document has no unsaved changes. | |
| void | SetSaved (bool saved) |
| Record whether the document is in its saved state. | |
| void | OutputChanged () |
| Note that a cell's output changed. | |
The view-independent state and commands of an edited worksheet document.
Currently a small aggregate that Worksheet delegates to; it grows as further document state is migrated off Worksheet. Held by value by Worksheet.
| GroupCell * WorksheetDocument::InsertCells | ( | std::unique_ptr< GroupCell > && | cells, |
| GroupCell * | where | ||
| ) |
Insert a list of group cells into the document after where.
where == null inserts at the very top. Splices the cells into the tree, renumbers sections if needed and notifies the view (recalc/redraw/adjust size/modified) through the registered WorksheetDocumentView. Returns the last inserted cell. The caller (Worksheet) records the undo action, which needs a Configuration and so stays on the view side.
The cached pointer to the document's last GroupCell (<0 = unknown).
Mutable so the const "find the last cell" lookup can memoise its result; the surgery code also updates it directly when it reseats the tail.
|
inline |
Note that a cell's output changed.
For a .wxmx (which caches output on disk) changed output means the file is no longer saved. Sets the flag directly, without a control refresh, to match the historical behaviour: this is called often during evaluation and must stay cheap.
| void WorksheetDocument::SetSaved | ( | bool | saved | ) |
Record whether the document is in its saved state.
On an actual change of the flag the view is told via WorksheetDocumentView::NotifySavedStateChanged() so it can refresh the controls that depend on the saved-state. Defined in the .cpp because it needs the complete WorksheetDocumentView type.
|
inline |
Mutable access to the owning pointer of the cell tree.
Transitional: while the tree-editing surgery still lives in Worksheet, it reseats the head of the list (moves a new tree in, resets it, splices), so it needs the unique_ptr itself, not just GetTree(). Moves onto WorksheetDocument with the tree-surgery methods in a later increment.