pub struct DeckSession { /* private fields */ }Implementations§
Source§impl DeckSession
impl DeckSession
pub fn add_comment( &self, context: &EditCtx, slide_id: &str, author: &str, initials: &str, text: &str, created: &str, x_emu: i64, y_emu: i64, ) -> EditResult<CommentReceipt>
pub fn reply_to_comment( &self, context: &EditCtx, comment_id: &str, author: &str, initials: &str, text: &str, created: &str, ) -> EditResult<CommentReceipt>
pub fn set_comment_status( &self, context: &EditCtx, comment_id: &str, resolved: bool, ) -> EditResult<CommentReceipt>
pub fn remove_comment( &self, context: &EditCtx, comment_id: &str, ) -> EditResult<CommentReceipt>
pub fn set_comment_flavor( &self, context: &EditCtx, flavor: CommentFlavor, ) -> EditResult<CommentFlavor>
pub fn comments(&self) -> EditResult<Vec<CommentSnapshot>>
pub fn comment_flavor(&self) -> EditResult<CommentFlavor>
Source§impl DeckSession
impl DeckSession
pub fn snapshot(&self) -> EditResult<DeckSnapshot>
pub fn insert_slide( &self, context: &EditCtx, index: u32, layout_part_path: Option<&str>, ) -> EditResult<SlideReceipt>
pub fn set_slide_notes( &self, context: &EditCtx, slide_id: &str, text: &str, ) -> EditResult<()>
pub fn delete_slide( &self, context: &EditCtx, slide_id: &str, ) -> EditResult<SlideReceipt>
pub fn move_slide( &self, context: &EditCtx, slide_id: &str, to_index: u32, ) -> EditResult<SlideReceipt>
pub fn add_text_box( &self, context: &EditCtx, slide_id: &str, draft: &ShapeDraft, ) -> EditResult<ShapeReceipt>
pub fn add_shape( &self, context: &EditCtx, slide_id: &str, draft: &PresetShapeDraft, ) -> EditResult<ShapeReceipt>
pub fn set_shape_fill( &self, context: &EditCtx, slide_id: &str, shape_id: &str, color: Option<&str>, ) -> EditResult<ShapeFillReceipt>
pub fn set_shape_stroke( &self, context: &EditCtx, slide_id: &str, shape_id: &str, stroke: &ShapeStroke, ) -> EditResult<ShapeStrokeReceipt>
pub fn set_shape_adjust( &self, context: &EditCtx, slide_id: &str, shape_id: &str, adjustments: &BTreeMap<String, f64>, ) -> EditResult<ShapeAdjustReceipt>
pub fn remove_shape( &self, context: &EditCtx, slide_id: &str, shape_id: &str, ) -> EditResult<ShapeReceipt>
pub fn move_shape( &self, context: &EditCtx, slide_id: &str, shape_id: &str, x: i64, y: i64, ) -> EditResult<TransformReceipt>
pub fn resize_shape( &self, context: &EditCtx, slide_id: &str, shape_id: &str, width: i64, height: i64, ) -> EditResult<TransformReceipt>
pub fn set_shape_rect( &self, context: &EditCtx, slide_id: &str, shape_id: &str, rect: ShapeRect, ) -> EditResult<TransformReceipt>
Source§impl DeckSession
impl DeckSession
Sourcepub fn preview_proposal_diff(
&self,
id: &str,
) -> ProposalResult<ProposalDiffPreview>
pub fn preview_proposal_diff( &self, id: &str, ) -> ProposalResult<ProposalDiffPreview>
Builds a render-only snapshot whose offsets are not editable.
Source§impl DeckSession
impl DeckSession
pub fn propose(&self, request: ProposalRequest) -> ProposalResult<Proposal>
pub fn proposals(&self) -> ProposalResult<Vec<Proposal>>
pub fn preview_proposal(&self, id: &str) -> ProposalResult<ProposalPreview>
pub fn proposal_preview_session(&self, id: &str) -> ProposalResult<DeckSession>
pub fn accept_proposal( &self, id: &str, force: bool, ) -> ProposalResult<ProposalAcceptance>
pub fn reject_proposal(&self, id: &str) -> bool
Source§impl DeckSession
impl DeckSession
Sourcepub fn save(&self) -> EditResult<Vec<u8>>
pub fn save(&self) -> EditResult<Vec<u8>>
Serializes the deck with all edits applied. Untouched slides keep their exact source part bytes; edited slides are patched at the XML level.
Source§impl DeckSession
impl DeckSession
pub fn story(&self, story_id: &str) -> EditResult<StorySnapshot>
pub fn anchor_caret( &self, story_id: &str, index: u32, ) -> EditResult<CaretAnchor>
pub fn resolve_caret_anchor(&self, anchor: &CaretAnchor) -> Option<u32>
pub fn insert_text( &self, context: &EditCtx, story_id: &str, index: u32, text: &str, style: &TextStyle, ) -> EditResult<TextReceipt>
pub fn delete_text( &self, context: &EditCtx, story_id: &str, start: u32, end: u32, ) -> EditResult<TextReceipt>
pub fn format_text( &self, context: &EditCtx, story_id: &str, start: u32, end: u32, patch: &TextStylePatch, ) -> EditResult<TextReceipt>
Sourcepub fn set_paragraph_alignment(
&self,
context: &EditCtx,
story_id: &str,
start: u32,
end: u32,
alignment: Option<&str>,
) -> EditResult<TextReceipt>
pub fn set_paragraph_alignment( &self, context: &EditCtx, story_id: &str, start: u32, end: u32, alignment: Option<&str>, ) -> EditResult<TextReceipt>
Sets a:pPr@algn on every paragraph the range touches; None clears
the value so the placeholder cascade applies again.
pub fn insert_paragraph_break( &self, context: &EditCtx, story_id: &str, index: u32, ) -> EditResult<TextReceipt>
pub fn delete_paragraph_break( &self, context: &EditCtx, story_id: &str, index: u32, ) -> EditResult<TextReceipt>
Source§impl DeckSession
impl DeckSession
pub fn open(bytes: &[u8], client_id: u64) -> EditResult<Self>
Sourcepub fn from_package(package: PptxPackage, client_id: u64) -> EditResult<Self>
pub fn from_package(package: PptxPackage, client_id: u64) -> EditResult<Self>
Opens an edit session from an already parsed package. The fingerprint
is taken from a re-zip of the package; prefer
Self::from_package_with_source when the file bytes are at hand, so
peers can match them against the update.
Sourcepub fn from_package_with_source(
package: PptxPackage,
source: &[u8],
client_id: u64,
) -> EditResult<Self>
pub fn from_package_with_source( package: PptxPackage, source: &[u8], client_id: u64, ) -> EditResult<Self>
Opens an edit session from a parsed package, fingerprinting the file bytes it was parsed from.
pub fn open_from_update(update: &[u8], client_id: u64) -> EditResult<Self>
Sourcepub fn open_from_update_with_source(
update: &[u8],
source: &[u8],
client_id: u64,
) -> EditResult<Self>
pub fn open_from_update_with_source( update: &[u8], source: &[u8], client_id: u64, ) -> EditResult<Self>
Like Self::open_from_update, but re-attaches the source file the
update was seeded from, so the session can save. The bytes must hash to
the fingerprint recorded in the update.