--- /dev/null
+/*
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
+ *
+ * Copyright 2026 Olaf Wintermann. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+use ui_rs::ui::*;
+use ui_rs::{action, button, imageviewer, tabview, ui_actions, webview, UiModel};
+
+pub fn attachments_window_create(note_id: i32, selected_attachment: Option<i32>) {
+ let data = AttachmentsWindow::new(note_id);
+
+ let obj = simple_window("Attachments", data, |obj, data|{
+ obj.headerbar().create(|hb|{
+ hb.start(|obj|{
+ button!(obj, icon = UiIconSet::GoBack.as_str(), action = "go_back");
+ button!(obj, icon = UiIconSet::GoBack.as_str(), action = "go_forward");
+ });
+ });
+
+ tabview!(obj, tabview_type = TabViewType::Invisible, varname = "attachment_view_type", |tv|{
+ tv.tab("img", |obj|{
+ imageviewer!(obj, varname = "image", fill = true);
+ });
+ tv.tab("webview", |obj|{
+ webview!(obj, varname = "webview", fill = true);
+ });
+ });
+ });
+}
+
+
+#[derive(UiModel, Default)]
+pub struct AttachmentsWindow {
+ note_id: i32,
+
+ #[bind("image")]
+ pub image: UiImage,
+
+ #[bind("webview")]
+ pub webview: UiWeb,
+}
+
+#[ui_actions]
+impl AttachmentsWindow {
+ pub fn new(note_id: i32) -> AttachmentsWindow {
+ AttachmentsWindow {
+ note_id,
+ ..Default::default()
+ }
+ }
+
+ #[action]
+ pub fn go_back(&mut self, _event: &ActionEvent) {
+
+ }
+
+ #[action]
+ pub fn go_forward(&mut self, _event: &ActionEvent) {
+
+ }
+}