85 lines
2.2 KiB
Rust
85 lines
2.2 KiB
Rust
use std::collections::HashMap;
|
|
|
|
use zbus::{proxy, zvariant};
|
|
|
|
#[proxy(
|
|
interface = "org.freedesktop.portal.Documents",
|
|
default_service = "org.freedesktop.portal.Documents",
|
|
default_path = "/org/freedesktop/portal/documents"
|
|
)]
|
|
pub trait Documents {
|
|
/// Add method
|
|
fn add(
|
|
&self,
|
|
o_path_fd: zvariant::Fd<'_>,
|
|
reuse_existing: bool,
|
|
persistent: bool,
|
|
) -> zbus::Result<String>;
|
|
|
|
/// AddFull method
|
|
fn add_full(
|
|
&self,
|
|
o_path_fds: &[zvariant::Fd<'_>],
|
|
flags: u32,
|
|
app_id: &str,
|
|
permissions: &[&str],
|
|
) -> zbus::Result<(Vec<String>, HashMap<String, zvariant::OwnedValue>)>;
|
|
|
|
/// AddNamed method
|
|
fn add_named(
|
|
&self,
|
|
o_path_parent_fd: zvariant::Fd<'_>,
|
|
filename: &[u8],
|
|
reuse_existing: bool,
|
|
persistent: bool,
|
|
) -> zbus::Result<String>;
|
|
|
|
/// AddNamedFull method
|
|
#[allow(clippy::too_many_arguments)]
|
|
fn add_named_full(
|
|
&self,
|
|
o_path_fd: zvariant::Fd<'_>,
|
|
filename: &[u8],
|
|
flags: u32,
|
|
app_id: &str,
|
|
permissions: &[&str],
|
|
) -> zbus::Result<(String, HashMap<String, zvariant::OwnedValue>)>;
|
|
|
|
/// Delete method
|
|
fn delete(&self, doc_id: &str) -> zbus::Result<()>;
|
|
|
|
/// GetHostPaths method
|
|
fn get_host_paths(&self, doc_ids: &[&str]) -> zbus::Result<HashMap<String, Vec<u8>>>;
|
|
|
|
/// GetMountPoint method
|
|
fn get_mount_point(&self) -> zbus::Result<Vec<u8>>;
|
|
|
|
/// GrantPermissions method
|
|
fn grant_permissions(
|
|
&self,
|
|
doc_id: &str,
|
|
app_id: &str,
|
|
permissions: &[&str],
|
|
) -> zbus::Result<()>;
|
|
|
|
/// Info method
|
|
fn info(&self, doc_id: &str) -> zbus::Result<(Vec<u8>, HashMap<String, Vec<String>>)>;
|
|
|
|
/// List method
|
|
fn list(&self, app_id: &str) -> zbus::Result<HashMap<String, Vec<u8>>>;
|
|
|
|
/// Lookup method
|
|
fn lookup(&self, filename: &[u8]) -> zbus::Result<String>;
|
|
|
|
/// RevokePermissions method
|
|
fn revoke_permissions(
|
|
&self,
|
|
doc_id: &str,
|
|
app_id: &str,
|
|
permissions: &[&str],
|
|
) -> zbus::Result<()>;
|
|
|
|
/// version property
|
|
#[zbus(property, name = "version")]
|
|
fn version(&self) -> zbus::Result<u32>;
|
|
}
|