use crate::foundation::NSString;
#[derive(Debug, Copy, Clone)]
pub enum PasteboardName {
Drag,
Find,
Font,
General,
Ruler
}
impl From<PasteboardName> for NSString<'_> {
fn from(name: PasteboardName) -> Self {
NSString::new(match name {
PasteboardName::Drag => "Apple CFPasteboard drag",
PasteboardName::Find => "Apple CFPasteboard find",
PasteboardName::Font => "Apple CFPasteboard font",
PasteboardName::General => "Apple CFPasteboard general",
PasteboardName::Ruler => "Apple CFPasteboard ruler"
})
}
}
#[derive(Debug, Copy, Clone)]
pub enum PasteboardType {
URL,
Color,
FileURL,
Font,
HTML,
MultipleTextSelection,
PDF,
PNG,
RTF,
RTFD,
Ruler,
Sound,
String,
TabularText,
TIFF
}
impl From<PasteboardType> for NSString<'_> {
fn from(pboard_type: PasteboardType) -> Self {
NSString::new(match pboard_type {
PasteboardType::URL => "public.url",
PasteboardType::Color => "com.apple.cocoa.pasteboard.color",
PasteboardType::FileURL => "public.file-url",
PasteboardType::Font => "com.apple.cocoa.pasteboard.character-formatting",
PasteboardType::HTML => "public.html",
PasteboardType::MultipleTextSelection => "com.apple.cocoa.pasteboard.multiple-text-selection",
PasteboardType::PDF => "com.adobe.pdf",
PasteboardType::PNG => "public.png",
PasteboardType::RTF => "public.rtf",
PasteboardType::RTFD => "com.apple.flat-rtfd",
PasteboardType::Ruler => "com.apple.cocoa.pasteboard.paragraph-formatting",
PasteboardType::Sound => "com.apple.cocoa.pasteboard.sound",
PasteboardType::String => "public.utf8-plain-text",
PasteboardType::TabularText => "public.utf8-tab-separated-values-text",
PasteboardType::TIFF => "public.tiff"
})
}
}