All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
pdftron::PDF::Annots::Screen Class Reference

#include <Screen.h>

+ Inheritance diagram for pdftron::PDF::Annots::Screen:

Public Types

enum  IconCaptionRelation {
  e_NoIcon, e_NoCaption, e_CBelowI, e_CAboveI,
  e_CRightILeft, e_CLeftIRight, e_COverlayI
}
 
enum  ScaleCondition { e_Always, e_WhenBigger, e_WhenSmaller, e_Never }
 
enum  ScaleType { e_Anamorphic, e_Proportional }
 
- Public Types inherited from pdftron::PDF::Annot
enum  Type {
  e_Text, e_Link, e_FreeText, e_Line,
  e_Square, e_Circle, e_Polygon, e_Polyline,
  e_Highlight, e_Underline, e_Squiggly, e_StrikeOut,
  e_Stamp, e_Caret, e_Ink, e_Popup,
  e_FileAttachment, e_Sound, e_Movie, e_Widget,
  e_Screen, e_PrinterMark, e_TrapNet, e_Watermark,
  e_3D, e_Redact, e_Projection, e_RichMedia,
  e_Unknown
}
 
enum  Flag {
  e_invisible, e_hidden, e_print, e_no_zoom,
  e_no_rotate, e_no_view, e_read_only, e_locked,
  e_toggle_no_view, e_locked_contents
}
 
enum  ActionTriggerEvent {
  e_action_trigger_activate = 0, e_action_trigger_annot_enter = 1, e_action_trigger_annot_exit = 2, e_action_trigger_annot_down = 3,
  e_action_trigger_annot_up = 4, e_action_trigger_annot_focus = 5, e_action_trigger_annot_blur = 6, e_action_trigger_annot_page_open = 7,
  e_action_trigger_annot_page_close = 8, e_action_trigger_annot_page_visible = 9, e_action_trigger_annot_page_invisible = 10
}
 
enum  AnnotationState { e_normal, e_rollover, e_down }
 
typedef pdftron::PDF::BorderStyle BorderStyle
 

Public Member Functions

 Screen (SDF::Obj d=0)
 
 Screen (const Annot &ann)
 
UString GetTitle () const
 
void SetTitle (const UString &title)
 
Action GetAction () const
 
void SetAction (const Action &action)
 
int GetBorderColorCompNum () const
 
ColorPt GetBorderColor () const
 
void SetBorderColor (const ColorPt &col, int numcomp)
 
int GetBackgroundColorCompNum () const
 
ColorPt GetBackgroundColor () const
 
void SetBackgroundColor (const ColorPt &col, int numcomp)
 
UString GetStaticCaptionText () const
 
void SetStaticCaptionText (const UString &contents)
 
UString GetRolloverCaptionText () const
 
void SetRolloverCaptionText (const UString &contents)
 
UString GetMouseDownCaptionText () const
 
void SetMouseDownCaptionText (const UString &contents)
 
SDF::Obj GetStaticIcon () const
 
void SetStaticIcon (SDF::Obj icon)
 
SDF::Obj GetRolloverIcon () const
 
void SetRolloverIcon (SDF::Obj icon)
 
SDF::Obj GetMouseDownIcon () const
 
void SetMouseDownIcon (SDF::Obj icon)
 
IconCaptionRelation GetIconCaptionRelation () const
 
void SetIconCaptionRelation (IconCaptionRelation icr)
 
ScaleCondition GetScaleCondition () const
 
void SetScaleCondition (ScaleCondition sc)
 
ScaleType GetScaleType () const
 
void SetScaleType (ScaleType st)
 
double GetHIconLeftOver () const
 
void SetHIconLeftOver (double hl)
 
double GetVIconLeftOver () const
 
void SetVIconLeftOver (double vl)
 
bool GetFitFull () const
 
void SetFitFull (bool ff)
 
- Public Member Functions inherited from pdftron::PDF::Annot
 Annot (SDF::Obj d=0)
 
 Annot (const Annot &d)
 
Annotoperator= (const Annot &d)
 
bool operator== (const Annot &d)
 
bool IsValid () const
 
SDF::Obj GetSDFObj () const
 
Type GetType () const
 
Rect GetRect () const
 
Rect GetVisibleContentBox () const
 
bool IsMarkup () const
 
void SetRect (const Rect &pos)
 
Page GetPage () const
 
void SetPage (const Page &page)
 
SDF::Obj GetUniqueID () const
 
void SetUniqueID (const char *id, int id_buf_sz=0)
 
Date GetDate () const
 
void SetDate (const Date &date)
 
bool GetFlag (Flag flag) const
 
void SetFlag (Flag flag, bool value)
 
SDF::Obj GetTriggerAction (Annot::ActionTriggerEvent trigger)
 
BorderStyle GetBorderStyle () const
 
void SetBorderStyle (const BorderStyle &bs, bool oldStyleOnly=false)
 
SDF::Obj GetAppearance (AnnotationState annot_state=e_normal, const char *app_state=0)
 
void SetAppearance (SDF::Obj app_stream, AnnotationState annot_state=e_normal, const char *app_state=0)
 
void RemoveAppearance (AnnotationState annot_state=e_normal, const char *app_state=0)
 
void Flatten (class Page page)
 
const char * GetActiveAppearanceState () const
 
void SetActiveAppearanceState (const char *astate)
 
ColorPt GetColorAsRGB () const
 
ColorPt GetColorAsCMYK () const
 
ColorPt GetColorAsGray () const
 
int GetColorCompNum () const
 
void SetColor (const ColorPt &col, int numcomp=3)
 
int GetStructParent () const
 
void SetStructParent (const int parkeyval)
 
SDF::Obj GetOptionalContent () const
 
void SetOptionalContent (SDF::Obj content)
 
void SetContents (const UString &contents)
 
UString GetContents () const
 
int GetRotation () const
 
void SetRotation (int angle)
 
void RefreshAppearance ()
 
void RefreshAppearance (const RefreshOptions &options)
 
UString GetCustomData (const UString &key) const
 
void SetCustomData (const UString &key, const UString &value)
 
void DeleteCustomData (const UString &key)
 
void Resize (const Rect &newrect)
 
ptrdiff_t GetHandleInternal ()
 

Static Public Member Functions

static Screen Create (SDF::SDFDoc &doc, const Rect &pos)
 
static Screen CreateAnnot (SDF::SDFDoc &doc, const Rect &pos)
 
- Static Public Member Functions inherited from pdftron::PDF::Annot
static Annot Create (SDF::SDFDoc &doc, Type type, const Rect &pos)
 
static AnnotCreateInternal (ptrdiff_t impl)
 

Detailed Description

A screen annotation (PDF 1.5) specifies a region of a page upon which media clips may be played. It also serves as an object from which actions can be triggered.

Definition at line 18 of file Screen.h.

Member Enumeration Documentation

An enumeration indicating where to position the text of the annotation's caption relative to its icon.

e_NoIcon - No icon; caption only e_NoCaption - No caption; icon only e_CBelowI - Caption below the icon e_CAboveI - Caption above the icon e_CRightILeft - Caption to the right of the icon e_CLeftIRight - Caption to the left of the icon e_COverlayI - Caption overlaid directly on the icon Default value: e_NoIcon.

Enumerator
e_NoIcon 
e_NoCaption 
e_CBelowI 
e_CAboveI 
e_CRightILeft 
e_CLeftIRight 
e_COverlayI 

Definition at line 279 of file Screen.h.

Note
The functionality documented below is part of the Icon Fit dictionary. This dictionary specifies how to display the button's icon within the annotation rectangle. If present, the icon fit dictionary shall apply to all of the annotation's icons (normal, rollover, and alternate). This enum represents the circumstances under which the icon shall be scaled inside the annotation rectangle.
Enumerator
e_Always 

Always scale.

e_WhenBigger 

Scale only when the icon is bigger than the annotation rectangle.

e_WhenSmaller 

Scale only when the icon is smaller than the annotation rectangle.

e_Never 

Never scale.

Definition at line 322 of file Screen.h.

This enum represents the scale type of the annotation.

e_Anamorphic - Scale the icon to fill the annotation rectangle exactly, without regard to its original aspect ratio (ratio of width to height). e_Proportional - Scale the icon to fit the width or height of the annotation rectangle while maintaining the icon's original aspect ratio. If the required horizontal and vertical scaling factors are different, use the smaller of the two, centering the icon within the annotation rectangle in the other dimension. Default value: e_Proportional.

Enumerator
e_Anamorphic 
e_Proportional 

Definition at line 363 of file Screen.h.

Constructor & Destructor Documentation

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

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

Parameters
dThe Cos/SDF object to initialze the annotation with.
Note
The constructor does not copy any data, but is instead the logical equivalent of a type cast.
pdftron::PDF::Annots::Screen::Screen ( const Annot ann)
inline

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

Parameters
annAnnot object used to initialize the Screen annotation.
Note
The constructor does not copy any data, but is instead the logical equivalent of a type cast.

Definition at line 35 of file Screen.h.

Member Function Documentation

static Screen pdftron::PDF::Annots::Screen::Create ( SDF::SDFDoc doc,
const Rect pos 
)
static

Creates a new Screen annotation in the specified document.

Parameters
docA document to which the annotation is added.
posA rectangle specifying the annotation's bounds in default user space units.
Returns
A newly created blank Screen annotation.
static Screen pdftron::PDF::Annots::Screen::CreateAnnot ( SDF::SDFDoc doc,
const Rect pos 
)
static
Action pdftron::PDF::Annots::Screen::GetAction ( ) const

Returns the action of the Screen annotation

Returns
An action object representing the action of the annotation.
Note
The action is an action that shall be performed when the annotation is activated.
ColorPt pdftron::PDF::Annots::Screen::GetBackgroundColor ( ) const

Returns the background color of the annotation.

Returns
A color object that denotes the color of the Screen background.
Note
The color can be in different color spaces: Gray, RGB, or CMYK. Call "GetBackgroundColorCompNum" to access the color space information corresponding to the border color.
int pdftron::PDF::Annots::Screen::GetBackgroundColorCompNum ( ) const

Returns the number indicating background color space of the annotation.

Returns
An integer indicating a color space value from the ColorSpace::Type enum. That is, 1 corresponding to "e_device_gray", 3 corresponding to "e_device_rgb", and 4 corresponding to "e_device_cmyk" if color space is applicable, 0 means no background color was assigned.
ColorPt pdftron::PDF::Annots::Screen::GetBorderColor ( ) const

Returns the border color of the annotation.

Returns
A color object that denotes the color of the Screen border.
Note
The color can be in different color spaces: Gray, RGB, or CMYK. Call "GetBorderColorCompNum" to access the color space information corresponding to the border color.
int pdftron::PDF::Annots::Screen::GetBorderColorCompNum ( ) const

Returns the number indicating border color space of the annotation.

Returns
An integer indicating a color space value from the ColorSpace::Type enum. That is, 1 corresponding to "e_device_gray", 3 corresponding to "e_device_rgb", and 4 corresponding to "e_device_cmyk". 0 means this annotation had no color assigned.
bool pdftron::PDF::Annots::Screen::GetFitFull ( ) const

Returns the "fit full" flag.

Returns
A boolean value indicating the "fit full" flag value.
Note
the fit full flag, if true, indicates that the button appearance shall be scaled to fit fully within the bounds of the annotation without taking into consideration the line width of the border. Default value: false.
double pdftron::PDF::Annots::Screen::GetHIconLeftOver ( ) const

Returns the horizontal leftover space of the icon within the annotation.

Returns
A number indicating the horizontal leftover space of the icon within the annotation.
Note
the horizontal leftover is a number that shall be between 0.0 and 1.0 indicating the fraction of leftover space to allocate at the left. A value of 0.0 shall position the icon at the left of the annotation rectangle. A value of 0.5 shall center it in the horizontal direction within the rectangle. This entry shall be used only if the icon is scaled proportionally. Default value: 0.5.
IconCaptionRelation pdftron::PDF::Annots::Screen::GetIconCaptionRelation ( ) const

Returns the Icon and caption relationship of the annotation.

Returns
A value of the "IconCaptionRelation" enum type. Default value: e_NoIcon.
See Also
IconCaptionRelation
UString pdftron::PDF::Annots::Screen::GetMouseDownCaptionText ( ) const

Returns the button down caption text of the annotation.

Returns
A string containing the button down text of the annotation.
Note
The button down caption shall be displayed when the mouse button is pressed within its active area.
SDF::Obj pdftron::PDF::Annots::Screen::GetMouseDownIcon ( ) const

Returns the Mouse Down icon associated with the annotation.

Returns
An SDF object that represents the Mouse Down icon associated with the annotation.
Note
The Mouse Down icon object is a form XObject defining the annotation's alternate (down) icon, which shall be displayed when the mouse button is pressed within its active area.
UString pdftron::PDF::Annots::Screen::GetRolloverCaptionText ( ) const

Returns the rollover caption text of the annotation.

Returns
A string containing the rollover caption text of the annotation.
Note
The rollover caption shall be displayed when the user rolls the cursor into its active area without pressing the mouse button.
SDF::Obj pdftron::PDF::Annots::Screen::GetRolloverIcon ( ) const

Returns the rollover icon associated with the annotation.

Returns
An SDF object that represents the rollover icon associated with the annotation.
Note
The rollover icon object is a form XObject defining the annotation's rollover icon, which shall be displayed when the user rolls the cursor into its active area without pressing the mouse button.
ScaleCondition pdftron::PDF::Annots::Screen::GetScaleCondition ( ) const

Returns the condition under which the icon should be scaled.

Returns
A value of the "ScaleCondition" enum type. Default value: e_Always.
See Also
ScaleCondition
ScaleType pdftron::PDF::Annots::Screen::GetScaleType ( ) const

Returns the Scale Type of the annotation.

Returns
A value of the "ScaleType" enum which represents the Scale Type of the annotation. Default value: P.
See Also
ScaleType
UString pdftron::PDF::Annots::Screen::GetStaticCaptionText ( ) const

Returns static caption text of the annotation.

Returns
A string containing the static caption text of the annotation.
Note
The static caption is the annotation's normal caption, which shall be displayed when it is not interacting with the user.
SDF::Obj pdftron::PDF::Annots::Screen::GetStaticIcon ( ) const

Returns the static icon associated with the annotation.

Returns
An SDF object that represents the static icon associated with the annotation.
Note
The static icon object is a form XObject defining the annotation's normal icon, which shall be displayed when it is not interacting with the user.
UString pdftron::PDF::Annots::Screen::GetTitle ( ) const

Returns the title of the annotation.

Returns
A string representing the title of the annotation.
double pdftron::PDF::Annots::Screen::GetVIconLeftOver ( ) const

Returns the vertical leftover space of the icon within the annotation.

Returns
a number indicating the vertical leftover space of the icon within the annotation.
Note
the vertical leftover space is a number that shall be between 0.0 and 1.0 indicating the fraction of leftover space to allocate at the bottom of the icon. A value of 0.0 shall position the icon at the bottom of the annotation rectangle. A value of 0.5 shall center it in the vertical direction within the rectangle. This entry shall be used only if the icon is scaled proportionally. Default value: 0.5.
void pdftron::PDF::Annots::Screen::SetAction ( const Action action)

Sets the action of the Screen annotation (Optional; PDF 1.1 )

Parameters
actionAn action object representing the action of the annotation.
Note
The action is an action that shall be performed when the annotation is activated.
void pdftron::PDF::Annots::Screen::SetBackgroundColor ( const ColorPt col,
int  numcomp 
)

Sets the background color of the annotation. (Optional)

Parameters
colA color point that denotes the color of the screen background.
numcompAn integer which value indicates the color space used for the parameter c.
void pdftron::PDF::Annots::Screen::SetBorderColor ( const ColorPt col,
int  numcomp 
)

Sets the border color of the annotation. (Optional)

Parameters
colA color object that denotes the color of the screen border.
numcompAn integer which value indicates the color space used for the parameter c.
void pdftron::PDF::Annots::Screen::SetFitFull ( bool  ff)

Sets the "fit full" flag. (Optional)

Parameters
ffA boolean value indicating the "fit full" flag value.
Note
the fit full flag, if true, indicates that the button appearance shall be scaled to fit fully within the bounds of the annotation without taking into consideration the line width of the border. Default value: false.
void pdftron::PDF::Annots::Screen::SetHIconLeftOver ( double  hl)

Sets the horizontal leftover space of the icon within the annotation. (Optional)

Parameters
hlA number indicating the horizontal leftover space of the icon within the annotation.
Note
the horizontal leftover space is a number that shall be between 0.0 and 1.0 indicating the fraction of leftover space to allocate at the left. A value of 0.0 shall position the icon at the left of the annotation rectangle. A value of 0.5 shall center it in the horizontal direction within the rectangle. This entry shall be used only if the icon is scaled proportionally. Default value: 0.5.
void pdftron::PDF::Annots::Screen::SetIconCaptionRelation ( IconCaptionRelation  icr)

Sets the Icon and caption relationship of the annotation. (Optional; pushbutton fields only)

Parameters
icrA value of the "IconCaptionRelation" enum type. Default value: e_NoIcon.
See Also
IconCaptionRelation
void pdftron::PDF::Annots::Screen::SetMouseDownCaptionText ( const UString contents)

Sets the button down caption text of the annotation. (Optional; button fields only)

Parameters
contentsA string containing the button down text of the annotation.
Note
The button down caption shall be displayed when the mouse button is pressed within its active area.
void pdftron::PDF::Annots::Screen::SetMouseDownIcon ( SDF::Obj  icon)

Sets the Mouse Down icon associated with the annotation. (Optional; button fields only)

Parameters
iconAn SDF object that represents the Mouse Down icon associated with the annotation.
Note
The Mouse Down icon object is a form XObject defining the annotation's alternate (down) icon, which shall be displayed when the mouse button is pressed within its active area.
void pdftron::PDF::Annots::Screen::SetRolloverCaptionText ( const UString contents)

Sets the roll over caption text of the annotation. (Optional; button fields only)

Parameters
contentsA string containing the roll over caption text of the annotation.
Note
The rollover caption shall be displayed when the user rolls the cursor into its active area without pressing the mouse button.
void pdftron::PDF::Annots::Screen::SetRolloverIcon ( SDF::Obj  icon)

Sets the rollover icon associated with the annotation. (Optional; button fields only)

Parameters
iconAn SDF object that represents the rollover icon associated with the annotation.
Note
The rollover icon object is a form XObject defining the annotation's rollover icon, which shall be displayed when the user rolls the cursor into its active area without pressing the mouse button.
void pdftron::PDF::Annots::Screen::SetScaleCondition ( ScaleCondition  sc)

Sets the condition under which the icon should be scaled. (Optional)

Parameters
scA value of the "ScaleCondition" enum type. Default value: e_Always.
void pdftron::PDF::Annots::Screen::SetScaleType ( ScaleType  st)

Sets the Scale Type of the annotation. (Optional)

Parameters
stAn entry of the "ScaleType" enum which represents the Scale Type of the annotation. Default value: P.
See Also
ScaleType
void pdftron::PDF::Annots::Screen::SetStaticCaptionText ( const UString contents)

Sets static caption text of the annotation. (Optional; button fields only)

Parameters
contentsA string containing the static caption text of the annotation.
Note
The static caption is the annotation's normal caption, which shall be displayed when it is not interacting with the user.
void pdftron::PDF::Annots::Screen::SetStaticIcon ( SDF::Obj  icon)

Sets the static icon associated with the annotation. (Optional; button fields only)

Parameters
iconAn SDF object that represents the static icon associated with the annotation.
Note
The static icon object is a form XObject defining the annotation's normal icon, which shall be displayed when it is not interacting with the user.
void pdftron::PDF::Annots::Screen::SetTitle ( const UString title)

Sets the title of the Annotation. (Optional)

Parameters
titleA string representing the title of the annotation.
void pdftron::PDF::Annots::Screen::SetVIconLeftOver ( double  vl)

Sets the vertical leftover space of the icon within the annotation. (Optional)

Parameters
vlA number indicating the vertical leftover space of the icon within the annotation.
Note
the vertical leftover space is a number that shall be between 0.0 and 1.0 indicating the fraction of leftover space to allocate at the bottom of the icon. A value of 0.0 shall position the icon at the bottom of the annotation rectangle. A value of 0.5 shall center it in the vertical direction within the rectangle. This entry shall be used only if the icon is scaled proportionally. Default value: 0.5.

The documentation for this class was generated from the following file: