| 1 |
//! The property sets describing OneNote objects we can parse. |
| 2 |
//! |
| 3 |
//! See [\[MS-ONE\] 2.1.13] for the list of properties the OneNote file format specifies. |
| 4 |
//! |
| 5 |
//! [\[MS-ONE\] 2.1.13]: https://docs.microsoft.com/en-us/openspecs/office_file_formats/ms-one/73d98105-f194-4c05-a795-09840a6d24bf |
| 6 |
|
| 7 |
use crate::onestore::types::jcid::JcId; |
| 8 |
use enum_primitive_derive::Primitive; |
| 9 |
use num_traits::FromPrimitive; |
| 10 |
|
| 11 |
pub(crate) mod embedded_file_container; |
| 12 |
pub(crate) mod embedded_file_node; |
| 13 |
pub(crate) mod embedded_ink_container; |
| 14 |
pub(crate) mod iframe_node; |
| 15 |
pub(crate) mod image_node; |
| 16 |
pub(crate) mod ink_container; |
| 17 |
pub(crate) mod ink_data_node; |
| 18 |
pub(crate) mod ink_stroke_node; |
| 19 |
pub(crate) mod note_tag_container; |
| 20 |
pub(crate) mod note_tag_shared_definition_container; |
| 21 |
pub(crate) mod number_list_node; |
| 22 |
pub(crate) mod outline_element_node; |
| 23 |
pub(crate) mod outline_group; |
| 24 |
pub(crate) mod outline_node; |
| 25 |
pub(crate) mod page_manifest_node; |
| 26 |
pub(crate) mod page_metadata; |
| 27 |
pub(crate) mod page_node; |
| 28 |
pub(crate) mod page_series_node; |
| 29 |
pub(crate) mod paragraph_style_object; |
| 30 |
pub(crate) mod picture_container; |
| 31 |
pub(crate) mod rich_text_node; |
| 32 |
pub(crate) mod section_metadata_node; |
| 33 |
pub(crate) mod section_node; |
| 34 |
pub(crate) mod stroke_properties_node; |
| 35 |
pub(crate) mod table_cell_node; |
| 36 |
pub(crate) mod table_node; |
| 37 |
pub(crate) mod table_row_node; |
| 38 |
pub(crate) mod title_node; |
| 39 |
pub(crate) mod toc_container; |
| 40 |
|
| 41 |
#[derive(Debug, Copy, Clone, Primitive)] |
| 42 |
pub(crate) enum PropertySetId { |
| 43 |
AuthorContainer = 0x00120001, |
| 44 |
EmbeddedFileContainer = 0x00080036, |
| 45 |
EmbeddedFileNode = 0x00060035, |
| 46 |
ImageNode = 0x00060011, |
| 47 |
NoteTagSharedDefinitionContainer = 0x00120043, |
| 48 |
NumberListNode = 0x00060012, |
| 49 |
OutlineElementNode = 0x0006000D, |
| 50 |
OutlineGroup = 0x00060019, |
| 51 |
OutlineNode = 0x0006000C, |
| 52 |
PageManifestNode = 0x00060037, |
| 53 |
PageMetadata = 0x00020030, |
| 54 |
PageNode = 0x0006000B, |
| 55 |
PageSeriesNode = 0x00060008, |
| 56 |
ParagraphStyleObject = 0x0012004D, |
| 57 |
PictureContainer = 0x00080039, |
| 58 |
RevisionMetadata = 0x00020044, |
| 59 |
RichTextNode = 0x0006000E, |
| 60 |
SectionMetadata = 0x00020031, |
| 61 |
SectionNode = 0x00060007, |
| 62 |
TableCellNode = 0x00060024, |
| 63 |
TableNode = 0x00060022, |
| 64 |
TableRowNode = 0x00060023, |
| 65 |
TitleNode = 0x0006002C, |
| 66 |
TocContainer = 0x00020001, |
| 67 |
|
| 68 |
// Undocumented: |
| 69 |
XpsContainer = 0x0008003A, |
| 70 |
InkContainer = 0x00060014, |
| 71 |
InkDataNode = 0x0002003B, |
| 72 |
InkStrokeNode = 0x00020047, |
| 73 |
StrokePropertiesNode = 0x00120048, |
| 74 |
IFrameNode = 0x00060058, |
| 75 |
} |
| 76 |
|
| 77 |
impl PropertySetId { |
| 78 |
pub(crate) fn as_jcid(&self) -> JcId { |
| 79 |
JcId(*self as u32) |
| 80 |
} |
| 81 |
|
| 82 |
pub(crate) fn from_jcid(id: JcId) -> Option<PropertySetId> { |
| 83 |
PropertySetId::from_u32(id.0) |
| 84 |
} |
| 85 |
} |