Skip to main content

text_document_io/
dtos.rs

1// Generated by Qleany v1.4.8 from feature_dtos.tera
2
3use common::parser_tools::{
4    DjotImportOptions, DocxExportOptions, EpubExportOptions, PdfExportOptions,
5};
6use serde::{Deserialize, Serialize};
7
8#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
9pub struct ImportPlainTextDto {
10    pub plain_text: String,
11}
12#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
13pub struct ExportPlainTextDto {
14    pub plain_text: String,
15}
16#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
17pub struct ImportMarkdownDto {
18    pub markdown_text: String,
19}
20#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
21pub struct ImportMarkdownResultDto {
22    pub block_count: i64,
23}
24#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
25pub struct ExportMarkdownDto {
26    pub markdown_text: String,
27}
28#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
29pub struct ImportDjotDto {
30    pub djot_text: String,
31    /// Per-feature selection for the optional block attributes (alignment, line
32    /// height, direction, non-breakable lines, background color). Defaults to
33    /// all enabled — the fully lossless import.
34    pub options: DjotImportOptions,
35}
36#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
37pub struct ImportDjotResultDto {
38    pub block_count: i64,
39}
40#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
41pub struct ExportDjotDto {
42    pub djot_text: String,
43}
44#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
45pub struct ImportHtmlDto {
46    pub html_text: String,
47}
48#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
49pub struct ImportHtmlResultDto {
50    pub block_count: i64,
51}
52#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
53pub struct ExportHtmlDto {
54    pub html_text: String,
55}
56
57#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
58pub struct ExportLatexDto {
59    pub document_class: String,
60    pub include_preamble: bool,
61    /// Drop inline images instead of emitting `\includegraphics`.
62    ///
63    /// LaTeX resolves a graphic against the filesystem when the document is
64    /// compiled, so a caller that will not place the files beside the `.tex` is
65    /// choosing between a build error and no image. `#[serde(default)]` so an
66    /// older `{ document_class, include_preamble }` payload still loads.
67    #[serde(default)]
68    pub omit_images: bool,
69}
70#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
71pub struct ExportLatexResultDto {
72    pub latex_text: String,
73}
74#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
75pub struct ExportDocxDto {
76    pub output_path: String,
77    // Hand-added (mirrors `ImportDjotDto.options`): page geometry + base typography for a
78    // manuscript-style export. `#[serde(default)]` so an older `{ output_path }` payload still
79    // loads. If this file is regenerated, re-add this field (or declare it in the manifest).
80    #[serde(default)]
81    pub options: DocxExportOptions,
82}
83#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
84pub struct ExportDocxResultDto {
85    pub file_path: String,
86    pub paragraph_count: i64,
87}
88#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
89pub struct ExportEpubDto {
90    pub output_path: String,
91    // Hand-added (mirrors `ExportDocxDto.options`): book-level metadata (title, author,
92    // language, reading direction) for the EPUB package. `#[serde(default)]` so an older
93    // `{ output_path }` payload still loads. If this file is regenerated, re-add this field (or
94    // declare it in the manifest).
95    #[serde(default)]
96    pub options: EpubExportOptions,
97}
98#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
99pub struct ExportEpubResultDto {
100    pub file_path: String,
101    pub chapter_count: i64,
102}
103#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
104pub struct ExportPdfDto {
105    pub output_path: String,
106    // Hand-added (mirrors `ExportDocxDto.options`/`ExportEpubDto.options`): page geometry +
107    // typography + embedded font bytes for the PDF export. `#[serde(default)]` so an older
108    // `{ output_path }` payload still loads. If this file is regenerated, re-add this field (or
109    // declare it in the manifest).
110    #[serde(default)]
111    pub options: PdfExportOptions,
112}
113#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
114pub struct ExportPdfResultDto {
115    pub file_path: String,
116    pub page_count: i64,
117}