|
| 1 | +//! Threaded comments module for XLSX files. |
| 2 | +//! |
| 3 | +//! This module provides structures and functions for reading and writing |
| 4 | +//! threaded comments (modern Excel comment threads) in XLSX workbooks. |
| 5 | +//! |
| 6 | +//! Threaded comments are a modern feature introduced in Office 365 that |
| 7 | +//! support conversation threads, @mentions, and richer collaboration features. |
| 8 | +
|
| 9 | +pub mod person; |
| 10 | +pub mod reader; |
| 11 | +pub mod writer; |
| 12 | + |
| 13 | +pub use person::{Mention, Person, PersonList}; |
| 14 | +pub use reader::{read_persons, read_threaded_comments}; |
| 15 | +pub use writer::{write_persons, write_threaded_comments}; |
| 16 | + |
| 17 | +/// A threaded comment in an Excel worksheet. |
| 18 | +/// |
| 19 | +/// Threaded comments support conversation-style threads with replies, |
| 20 | +/// mentions, timestamps, and resolution status. |
| 21 | +#[derive(Debug, Clone, Default)] |
| 22 | +pub struct ThreadedComment { |
| 23 | + /// Cell reference (e.g., "A1") |
| 24 | + pub cell_ref: Option<String>, |
| 25 | + /// Unique identifier for this comment |
| 26 | + pub id: String, |
| 27 | + /// ID of the parent comment (for replies) |
| 28 | + pub parent_id: Option<String>, |
| 29 | + /// Person ID who authored this comment |
| 30 | + pub person_id: String, |
| 31 | + /// Comment text content |
| 32 | + pub text: Option<String>, |
| 33 | + /// Timestamp when comment was created/edited |
| 34 | + pub date_time: Option<String>, |
| 35 | + /// Whether this comment thread is marked as done/resolved |
| 36 | + pub done: Option<bool>, |
| 37 | + /// List of @mentions in the comment |
| 38 | + pub mentions: Vec<Mention>, |
| 39 | +} |
| 40 | + |
| 41 | +/// Collection of threaded comments for a worksheet. |
| 42 | +#[derive(Debug, Clone, Default)] |
| 43 | +pub struct ThreadedComments { |
| 44 | + /// List of threaded comments |
| 45 | + pub comments: Vec<ThreadedComment>, |
| 46 | +} |
0 commit comments