Mountain/Environment/DocumentProvider/
mod.rs1use CommonLibrary::Document::DocumentProvider::DocumentProvider;
25use async_trait::async_trait;
26
27mod OpenDocument;
29
30mod SaveOperations;
31
32mod ApplyChanges;
33
34mod Notifications;
35
36#[async_trait]
37impl DocumentProvider for crate::Environment::MountainEnvironment::MountainEnvironment {
38 async fn OpenDocument(
39 &self,
40
41 URIComponentsDTO:serde_json::Value,
42
43 LanguageIdentifier:Option<String>,
44
45 Content:Option<String>,
46 ) -> Result<url::Url, CommonLibrary::Error::CommonError::CommonError> {
47 OpenDocument::open_document(self, URIComponentsDTO, LanguageIdentifier, Content).await
48 }
49
50 async fn SaveDocument(&self, URI:url::Url) -> Result<bool, CommonLibrary::Error::CommonError::CommonError> {
51 SaveOperations::save_document(self, URI).await
52 }
53
54 async fn SaveDocumentAs(
55 &self,
56
57 OriginalURI:url::Url,
58
59 NewTargetURI:Option<url::Url>,
60 ) -> Result<Option<url::Url>, CommonLibrary::Error::CommonError::CommonError> {
61 SaveOperations::save_document_as(self, OriginalURI, NewTargetURI).await
62 }
63
64 async fn SaveAllDocuments(
65 &self,
66
67 IncludeUntitled:bool,
68 ) -> Result<Vec<bool>, CommonLibrary::Error::CommonError::CommonError> {
69 SaveOperations::save_all_documents(self, IncludeUntitled).await
70 }
71
72 async fn ApplyDocumentChanges(
73 &self,
74
75 URI:url::Url,
76
77 NewVersionIdentifier:i64,
78
79 ChangesDTOCollection:serde_json::Value,
80
81 _IsDirtyAfterChange:bool,
82
83 _IsUndoing:bool,
84
85 _IsRedoing:bool,
86 ) -> Result<(), CommonLibrary::Error::CommonError::CommonError> {
87 ApplyChanges::apply_document_changes(
88 self,
89 URI,
90 NewVersionIdentifier,
91 ChangesDTOCollection,
92 _IsDirtyAfterChange,
93 _IsUndoing,
94 _IsRedoing,
95 )
96 .await
97 }
98}