An interface class for a widget annotation It is intended that future releases of JawsMako will extend this interface. More...
#include <interactive.h>
Public Types | |
enum | eHighlightMode |
The highlight mode for a Widget annotation. | |
enum | eFontEncoding |
Encoding scheme used for form fonts. | |
Public Types inherited from JawsMako::IAnnotation | |
enum | eAnnotationType { eAT3D , eATCaret , eATCircle , eATFileAttachment , eATFreeText , eATHighlight , eATInk , eATLine , eATLink , eATMovie , eATPolygon , eATPolyLine , eATPopup , eATPrinterMark , eATProjection , eATRedact , eATRichMedia , eATScreen , eATSound , eATSquare , eATSquiggly , eATStamp , eATStrikeOut , eATText , eATTrapNet , eATUnderline , eATWatermark , eATWidget , eATOther } |
Types of annotations, listed with the earliest version of PDF that supported them. More... | |
Public Member Functions | |
virtual void | createBasicAppearances (const IFormPtr &form, const U8String &onStateName=U8String(), const IDOMFontPtr &font=IDOMFontPtr(), uint32 fontIndex=0, float captionSize=10.0f)=0 |
Create a set of very basic appearances given the current annotation's parameters. Replaces any already present. Not yet supported for all widget types. An IError with error code JM_ERR_UNSUPPORTED will be thrown for such appearances. | |
virtual eFieldType | getFieldType () const =0 |
Get the field type. | |
virtual U8String | getPartialName () const =0 |
Get the partial name of the widget. | |
virtual void | setPartialName (const U8String &name)=0 |
Set the partial name of the widget. | |
virtual eHighlightMode | getHighlightMode () const =0 |
Get the highlight mode. | |
virtual void | setHighlightMode (eHighlightMode highlightMode)=0 |
Set the hightlight mode. | |
virtual bool | getFieldFlags (uint32 &flags) const =0 |
Get the field flags. Please see the PDF specification for the definition of the flags. See also eFieldFlags. Note that the significance of of the flags changes depending on type, and that the value may be inheritable. | |
virtual void | setFieldFlags (uint32 flags)=0 |
Set the field flags. Refer to the PDF specification 1.7 table 8.70 for details. | |
virtual IWidgetAppearanceCharacteristicsPtr | getAppearanceCharacteristics () const =0 |
Get the appearance characteristics of this Widget. | |
virtual void | setAppearanceCharacteristics (const IWidgetAppearanceCharacteristicsPtr &appearanceCharacteristics)=0 |
Set the appearance characteristics. | |
virtual bool | getValue (CU8StringVect &value) const =0 |
Get the value of the field, as an array of strings. | |
virtual void | setValue (const CU8StringVect &value)=0 |
Set the value of the field, as an array of strings. For fields that can take multiple values, eg radio buttons, there will be multiple entries. For fields requiring only a single value, a single entry will be returned. If the field has no value an empty array will be returned. | |
virtual void | setValue (const U8String &value) |
Convenience form for fields that only need a single value. | |
virtual bool | getDefaultValue (CU8StringVect &value) const =0 |
Get the default value of the field, as an array of strings. | |
virtual void | setDefaultValue (const CU8StringVect &value)=0 |
Set the value of the field, as an array of strings. | |
virtual void | setDefaultValue (const U8String &value) |
Convenience form for fields that only need a single value. | |
virtual bool | getDefaultAppearanceString (U8String &defaultAppearanceString) const =0 |
Get the default appearance string for variable text, if set. | |
virtual void | setDefaultAppearanceString (const U8String &defaultAppearanceString)=0 |
Set the default appearance string for variable text. | |
virtual eQuadding | getQuadding () const =0 |
Get the Quadding (Justification) for variable text. | |
virtual void | setQuadding (eQuadding quadding)=0 |
Set the quadding (Justification) for variable text. | |
virtual bool | getOptions (CFieldOptionVect &options) const =0 |
Get the options for this field. | |
virtual void | setOptions (const CFieldOptionVect &options)=0 |
Set the options for this field. | |
virtual uint32 | getFirstVisibleOption () const =0 |
Get the index of the first item visible in the list from the options. | |
virtual void | setFirstVisibleOption (uint32 option)=0 |
Set the index of the first item visible in the list from the options. | |
virtual CUInt32Vect | getSelectedOptions () const =0 |
Get a vector of 0-indexed indexes into the options for this field that represent the currently selected options. | |
virtual void | setSelectedOptions (const CUInt32Vect &selectedOptions)=0 |
Set the currently selected options by 0-indexed indexes into the options. | |
virtual IPDFDictionaryConstPtr | getActionsDictionary () const =0 |
Get the actions dictionary (if present) associated with this widget. | |
virtual void | setActionsDictionary (const IPDFDictionaryPtr &actions)=0 |
Set the actions dictionary associated with this widget. | |
virtual IPDFDictionaryConstPtr | getAdditionalActionsDictionary () const =0 |
Get the additional actions dictionary (if present) associated with this widget. | |
virtual void | setAdditionalActionsDictionary (const IPDFDictionaryPtr &actions)=0 |
Set the additional actions dictionary associated with this widget. | |
Public Member Functions inherited from JawsMako::IAnnotation | |
virtual eAnnotationType | getType () const =0 |
Get the type of the annotation. | |
virtual const FRect & | getRect () const =0 |
Get the rect in which the appearances should be displayed. | |
virtual void | setRect (const FRect &rect)=0 |
Set the rect in which the appearances should be displayed. | |
virtual U8String | getContents () const =0 |
Get the Contents entry in UTF-8. | |
virtual void | setContents (const U8String &contents)=0 |
Set the Contents entry in UTF-8. | |
virtual IDOMColorPtr | getColor () const =0 |
Get the color. The use of this color depends on the annotation type. See the PDF 1.7 specification for details. | |
virtual void | setColor (const IDOMColorPtr &color)=0 |
Set the color. The use of this color depends on the annotation type. See the PDF 1.7 specification for details. | |
virtual IEDLTimePtr | getModificationTime () const =0 |
Get the Modification date and time of the annotation, if present. | |
virtual void | setModificationTime (const IEDLTimePtr &modificationTime)=0 |
Set the Modification date and time of the annotation. | |
virtual CAnnotationBorder | getBorder () const =0 |
Get the annotation's border. See CAnnotationBorder for details. | |
virtual void | setBorder (const CAnnotationBorder &border)=0 |
Set the annotation's border. | |
virtual uint32 | getFlags () const =0 |
Get the annotation flags. To interpret these flags please see section 8.4.2 "Annotation Flags" in the PDF 1.7 specification. | |
virtual void | setFlags (uint32 flags)=0 |
Set the annotation flags. Please see section 8.4.2 "Annotation Flags" for details about these flags. | |
virtual void | rotate (uint16 rotate, double pageWidth, double pageHeight)=0 |
Rotate the annotation clockwise as if the page was rotated by the same amount. | |
virtual CAnnotationAppearanceVect | getAppearances () const =0 |
Return all the annotation appearances in a vector. | |
virtual void | removeAppearances ()=0 |
Remove all annotation appearances. | |
virtual U8String | getState () const =0 |
Get the current annotation state. | |
virtual void | setState (const U8String &state)=0 |
Set the current annotation state. | |
virtual IAnnotationAppearancePtr | getAppearance (eAppearanceUsage usage, const U8String &state=U8String()) const =0 |
Fetch the annotation appearance that should be used for the given annotation usage and state according to the following rules: | |
virtual void | addAppearance (const IAnnotationAppearancePtr &appearance)=0 |
Add or replace an appearance. | |
virtual bool | hasNormalAppearance () const =0 |
Does the annotation have a normal appearance? Convenience utility function. | |
virtual IAnnotationPtr | clone () const =0 |
Clone the annotation. This is a deep clone. The annotation reference will remain the same. | |
virtual bool | matchesReference (const IAnnotationReferencePtr &reference) const =0 |
Does this annotation match the given IAnnotationReference? | |
virtual IAnnotationReferencePtr | getReference () const =0 |
Get a reference that can be used to refer to this annotation. | |
Public Member Functions inherited from IRCObject | |
virtual void | addRef () const =0 |
Increases the reference count of the actual object pointed to. This would take place during an assignment or copying. | |
virtual bool | decRef () const =0 |
Decreases the reference count of the actual object pointed to. When the reference count falls to Zero, it deletes the actual object pointed to. | |
virtual int32 | getRefCount () const =0 |
Retrieve the current reference count of the actual object pointed to. | |
Static Public Member Functions | |
static JAWSMAKO_API IWidgetAnnotationPtr | createTextField (const IJawsMakoPtr &jawsMako, const IFormPtr &form, const IPagePtr &page, const FRect &rect, const U8String &partialName, const U8String &text, float textSize, const IDOMFontOpenTypePtr &font, uint32 fontIndex=0, eFontEncoding encodingHint=eFELatin, const IDOMColorPtr &color=IDOMColorPtr(), bool multiLine=false, eQuadding quadding=eQLeftJustified) |
Creator for a simple text annotation, including a basic appearance stream, inserts it into the form, and places it on the given page. | |
static JAWSMAKO_API IWidgetAnnotationPtr | createCheckButton (const IJawsMakoPtr &jawsMako, const IFormPtr &form, const IPagePtr &page, const FRect &rect, const U8String &partialName, const U8String &onValue, bool on=false) |
Creator for a check button annotation, including basic appearance streams, inserts it into the form, and places it on the given page. | |
static JAWSMAKO_API IFormFieldPtr | createRadioButtons (const IJawsMakoPtr &jawsMako, const IFormPtr &form, const IPagePtr &page, const U8String &partialName, const U8String &value, const CRadioButtonInfoVect &buttonDetails) |
Creator for a set of radio buttons, including basic appearance streams, inserts them into the form inside a new subfield, and places them on the given page. | |
static JAWSMAKO_API IWidgetAnnotationPtr | createChoiceField (const IJawsMakoPtr &jawsMako, const IFormPtr &form, const IPagePtr &page, const FRect &rect, const U8String &partialName, bool combo, bool editable, bool multiSelect, const CFieldOptionVect &options, const CU8StringVect &selectedOptions, float textSize, const IDOMFontOpenTypePtr &font, uint32 fontIndex=0, eFontEncoding encodingHint=eFELatin, const IDOMColorPtr &color=IDOMColorPtr()) |
Creator for a choice annotation, including basic appearance streams, inserts it into the form, and places it on the given page. Can create either menus, combo boxes, or selection boxes. | |
static JAWSMAKO_API IWidgetAnnotationPtr | createButton (const IJawsMakoPtr &jawsMako, const IFormPtr &form, const IPagePtr &page, const FRect &rect, const U8String &partialName, const U8String &caption, float textSize, const IDOMFontOpenTypePtr &font, uint32 fontIndex=0, eFontEncoding encodingHint=eFELatin, const IDOMColorPtr &color=IDOMColorPtr(), const IDOMColorPtr &backgroundColor=IDOMColorPtr(), const IPDFDictionaryPtr &actions=IPDFDictionaryPtr()) |
Convenience creator for a push button annotation, including basic appearance streams, inserts it into the form, and places it on the given page. Makes use of the above APIs to do its work. Can create either menus or selection boxes. | |
Additional Inherited Members | |
Protected Member Functions inherited from IRCObject | |
virtual | ~IRCObject () |
Virtual destructor. | |
An interface class for a widget annotation It is intended that future releases of JawsMako will extend this interface.
|
pure virtual |
Create a set of very basic appearances given the current annotation's parameters. Replaces any already present. Not yet supported for all widget types. An IError with error code JM_ERR_UNSUPPORTED will be thrown for such appearances.
Supported for:
form | The form in which this widget appears. Necessary if field information is inherited from its parent in the tree. If form is NULL and the widget does not know its own details, an exception will result. If in doubt, always pass the form. |
onStateName | The name of the appearance state to use for the "on" appearance. Required for button fields. Ignored for other field types. The name "Off" is used for all off appearance states. |
font | The font to use when we need to create a caption or variable text appearance. If not provided and it is needed, an exception will result. |
fontIndex | The index of the font to use. |
captionSize | The size of the font to use when we need to create a caption. |
|
static |
Convenience creator for a push button annotation, including basic appearance streams, inserts it into the form, and places it on the given page. Makes use of the above APIs to do its work. Can create either menus or selection boxes.
jawsMako | The Mako instance |
form | The form to receive the button field |
page | The page to attach the annotation to |
rect | The annotation area |
partialName | The desired partial name of the field. If an empty string is passed, no partial name will be set. |
caption | The string to use as the caption |
textSize | The text size for the caption |
font | The OpenType font to use for the field text |
fontIndex | If font is a TrueType collection, the index of the font within the collection |
encodingHint | A hint of the encoding to use for the font, if an encoding cannot be unambigously detected from the font itself. Not usually critical for buttons. Must be consistent with other form users of this font. |
color | The color to use for the caption. Must use a DeviceGray, DeviceRGB or DeviceCMYK colorspace. Default is black. |
backgroundColor | The background color for the button |
actions | The action(s) to be performed when the button is clicked |
|
static |
Creator for a check button annotation, including basic appearance streams, inserts it into the form, and places it on the given page.
jawsMako | The Mako instance |
form | The form to receive the button field |
page | The page to attach the annotation to |
rect | The annotation area |
partialName | The desired partial name of the field. If an empty string is passed, no partial name will be set. |
onValue | The name used by the form to specify an on value. Must be supplied. |
on | If true, the button will be checked by default |
|
static |
Creator for a choice annotation, including basic appearance streams, inserts it into the form, and places it on the given page. Can create either menus, combo boxes, or selection boxes.
jawsMako | The Mako instance |
form | The form to receive the button field |
page | The page to attach the annotation to |
rect | The annotation area |
partialName | The desired partial name of the field. If an empty string is passed, no partial name will be set. |
combo | If true, a combo box/popup will be created. If false, a selectable field will be created. |
editable | If true, and combo is set, the combo box text will be editable |
multiSelect | If true, and combo is not set, the choice field will allow multiple selections |
options | The options present in the choice field |
selectedOptions | The options that are initially selected |
textSize | The text size |
font | The OpenType font to use for the field text |
fontIndex | If font is a TrueType collection, the index of the font within the collection |
encodingHint | A hint of the encoding to use for the font, if an encoding cannot be unambigously detected from the font itself. Must be consistent with other form users of this font. |
color | The color to use for the text. Must use a DeviceGray, DeviceRGB or DeviceCMYK colorspace. Default is black. |
|
static |
Creator for a set of radio buttons, including basic appearance streams, inserts them into the form inside a new subfield, and places them on the given page.
jawsMako | The Mako instance |
form | The form to receive the fields |
page | The page to attach the annotation to |
partialName | The desired partial name of the field that represents the group of radio buttons. If an empty string is passed, no partial name will be set. |
value | The value of the field; that is, the name of the radio button that is checked. Pass an empty string if none are selected. |
buttonDetails | A vector containing the details of the radio buttons |
|
static |
Creator for a simple text annotation, including a basic appearance stream, inserts it into the form, and places it on the given page.
jawsMako | The Mako instance |
form | The form to receive the text field |
page | The page to attach the annotation to |
rect | The annotation area |
partialName | The desired partial name of the field. If an empty string is passed, no partial name will be set. |
text | The text present in the field (the field's value) |
textSize | The text size |
font | The OpenType font to use for the field text |
fontIndex | If font is a TrueType collection, the index of the font within the collection |
encodingHint | A hint of the encoding to use for the font, if an encoding cannot be unambigously detected from the font itself. Must be consistent with other form users of this font. |
color | The color to use for the text. Must use a DeviceGray, DeviceRGB or DeviceCMYK colorspace |
multiLine | True if the text should wrap within the field, false otherwise |
quadding | The desired justification mode for the text within the field |
|
pure virtual |
Get the actions dictionary (if present) associated with this widget.
|
pure virtual |
Get the additional actions dictionary (if present) associated with this widget.
|
pure virtual |
Get the appearance characteristics of this Widget.
|
pure virtual |
Get the default appearance string for variable text, if set.
defaultAppearanceString | A reference to receive the default appearance string |
|
pure virtual |
Get the default value of the field, as an array of strings.
value | A vector to receive the value. For fields that can take multiple values, such as radio buttons or choices, there may be multiple entries. For fields requiring only a single entry. |
|
pure virtual |
Get the field flags. Please see the PDF specification for the definition of the flags. See also eFieldFlags. Note that the significance of of the flags changes depending on type, and that the value may be inheritable.
flags | Reference to receive the field flags |
|
pure virtual |
Get the field type.
|
pure virtual |
Get the index of the first item visible in the list from the options.
|
pure virtual |
Get the highlight mode.
|
pure virtual |
Get the options for this field.
options | Reference to receive the options |
|
pure virtual |
Get the partial name of the widget.
|
pure virtual |
Get the Quadding (Justification) for variable text.
|
pure virtual |
Get a vector of 0-indexed indexes into the options for this field that represent the currently selected options.
|
pure virtual |
Get the value of the field, as an array of strings.
value | A vector to receive the value. For fields that can take multiple values, such as radio buttons or choices, there may be multiple entries. For fields requiring only a single entry. |
|
pure virtual |
Set the actions dictionary associated with this widget.
actions | Either an actions dictionary or NULL to clear |
|
pure virtual |
Set the additional actions dictionary associated with this widget.
actions | Either an actions dictionary or NULL to clear |
|
pure virtual |
Set the appearance characteristics.
appearanceCharacteristics | The desired appearance characteristics, or NULL to clear. |
|
pure virtual |
Set the default appearance string for variable text.
defaultAppearanceString | The desired default appearance string |
|
pure virtual |
Set the value of the field, as an array of strings.
For fields that can take multiple values, eg radio buttons, there will be multiple entries. For fields requiring only a single value, a single entry must be specified. Pass an empty vector to clear the value.
value | The value. |
|
inlinevirtual |
Convenience form for fields that only need a single value.
value | The string value for the field. |
|
pure virtual |
Set the field flags. Refer to the PDF specification 1.7 table 8.70 for details.
flags | The desired flags. |
|
pure virtual |
Set the index of the first item visible in the list from the options.
option | The desired index of the first option visible in a list |
|
pure virtual |
Set the hightlight mode.
highlightMode | The highlight mode to set. |
|
pure virtual |
Set the options for this field.
options The desired options
|
pure virtual |
Set the partial name of the widget.
name | The partial name to be set |
|
pure virtual |
Set the quadding (Justification) for variable text.
quadding | The desired quadding |
|
pure virtual |
Set the currently selected options by 0-indexed indexes into the options.
selectedOptions | The selected option indexes |
|
pure virtual |
Set the value of the field, as an array of strings. For fields that can take multiple values, eg radio buttons, there will be multiple entries. For fields requiring only a single value, a single entry will be returned. If the field has no value an empty array will be returned.
value | The value. |
|
inlinevirtual |
Convenience form for fields that only need a single value.
value | The string value for the field. |