WebView.d.ts 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. //////////////////////////////////////////////////////////
  2. // IMPORTANT: THIS FILE IS GENERATED, CHANGES WILL BE LOST
  3. //////////////////////////////////////////////////////////
  4. // Atomic TypeScript Definitions
  5. /// <reference path="Atomic.d.ts" />
  6. declare module WebView {
  7. //----------------------------------------------------
  8. // MODULE: WebView
  9. //----------------------------------------------------
  10. export class UIWebView extends Atomic.UIWidget {
  11. webClient: WebClient;
  12. webTexture2D: WebTexture2D;
  13. constructor(initialURL?: string);
  14. // Get the widget's WebClient
  15. getWebClient(): WebClient;
  16. // Get the WebTexture in use by the WebView
  17. getWebTexture2D(): WebTexture2D;
  18. }
  19. export class WebBrowserHost extends Atomic.AObject {
  20. // Construct.
  21. constructor();
  22. // Set global property object values, available as read only on page
  23. static setGlobalBoolProperty(globalVar: string, property: string, value: boolean): void;
  24. static setGlobalStringProperty(globalVar: string, property: string, value: string): void;
  25. static setGlobalNumberProperty(globalVar: string, property: string, value: number): void;
  26. }
  27. export class WebClient extends Atomic.AObject {
  28. webRenderHandler: WebRenderHandler;
  29. // Construct.
  30. constructor();
  31. // Create the browser, call only once initialized with handlers
  32. createBrowser(initialURL: string, width: number, height: number): boolean;
  33. // Set the browser's width and height
  34. setSize(width: number, height: number): void;
  35. // Send a mouse click event to the browser
  36. sendMouseClickEvent(x: number, y: number, button: number, mouseUp: boolean, modifier: number, clickCount?: number): void;
  37. // Send a mouse press event to the browser
  38. sendMousePressEvent(x: number, y: number, button?: number, modifier?: number, clickCount?: number): void;
  39. // Send a mouse move event to the browser
  40. sendMouseMoveEvent(x: number, y: number, modifier: number, mouseLeave?: boolean): void;
  41. // Send a mouse wheel event to the browser
  42. sendMouseWheelEvent(x: number, y: number, modifier: number, deltaX: number, deltaY: number): void;
  43. // Send a focus event to the browser
  44. sendFocusEvent(focus?: boolean): void;
  45. // Invoke the Cut shortcut on the browser's main frame
  46. shortcutCut(): void;
  47. // Invoke the Copy shortcut on the browser's main frame
  48. shortcutCopy(): void;
  49. // Invoke the Paste shortcut on the browser's main frame
  50. shortcutPaste(): void;
  51. // Invoke the SelectAll shortcut on the browser's main frame
  52. shortcutSelectAll(): void;
  53. // Invoke the Undo shortcut on the browser's main frame
  54. shortcutUndo(): void;
  55. // Invoke the Redo shortcut on the browser's main frame
  56. shortcutRedo(): void;
  57. // Invoke the Delete shortcut on the browser's main frame
  58. shortcutDelete(): void;
  59. // Execute some JavaScript in the browser
  60. executeJavaScript(script: string): void;
  61. // Eval some JavaScript in the browser (async return value referenced by evalID)
  62. evalJavaScript(evalID: number, script: string): void;
  63. // Returns true if the page is currently loading
  64. isLoading(): boolean;
  65. // Load the specified url into the main frame of the browser
  66. loadURL(url: string): void;
  67. // Load html source into main frame of browser
  68. loadString(source: string, url?: string): void;
  69. // Go back in page history
  70. goBack(): void;
  71. // Go forward in page history
  72. goForward(): void;
  73. // Reload the current page
  74. reload(): void;
  75. // Set the render handler for this client
  76. setWebRenderHandler(handler: WebRenderHandler): void;
  77. }
  78. export class WebRenderHandler extends Atomic.AObject {
  79. width: number;
  80. height: number;
  81. webClient: WebClient;
  82. // Construct.
  83. constructor();
  84. // Get the current renderer width
  85. getWidth(): number;
  86. // Get the current renderer height
  87. getHeight(): number;
  88. // Get the WebClient associated with the render handler
  89. getWebClient(): WebClient;
  90. // Set the dimensions of the render handler
  91. setSize(width: number, height: number): void;
  92. // Set the render handlers WebClient
  93. setWebClient(webClient: WebClient): void;
  94. }
  95. export class WebTexture2D extends WebRenderHandler {
  96. width: number;
  97. height: number;
  98. texture2D: Atomic.Texture2D;
  99. clearColor: Atomic.Color;
  100. // Construct.
  101. constructor();
  102. // Get the current width of the texture
  103. getWidth(): number;
  104. // Get the current height of the texture
  105. getHeight(): number;
  106. // Get the Texture2D associated with the WebTexture2D
  107. getTexture2D(): Atomic.Texture2D;
  108. // get the clear color for the WebTexture
  109. getClearColor(): Atomic.Color;
  110. // Set the dimensions of the texture
  111. setSize(width: number, height: number): void;
  112. // Set the clear color for the WebTexture
  113. setClearColor(color: Atomic.Color): void;
  114. }
  115. }