pub struct RichMediaAnnotation {
pub rect: Rect,
pub content: RichMediaContent,
pub settings: RichMediaSettings,
pub title: Option<String>,
pub flags: AnnotationFlags,
pub contents: Option<String>,
}Expand description
A RichMedia annotation for interactive content.
Per Adobe Supplement to ISO 32000-1 (Extension Level 3). Note: Flash support is deprecated in modern viewers.
Fields§
§rect: RectBounding rectangle
content: RichMediaContentContent (assets and configurations)
settings: RichMediaSettingsSettings (activation, presentation)
title: Option<String>Annotation title
flags: AnnotationFlagsAnnotation flags
contents: Option<String>Contents/description
Implementations§
Source§impl RichMediaAnnotation
impl RichMediaAnnotation
Sourcepub fn new(rect: Rect, content: RichMediaContent) -> Self
pub fn new(rect: Rect, content: RichMediaContent) -> Self
Create a new RichMedia annotation.
Sourcepub fn video(rect: Rect, name: impl Into<String>, data: Vec<u8>) -> Self
pub fn video(rect: Rect, name: impl Into<String>, data: Vec<u8>) -> Self
Create a RichMedia annotation with a single video asset.
Sourcepub fn with_settings(self, settings: RichMediaSettings) -> Self
pub fn with_settings(self, settings: RichMediaSettings) -> Self
Set the settings.
Sourcepub fn with_activation(self, activation: RichMediaActivation) -> Self
pub fn with_activation(self, activation: RichMediaActivation) -> Self
Set activation condition.
Sourcepub fn with_deactivation(self, deactivation: RichMediaDeactivation) -> Self
pub fn with_deactivation(self, deactivation: RichMediaDeactivation) -> Self
Set deactivation condition.
Sourcepub fn with_window(self, window: RichMediaWindow) -> Self
pub fn with_window(self, window: RichMediaWindow) -> Self
Set window type.
Sourcepub fn with_toolbar(self, toolbar: bool) -> Self
pub fn with_toolbar(self, toolbar: bool) -> Self
Set toolbar visibility.
Sourcepub fn with_title(self, title: impl Into<String>) -> Self
pub fn with_title(self, title: impl Into<String>) -> Self
Set title.
Sourcepub fn with_contents(self, contents: impl Into<String>) -> Self
pub fn with_contents(self, contents: impl Into<String>) -> Self
Set description/contents.
Sourcepub fn with_flags(self, flags: AnnotationFlags) -> Self
pub fn with_flags(self, flags: AnnotationFlags) -> Self
Set annotation flags.
Sourcepub fn add_asset(self, asset: RichMediaAsset) -> Self
pub fn add_asset(self, asset: RichMediaAsset) -> Self
Add an asset to the content.
Sourcepub fn build(&self, _page_refs: &[ObjectRef]) -> HashMap<String, Object>
pub fn build(&self, _page_refs: &[ObjectRef]) -> HashMap<String, Object>
Build the annotation dictionary.
Sourcepub fn content(&self) -> &RichMediaContent
pub fn content(&self) -> &RichMediaContent
Get the content reference.
Trait Implementations§
Source§impl Clone for RichMediaAnnotation
impl Clone for RichMediaAnnotation
Source§fn clone(&self) -> RichMediaAnnotation
fn clone(&self) -> RichMediaAnnotation
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RichMediaAnnotation
impl Debug for RichMediaAnnotation
Source§impl From<RichMediaAnnotation> for Annotation
impl From<RichMediaAnnotation> for Annotation
Source§fn from(richmedia: RichMediaAnnotation) -> Self
fn from(richmedia: RichMediaAnnotation) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for RichMediaAnnotation
impl RefUnwindSafe for RichMediaAnnotation
impl Send for RichMediaAnnotation
impl Sync for RichMediaAnnotation
impl Unpin for RichMediaAnnotation
impl UnsafeUnpin for RichMediaAnnotation
impl UnwindSafe for RichMediaAnnotation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more