class RAutomation::Adapter::MsUia::UiaDll::SearchCriteria

Public Class Methods

from_locator(parent, locator) click to toggle source
# File lib/rautomation/adapter/ms_uia/uia_dll.rb, line 24
def self.from_locator(parent, locator)
  info = SearchCriteria.new
  info.parent_window = parent
  info.index = locator[:index] || 0
  info.children_only = locator[:children_only]

  case
    when locator[:hwnd]
      info.how = :hwnd
      info.data = locator[:hwnd]
    when locator[:id]
      info.how = :id
      info.data = locator[:id]
    when locator[:value]
      info.how = :value
      info.data = locator[:value]
    when locator[:point]
      info.how = :point
      info.data = locator[:point]
    when locator[:focus]
      info.how = :focus
  end
  info
end

Public Instance Methods

children_only=(yes_or_no) click to toggle source
# File lib/rautomation/adapter/ms_uia/uia_dll.rb, line 69
def children_only=(yes_or_no)
  self[:children_only] = yes_or_no
end
children_only?() click to toggle source
# File lib/rautomation/adapter/ms_uia/uia_dll.rb, line 65
def children_only?
  self[:children_only]
end
data() click to toggle source
# File lib/rautomation/adapter/ms_uia/uia_dll.rb, line 81
def data
  case how
    when :hwnd
      return self[:data][:int_data]
    when :id, :value
      return self[:data][:string_data].to_ptr.read_string
    when :point
      return self[:data][:point_data].to_ptr.read_array_of_int(2)
    else
      return nil
  end
end
data=(value) click to toggle source
# File lib/rautomation/adapter/ms_uia/uia_dll.rb, line 94
def data=(value)
  case how
    when :hwnd
      self[:data][:int_data] = value || 0 # cannot accept nil
    when :id, :value
      self[:data][:string_data] = value
    when :point
      self[:data][:point_data].to_ptr.write_array_of_int(value)
  end
end
how() click to toggle source
# File lib/rautomation/adapter/ms_uia/uia_dll.rb, line 49
def how
  self[:how]
end
how=(value) click to toggle source
# File lib/rautomation/adapter/ms_uia/uia_dll.rb, line 53
def how=(value)
  self[:how] = value
end
index() click to toggle source
# File lib/rautomation/adapter/ms_uia/uia_dll.rb, line 57
def index
  self[:index]
end
index=(value) click to toggle source
# File lib/rautomation/adapter/ms_uia/uia_dll.rb, line 61
def index=(value)
  self[:index] = value
end
parent_window() click to toggle source
# File lib/rautomation/adapter/ms_uia/uia_dll.rb, line 73
def parent_window
  self[:hwnd]
end
parent_window=(parent) click to toggle source
# File lib/rautomation/adapter/ms_uia/uia_dll.rb, line 77
def parent_window=(parent)
  self[:hwnd] = parent
end