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#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
57pub struct ExportLatexDto {
58    pub document_class: String,
59    pub include_preamble: bool,
60}
61#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
62pub struct ExportLatexResultDto {
63    pub latex_text: String,
64}
65#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
66pub struct ExportDocxDto {
67    pub output_path: String,
68    // Hand-added (mirrors `ImportDjotDto.options`): page geometry + base typography for a
69    // manuscript-style export. `#[serde(default)]` so an older `{ output_path }` payload still
70    // loads. If this file is regenerated, re-add this field (or declare it in the manifest).
71    #[serde(default)]
72    pub options: DocxExportOptions,
73}
74#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
75pub struct ExportDocxResultDto {
76    pub file_path: String,
77    pub paragraph_count: i64,
78}
79#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
80pub struct ExportEpubDto {
81    pub output_path: String,
82    // Hand-added (mirrors `ExportDocxDto.options`): book-level metadata (title, author,
83    // language, reading direction) for the EPUB package. `#[serde(default)]` so an older
84    // `{ output_path }` payload still loads. If this file is regenerated, re-add this field (or
85    // declare it in the manifest).
86    #[serde(default)]
87    pub options: EpubExportOptions,
88}
89#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
90pub struct ExportEpubResultDto {
91    pub file_path: String,
92    pub chapter_count: i64,
93}
94#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
95pub struct ExportPdfDto {
96    pub output_path: String,
97    // Hand-added (mirrors `ExportDocxDto.options`/`ExportEpubDto.options`): page geometry +
98    // typography + embedded font bytes for the PDF export. `#[serde(default)]` so an older
99    // `{ output_path }` payload still loads. If this file is regenerated, re-add this field (or
100    // declare it in the manifest).
101    #[serde(default)]
102    pub options: PdfExportOptions,
103}
104#[derive(Debug, Clone, PartialEq, Default, Serialize, Deserialize)]
105pub struct ExportPdfResultDto {
106    pub file_path: String,
107    pub page_count: i64,
108}