You are here

trait BrowserWindowTrait in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/jcalderonzumba/gastonjs/src/Browser/BrowserWindowTrait.php \Zumba\GastonJS\Browser\BrowserWindowTrait

Class BrowserWindowTrait @package Zumba\GastonJS\Browser

Hierarchy

File

vendor/jcalderonzumba/gastonjs/src/Browser/BrowserWindowTrait.php, line 9

Namespace

Zumba\GastonJS\Browser
View source
trait BrowserWindowTrait {

  /**
   * Returns the current window handle name in the browser
   * @param string $name
   * @return mixed
   */
  public function windowHandle($name = null) {
    return $this
      ->command('window_handle', $name);
  }

  /**
   * Returns all the window handles present in the browser
   * @return array
   */
  public function windowHandles() {
    return $this
      ->command('window_handles');
  }

  /**
   * Change the browser focus to another window
   * @param $windowHandleName
   * @return mixed
   */
  public function switchToWindow($windowHandleName) {
    return $this
      ->command('switch_to_window', $windowHandleName);
  }

  /**
   * Opens a new window on the browser
   * @return mixed
   */
  public function openNewWindow() {
    return $this
      ->command('open_new_window');
  }

  /**
   * Closes a window on the browser by a given handler name
   * @param $windowHandleName
   * @return mixed
   */
  public function closeWindow($windowHandleName) {
    return $this
      ->command('close_window', $windowHandleName);
  }

  /**
   * Gets the current request window name
   * @return string
   * @throws \Zumba\GastonJS\Exception\BrowserError
   * @throws \Exception
   */
  public function windowName() {
    return $this
      ->command('window_name');
  }

  /**
   * Zoom factor for a web page
   * @param $zoomFactor
   * @return mixed
   */
  public function setZoomFactor($zoomFactor) {
    return $this
      ->command('set_zoom_factor', $zoomFactor);
  }

  /**
   * Gets the window size
   * @param $windowHandleName
   * @return mixed
   */
  public function windowSize($windowHandleName) {
    return $this
      ->command('window_size', $windowHandleName);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
BrowserWindowTrait::closeWindow public function Closes a window on the browser by a given handler name
BrowserWindowTrait::openNewWindow public function Opens a new window on the browser
BrowserWindowTrait::setZoomFactor public function Zoom factor for a web page
BrowserWindowTrait::switchToWindow public function Change the browser focus to another window
BrowserWindowTrait::windowHandle public function Returns the current window handle name in the browser
BrowserWindowTrait::windowHandles public function Returns all the window handles present in the browser
BrowserWindowTrait::windowName public function Gets the current request window name
BrowserWindowTrait::windowSize public function Gets the window size