Class: AastraXmlApi::PhoneFormattedTextScreen

Inherits:
Phone
  • Object
show all
Defined in:
lib/aastra_xml_api/phone_formatted_text_screen.rb

Constant Summary

Constants inherited from Phone

AastraXmlApi::Phone::HIGHASCII

Instance Method Summary collapse

Methods inherited from Phone

#addIcon, #addSoftkey, #convert_high_ascii, #escape, #getRefreshTimeout, #getRefreshURL, #initialize, #setAllowAnswer, #setBeep, #setCancelAction, #setDestroyOnExit, #setLockIn, #setRefresh, #setTimeout, #setTitle, #setTitleWrap

Constructor Details

This class inherits a constructor from AastraXmlApi::Phone

Instance Method Details

#addLine(text, size = nil, align = nil) ⇒ Object

Add a line of formatted text. size can only be ‘normal’ (default) or ‘double’. align can be one of ‘left’ (default), ‘center’, or ‘right’.



55
56
57
# File 'lib/aastra_xml_api/phone_formatted_text_screen.rb', line 55

def addLine(text, size=nil, align=nil)
  @entries += [PhoneFormattedTextScreenEntry.new(text, size, align, 'normal')]
end

#renderObject

Create XML text output.



83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
# File 'lib/aastra_xml_api/phone_formatted_text_screen.rb', line 83

def render
  out = "<PhoneFormattedTextScreen"
  out += " destroyOnExit=\"yes\"" if @destroyOnExit == "yes"
  if not @cancelAction.nil? then
    cancelAction = escape(@cancelAction)
    out += " cancelAction=\"#{cancelAction}\""
  end
  if not @doneAction.nil? then
    doneAction = escape(@doneAction)
    out += " doneAction=\"#{doneAction}\""
  end
  out += " Beep=\"yes\"" if @beep == "yes"
  out += " LockIn=\"yes\"" if @lockin == "yes"
  out += " allowAnswer=\"yes\"" if @allowAnswer == "yes"
  out += " Timeout=\"#{@timeout}\"" if @timeout != 0
  out += " allowDTMF=\"#{yes}\"" if @allowDTMF == "yes"
  out += ">\n"
  @entries.each do |entry|
    out += entry.render
  end
  @softkeys.each do |softkey|
    out += softkey.render
  end
  iconList = 0
  @icons.each do |icon|
    if iconList == 0 then
      out += "<IconList>\n"
      iconList = 1
    end
    out += icon.render
  end
  out += "</IconList>\n" if iconList != 0
  out += "</PhoneFormattedTextScreen>\n"
  return out
end

#setAllowDTMFObject

Allows keypad strokes to generate DTMF when a call is in progress while this object is displayed.



78
79
80
# File 'lib/aastra_xml_api/phone_formatted_text_screen.rb', line 78

def setAllowDTMF
  @allowDTMF = "yes"
end

#setDoneAction(uri) ⇒ Object

Defines URI to call when the user selects the ‘Done’ softkey.



72
73
74
# File 'lib/aastra_xml_api/phone_formatted_text_screen.rb', line 72

def setDoneAction(uri)
  @doneAction = uri
end

#setScrollEndObject

Sets the end of a scrolling section on the display.



67
68
69
# File 'lib/aastra_xml_api/phone_formatted_text_screen.rb', line 67

def setScrollEnd
  @entries += [PhoneFormattedTextScreenEntry.new(nil, nil, nil, 'scrollend')]
end

#setScrollStart(height = nil) ⇒ Object

Starts the beginning of a scrolling section on the display. If height is not given, then all available space is used to display the scrolling section. Otherwise, height cannot be bigger than 2.



62
63
64
# File 'lib/aastra_xml_api/phone_formatted_text_screen.rb', line 62

def setScrollStart(height=nil)
  @entries += [PhoneFormattedTextScreenEntry.new(nil, height, nil, 'scrollstart')]
end