#[cfg(not(feature = "mini"))]
use crate::platform::get_platform;
use crate::platform::Platform;
pub struct ClipboardManager;
impl ClipboardManager {
#[cfg(not(feature = "mini"))]
pub fn set_text(text: impl AsRef<str>) -> bool {
Self::set_text_with(get_platform(), text.as_ref())
}
#[cfg(feature = "mini")]
pub fn set_text(_text: impl AsRef<str>) -> bool {
false
}
#[cfg(not(feature = "mini"))]
pub fn text() -> String {
Self::text_with(get_platform())
}
#[cfg(feature = "mini")]
pub fn text() -> String {
String::new()
}
#[cfg_attr(feature = "mini", allow(dead_code))]
pub(crate) fn set_text_with(platform: &dyn Platform, text: &str) -> bool {
platform.set_clipboard_text(text)
}
#[cfg_attr(feature = "mini", allow(dead_code))]
pub(crate) fn text_with(platform: &dyn Platform) -> String {
platform.get_clipboard_text()
}
}