Module: Origami::Field

Included in:
Annotation::Widget, Subform
Defined in:
lib/origami/acroform.rb

Defined Under Namespace

Modules: Flags, TextAlign, Type Classes: AdditionalActions, CertificateSeedValue, SignatureLock, SignatureSeedValue, Subform

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(receiver) ⇒ Object

:nodoc:



153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# File 'lib/origami/acroform.rb', line 153

def self.included(receiver) #:nodoc:
    receiver.field   :FT,     :Type => Name, :Required => true
    receiver.field   :Parent, :Type => Field
    receiver.field   :Kids,   :Type => Array.of(Field)
    receiver.field   :T,      :Type => String
    receiver.field   :TU,     :Type => String, :Version => "1.3"
    receiver.field   :TM,     :Type => String, :Version => "1.3"
    receiver.field   :Ff,     :Type => Integer, :Default => 0
    receiver.field   :V,      :Type => Object
    receiver.field   :DV,     :Type => Object
    receiver.field   :AA,     :Type => AdditionalActions, :Version => "1.2"

    # Variable text fields
    receiver.field   :DA,     :Type => String, :Default => "/F1 10 Tf 0 g", :Required => true
    receiver.field   :Q,      :Type => Integer, :Default => TextAlign::LEFT
    receiver.field   :DS,     :Type => String, :Version => "1.5"
    receiver.field   :RV,     :Type => [ String, Stream ], :Version => "1.5"
end

Instance Method Details

#onCalculate(action) ⇒ Object



205
206
207
208
209
210
211
212
# File 'lib/origami/acroform.rb', line 205

def onCalculate(action)
    unless action.is_a?(Action)
        raise TypeError, "An Action object must be passed."
    end

    self.AA ||= AdditionalActions.new
    self.AA.C = action
end

#onFormat(action) ⇒ Object



187
188
189
190
191
192
193
194
# File 'lib/origami/acroform.rb', line 187

def onFormat(action)
    unless action.is_a?(Action)
        raise TypeError, "An Action object must be passed."
    end

    self.AA ||= AdditionalActions.new
    self.AA.F = action
end

#onKeyStroke(action) ⇒ Object



178
179
180
181
182
183
184
185
# File 'lib/origami/acroform.rb', line 178

def onKeyStroke(action)
    unless action.is_a?(Action)
        raise TypeError, "An Action object must be passed."
    end

    self.AA ||= AdditionalActions.new
    self.AA.K = action
end

#onValidate(action) ⇒ Object



196
197
198
199
200
201
202
203
# File 'lib/origami/acroform.rb', line 196

def onValidate(action)
    unless action.is_a?(Action)
        raise TypeError, "An Action object must be passed."
    end

    self.AA ||= AdditionalActions.new
    self.AA.V = action
end

#pre_buildObject

:nodoc:



172
173
174
175
176
# File 'lib/origami/acroform.rb', line 172

def pre_build #:nodoc:
    self.T ||= "undef#{::Array.new(5) {('0'.ord + rand(10)).chr}.join}"

    super
end