#include <cstdint>#include <optional>#include <string>#include <string_view>#include "donner/editor/FlashDecorations.h"Classes | |
| struct | donner::editor::StructuredCssTarget |
| Exact selection and edit boundaries for a source-backed CSS rule or declaration. More... | |
Namespaces | |
| namespace | donner |
| Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css. | |
Enumerations | |
| enum class | donner::editor::StructuredCssSourceEncoding : std::uint8_t { Text , CData , Attribute , Unmapped } |
| XML source representation of the authored CSS item. | |
| enum class | donner::editor::StructuredCssOperation { ReplaceSelector , ReplaceName , ReplaceValue , AddImportant , RemoveImportant , InsertDeclaration , InsertRule , RemoveDeclaration , RemoveRule } |
| Structured edit to a CSS rule or declaration. | |
Functions | |
| std::optional< StructuredCssTarget > | donner::editor::FindStructuredCssTarget (EditorApp &app, std::string_view source, std::size_t offset) |
| Locate parsed CSS covering a source offset in the current editor snapshot. | |
| bool | donner::editor::CanInsertStructuredCssDeclaration (EditorApp &app, std::string_view source, const StructuredCssTarget &target) |
| Check whether a declaration can be inserted at the current parsed source boundary. | |
| bool | donner::editor::ApplyStructuredCssEdit (EditorApp &app, DocumentSyncController &sync, TextEditor &editor, const StructuredCssTarget &target, StructuredCssOperation operation, std::string_view replacement={}) |
| Apply one CSS operation as one document command and one document undo step. | |
| bool | donner::editor::CanMoveStructuredCss (EditorApp &app, std::string_view source, const StructuredCssTarget &from, const StructuredCssTarget &destination, bool after) |
| Check whether two revision-bound CSS targets can be reordered. | |
| bool | donner::editor::MoveStructuredCss (EditorApp &app, DocumentSyncController &sync, TextEditor &editor, const StructuredCssTarget &from, const StructuredCssTarget &destination, bool after) |
| Move a CSS item relative to another compatible item. | |
| bool donner::editor::ApplyStructuredCssEdit | ( | EditorApp & | app, |
| DocumentSyncController & | sync, | ||
| TextEditor & | editor, | ||
| const StructuredCssTarget & | target, | ||
| StructuredCssOperation | operation, | ||
| std::string_view | replacement = {} ) |
Apply one CSS operation as one document command and one document undo step.
| app | Active editor document. |
| sync | Source owner that mirrors the committed document delta. |
| editor | Source editor receiving the edit. |
| target | Previously resolved, revision-bound CSS target. |
| operation | Requested typed operation. |
| replacement | Authored CSS replacement for replace or insert operations. |
| bool donner::editor::CanInsertStructuredCssDeclaration | ( | EditorApp & | app, |
| std::string_view | source, | ||
| const StructuredCssTarget & | target ) |
Check whether a declaration can be inserted at the current parsed source boundary.
| app | Active editor document. |
| source | Current source pane contents. |
| target | Previously resolved, revision-bound CSS target. |
| bool donner::editor::CanMoveStructuredCss | ( | EditorApp & | app, |
| std::string_view | source, | ||
| const StructuredCssTarget & | from, | ||
| const StructuredCssTarget & | destination, | ||
| bool | after ) |
Check whether two revision-bound CSS targets can be reordered.
| app | Active editor document. |
| source | Current source pane contents. |
| from | Dragged CSS item. |
| destination | Compatible destination of the same item kind. |
| after | Insert after rather than before the destination. |
| std::optional< StructuredCssTarget > donner::editor::FindStructuredCssTarget | ( | EditorApp & | app, |
| std::string_view | source, | ||
| std::size_t | offset ) |
Locate parsed CSS covering a source offset in the current editor snapshot.
| app | Active editor document. |
| source | Current source pane contents. |
| offset | Byte position that identifies the target. |
| bool donner::editor::MoveStructuredCss | ( | EditorApp & | app, |
| DocumentSyncController & | sync, | ||
| TextEditor & | editor, | ||
| const StructuredCssTarget & | from, | ||
| const StructuredCssTarget & | destination, | ||
| bool | after ) |
Move a CSS item relative to another compatible item.
| app | Active editor document. |
| sync | Source owner that mirrors the committed document delta. |
| editor | Source editor receiving the committed source delta. |
| from | Dragged CSS item. |
| destination | Compatible destination of the same item kind. |
| after | Insert after rather than before the destination. |