Class: Pdfrb::Model::Type::Action
Overview
Action base class (s12.6). Like annotations, action subtypes
each have their own TSV (ActionGoTo, ActionURI, ...) so the
common fields are hand-coded here.
Direct Known Subclasses
ActionGoTo, ActionGoTo3DView, ActionGoToDp, ActionGoToR, ActionHide, ActionImportData, ActionJavaScript, ActionLaunch, ActionMovie, ActionNOP, ActionNamed, ActionRendition, ActionResetForm, ActionRichMediaExecute, ActionSetOCGState, ActionSetState, ActionSoundAction, ActionSubmitForm, ActionThread, ActionTrans, ActionURI
Instance Attribute Summary
Attributes inherited from Object
#document, #gen, #oid, #value
Class Method Summary
collapse
Instance Method Summary
collapse
#[], #[]=, arlington_available?, arlington_default, arlington_key_to_symbol, arlington_loaded_for?, arlington_mark_loaded, arlington_object, arlington_one_type_to_ruby, arlington_required?, arlington_types_to_ruby, arlington_version, define_field, define_field_from_arlington, #delete, #each, each_field, #each_raw, #empty?, field, #initialize, #key?, #keys, lookup_type, own_fields, #pdf_type, register_type, type_map, #validate
Methods inherited from Object
#==, define_type, #deref, #indirect?, #initialize, #must_be_indirect?, #pdf_type, pdf_type
Class Method Details
.for_subtype(symbol) ⇒ Object
67
68
69
|
# File 'lib/pdfrb/model/type/action.rb', line 67
def for_subtype(symbol)
subtype_map[symbol]
end
|
.register_subtype(symbol, klass = self) ⇒ Object
63
64
65
|
# File 'lib/pdfrb/model/type/action.rb', line 63
def register_subtype(symbol, klass = self)
subtype_map[symbol] = klass
end
|
.subtype_map ⇒ Object
59
60
61
|
# File 'lib/pdfrb/model/type/action.rb', line 59
def subtype_map
@subtype_map ||= {}
end
|
Instance Method Details
52
53
54
55
56
|
# File 'lib/pdfrb/model/type/action.rb', line 52
def d
return nil unless goto?
self[:D]
end
|
#goto? ⇒ Boolean
26
27
28
|
# File 'lib/pdfrb/model/type/action.rb', line 26
def goto?
subtype&.to_sym == :GoTo
end
|
#javascript? ⇒ Boolean
38
39
40
|
# File 'lib/pdfrb/model/type/action.rb', line 38
def javascript?
subtype&.to_sym == :JavaScript
end
|
#launch? ⇒ Boolean
34
35
36
|
# File 'lib/pdfrb/model/type/action.rb', line 34
def launch?
subtype&.to_sym == :Launch
end
|
#named? ⇒ Boolean
42
43
44
|
# File 'lib/pdfrb/model/type/action.rb', line 42
def named?
subtype&.to_sym == :Named
end
|
#next_action ⇒ Object
17
|
# File 'lib/pdfrb/model/type/action.rb', line 17
def next_action; self[:Next]; end
|
#next_actions ⇒ Object
19
20
21
22
23
24
|
# File 'lib/pdfrb/model/type/action.rb', line 19
def next_actions
value = self[:Next]
return [] unless value
value.is_a?(Pdfrb::Model::PdfArray) ? value.to_a : value
end
|
16
|
# File 'lib/pdfrb/model/type/action.rb', line 16
def subtype; self[:S]; end
|
46
47
48
49
50
|
# File 'lib/pdfrb/model/type/action.rb', line 46
def uri
return nil unless uri?
self[:URI]
end
|
#uri? ⇒ Boolean
30
31
32
|
# File 'lib/pdfrb/model/type/action.rb', line 30
def uri?
subtype&.to_sym == :URI
end
|