pdftron::PDF::Annots::Sound Class Reference

A Sound annotation represents a sound recording attached to a point in the PDF document. More...

#include <Sound.h>

Inheritance diagram for pdftron::PDF::Annots::Sound:

Inheritance graph
[legend]
Collaboration diagram for pdftron::PDF::Annots::Sound:

Collaboration graph
[legend]

List of all members.

Public Types

enum  Icon { e_Speaker, e_Mic, e_Unknown }
 The Icon of the Sound annotation. More...

Public Member Functions

 Sound (SDF::Obj d=0)
 Creates a Sound annotation and initializes it using given Cos/SDF object.
 Sound (const Annot &ann)
 Creates a Sound annotation and initializes it using given annotation object.
SDF::Obj GetSoundStream () const
 Returns the sound object of the Sound annotation.
void SetSoundStream (SDF::Obj sound_stream)
 Sets the sound object of the Sound annotation.
Icon GetIcon () const
 Returns the Icon of the Sound annotation.
void SetIcon (Icon type=e_Speaker)
 Sets the Icon of the Sound annotation.
const char * GetIconName () const
 Returns the Icon name of the Sound annotation.
void SetIcon (const char *type)
 Sets the Icon name of the Sound annotation.

Static Public Member Functions

static Sound Create (SDF::SDFDoc &doc, const Rect &pos, Icon icon=e_Speaker)
 Creates a new Sound annotation in the specified document.
static Sound Create (SDF::SDFDoc &doc, const Point &pos, Icon icon=e_Speaker)
 Creates a new Sound annotation in the specified document.


Detailed Description

A Sound annotation represents a sound recording attached to a point in the PDF document.

When closed, this annotation appear as an icon; when open and activated, a sound record from the computer’s microphone or imported from a file associated with this annotation is played.The icon of this annotation by default is a speaker.


Member Enumeration Documentation

The Icon of the Sound annotation.

Enumerator:
e_Speaker  Speaker sound.
e_Mic  Mic sound.
e_Unknown  Invalid or non-standard.


Constructor & Destructor Documentation

pdftron::PDF::Annots::Sound::Sound ( SDF::Obj  d = 0  ) 

Creates a Sound annotation and initializes it using given Cos/SDF object.

Note:
The constructor does not copy any data, but is instead the logical equivalent of a type cast.

pdftron::PDF::Annots::Sound::Sound ( const Annot ann  )  [inline]

Creates a Sound annotation and initializes it using given annotation object.

Note:
The constructor does not copy any data, but is instead the logical equivalent of a type cast.


Member Function Documentation

static Sound pdftron::PDF::Annots::Sound::Create ( SDF::SDFDoc doc,
const Rect pos,
Icon  icon = e_Speaker 
) [static]

Creates a new Sound annotation in the specified document.

Parameters:
doc A document to which the annotation is added.
pos A rectangle specifying the annotation's bounds in default user space units.
Returns:
A newly created blank Sound annotation.

static Sound pdftron::PDF::Annots::Sound::Create ( SDF::SDFDoc doc,
const Point pos,
Icon  icon = e_Speaker 
) [static]

Creates a new Sound annotation in the specified document.

Parameters:
doc A document to which the annotation is added.
pos A point specifying the annotation's location in default user space units.
Returns:
A newly created blank Sound annotation.

SDF::Obj pdftron::PDF::Annots::Sound::GetSoundStream (  )  const

Returns the sound object of the Sound annotation.

Returns:
An SDF object representing a sound stream.
Note:
The sound stream is to be played when the Sound annotation is activated.

void pdftron::PDF::Annots::Sound::SetSoundStream ( SDF::Obj  sound_stream  ) 

Sets the sound object of the Sound annotation.

Parameters:
sound_stream An SDF object representing a sound stream.
Note:
The sound stream is to be played when the Sound annotation is activated.

Icon pdftron::PDF::Annots::Sound::GetIcon (  )  const

Returns the Icon of the Sound annotation.

Returns:
A value of the "Icon" enum. Default value: e_Speaker.
Note:
The Icon defines the appearance associated with the Sound annotation. The annotation’s appearance stream, if present, will take precedence over this entry.

void pdftron::PDF::Annots::Sound::SetIcon ( Icon  type = e_Speaker  ) 

Sets the Icon of the Sound annotation.

(Optional)

Parameters:
type A value of the "Icon" enumeration type. Default value: e_Speaker.
Note:
The Icon defines the appearance associated with the Sound annotation. The annotation’s appearance stream, if present, will take precedence over this entry.

const char* pdftron::PDF::Annots::Sound::GetIconName (  )  const

Returns the Icon name of the Sound annotation.

Returns:
A string denoting the Icon name of the Sound annotation.
Note:
The following Icon names are equivalent to predefined Icons from the enum "Icon": "Speaker" = e_Speaker "Mic" = e_Mic "Unknown" = e_Unknown The Icon defines the appearance associated with the Sound annotation. Names other than mentioned above do not have predefined icon appearances. The annotation’s appearance stream, if present, will take precedence over this entry.

void pdftron::PDF::Annots::Sound::SetIcon ( const char *  type  ) 

Sets the Icon name of the Sound annotation.

(Optional)

Parameters:
type A string denoting the Icon name of the Sound annotation.
Note:
The following Icon names are equivalent to predefined types from the enum "Icon": "Speaker" = e_Speaker "Mic" = e_Mic "Unknown" = e_Unknown The Icon defines the appearance associated with the Sound annotation. Names other than mentioned above do not have predefined icon appearances. The annotation’s appearance stream, if present, will take precedence over this entry.


© 2002-2010 PDFTron Systems Inc.