Represents a HTML Document. UI.document is the main UI document. Use PowerUI.Document.innerHTML to set it's content.
Public Member Functions | |
void | RemoveCachedElement (Element ele) |
Removes the given element from any attribute caches. You must check AttributesCached first. More... | |
void | IndexAttribute (string attrib) |
Request that the given attribute will be indexed. More... | |
void | StartAttributeIndex (string attrib) |
Starts indexing the given attribute right now. More... | |
Document (Renderman renderer) | |
Creates a new document which will be rendered with the given renderer. More... | |
Document (Renderman renderer, Window parentWindow) | |
Creates a new document which will be rendered with the given renderer. More... | |
Document (Renderman renderer, Window parentWindow, bool aot) | |
Creates a new document which will be rendered with the given renderer. More... | |
DynamicFont | GetOrCreateFont (string fontName) |
Gets the font with the given name. May load it from the cache or generate a new one. More... | |
DynamicFont | GetFont (string fontName) |
Gets the font with the given name. More... | |
void | write (string text) |
Writes the given html to the end of the document. More... | |
void | clear () |
Clears the document of all it's content, including scripts and styles. More... | |
void | ClearStyle () |
Clears all css style definitions from this document. More... | |
void | ClearEvents () |
Clears all events on this document. More... | |
bool | RunKeyUp (UIEvent e) |
Runs the keyup events. More... | |
bool | RunMouseMove (UIEvent e) |
Called when the mouse moves over this document. More... | |
bool | RunKeyDown (UIEvent e) |
Runs the keydown events. More... | |
Element | createElement (string tag) |
Creates a new element in this document. You'll need to parent it to something. E.g. with thisDocument.body.appendChild(...). Alternative to innerHTML and appendInnerHTML. More... | |
object | OnWindowOpen (params object[] extra) |
A shortcut for calling the nitro OnWindowOpen function. More... | |
object | Run (string name, params object[] args) |
Runs a nitro function by name with optional arguments. More... | |
object | RunLiteral (string name, object[] args) |
Runs a nitro function by name with a set of arguments. More... | |
object | RunLiteral (string name, Element element, object[] args) |
Runs a nitro function by name with a set of arguments. More... | |
object | RunLiteral (string name, object[] args, bool optional) |
Runs a nitro function by name with a set of arguments only if the method exists. More... | |
object | RunLiteral (string name, Element element, object[] args, bool optional) |
Runs a nitro function by name with a set of arguments only if the method exists. More... | |
object | RunOptionally (string name, Element element, params object[] args) |
Runs a nitro function by name with a set of arguments only if the method exists. More... | |
object | RunOptionally (string name, params object[] args) |
Runs a nitro function by name with a set of arguments only if the method exists. More... | |
void | AddStyle (string css) |
Adds the given css style to the document. Used by style tags. More... | |
void | AddStyle (string css, int index) |
Adds the given css style to the document. Used by style tags. More... | |
int | GetStyleIndex () |
Gets a new style index in the StyleBuffer array. More... | |
bool | TryStyle () |
Attempts to apply any added css. It's only successful if there are no nulls in the style buffer. More... | |
void | AddCode (string code) |
Adds the given nitro code to the document. Used by script tags. Note that this will not work at runtime if the code if this document has already been compiled. More... | |
void | AddCode (string code, int index) |
Adds the given nitro code to the document. Used by script tags. Note that this will not work at runtime if the code if this document has already been compiled. More... | |
void | ClearCode () |
Clears all code. More... | |
int | GetCodeIndex () |
Gets a new code index in the CodeBuffer array. More... | |
bool | TryCompile () |
Attempts to compile the code then run OnWindowLoaded. It's only successful if there are no nulls in the code buffer. More... | |
Element | getElementByTagName (string tag) |
Gets the first child element with the given tag. More... | |
List< Element > | getElementsByTagName (string tag) |
Gets all child elements with the given tag. More... | |
List< Element > | getElementsByAttribute (string property, string value) |
Gets all elements with the given attribute. May include this element or any of it's kids. More... | |
Element | getElementByAttribute (string property, string value) |
Gets all elements with the given attribute. May include this element or any of it's kids. More... | |
List< Element > | getElementsByClassName (string className) |
Gets all elements with the given class name(s), seperated by spaces. May include this element or any of it's kids. More... | |
Element | getElementById (string id) |
Gets the first html element found with the given ID attribute. More... | |
Css.SelectorStyle | getStyleBySelector (string selector) |
Gets a style definition by css selector from the StyleSheet. If it's not found in the style sheet, the default stylesheet is checked. More... | |
void | NewBody () |
Called after the innerHTML of the body tag was changed. More... | |
Public Attributes | |
Dictionary< string, AttributeLookup > | AttributeIndex |
An attribute index, used to dramatically speed up frequently used unique attributes (like id). More... | |
Element | html |
The HTML element of the document. This is the outermost tag of the document. More... | |
Element | body |
The body element of the document. It's contained within the html element. Set the innerHTML of this. More... | |
Window | window |
The window that this document belongs to. More... | |
FilePath | location |
The current location (i.e. base URL) of this document. Originates from the src attribute of iframes. More... | |
bool | AotDocument |
True if this is a Nitro AOT compilation document. More... | |
Renderman | Renderer |
The renderer which will render this document. More... | |
string[] | CodeBuffer |
All code in script tags is buffered and compiled in one go. This is the buffer. More... | |
UICode | CodeInstance |
An instance of the compiled code on this page. May also be null of there is no script on the page. More... | |
Element | DropdownBox |
A global dropdown box for showing dropdown content. Note that this is only available on the top document. See PowerUI.Window.top. More... | |
string[] | StyleBuffer |
Some styles are loaded externally. Them and any styles after them are buffered to be loaded in order. More... | |
bool | FinishedParsing |
True if we're done parsing and setting the innerHTML of the body tag. Used to guage when the code should be compiled. More... | |
Css.StyleSheet | Style |
The css stylesheet for this document. All style tags place their content into this stylesheet. More... | |
string | ScriptLocation |
Only used by Nitro AOT. The location of the html file for error reporting. More... | |
OnSizeChange | OnResized |
Called when the document resizes. More... | |
TitleChange | OnTitleChange |
Called when the title of this document changes. More... | |
TitleChange | OnTooltipChange |
Called when the tooltip for this document changes. More... | |
DynamicMethod< Nitro.Void > | onkeyup |
A method called when any key is released anywhere. Note: this applies only to the main UI document (not world UI's). More... | |
DynamicMethod< Nitro.Void > | onresize |
A method called when the document resizes. More... | |
DynamicMethod< Nitro.Void > | onkeydown |
A method called when any key is pressed anywhere. Note: this applies only to the main UI document (not world UI's). More... | |
DynamicMethod< Nitro.Void > | onmousemove |
A method called when the mouse moves over this document. More... | |
Dictionary< string, DynamicFont > | ActiveFonts |
A set of all fonts available to this renderer, indexed by font name. More... | |
Static Public Attributes | |
static Css.StyleSheet | DefaultStyleSheet |
The default style sheet. Contains styling for e.g. div/span etc. More... | |
Properties | |
bool | AttributesCached [get] |
True if more than one attribute is cached. More... | |
string | basepath [get] |
The path that this document is relative to (if any). More... | |
string | title [get, set] |
The title of the document. This originates from <title> tags. More... | |
string | tooltip [get, set] |
The tooltip of the document. This originates from <.. title="tooltip">. Note that this is set internally. More... | |
object | this[string index] [get, set] |
Gets or sets script variable values. More... | |
DocumentElements | allElements [get] |
An iteratable set of all elements from this document. Whilst iterating you can actively skip nodes, so it's often useful to cache this first. More... | |
string | innerHTML [get, set] |
Gets or sets the innerHTML of this document. More... | |
Events | |
InputEvent | KeyUp |
Called when a key goes up. More... | |
InputEvent | KeyDown |
Called when a key goes down. More... | |
InputEvent | MouseMove |
Called when the mouse moves. More... | |
Private Attributes | |
string | CurrentTitle |
The title of the document. This originates from <title> tags. More... | |
string | CurrentTooltip |
The tooltip of the document. This originates from <.. title="tooltip">. See Document.tooltip. More... | |
NitroDomainManager | SecurityDomain |
The nitro securty domain for this document. More... | |
|
inline |
Creates a new document which will be rendered with the given renderer.
renderer | The renderer to use when rendering this document. |
Creates a new document which will be rendered with the given renderer.
renderer | The renderer to use when rendering this document. |
parentWindow | The window that will become the parent window. Used in e.g. iframes. |
Creates a new document which will be rendered with the given renderer.
renderer | The renderer to use when rendering this document. |
parentWindow | The window that will become the parent window. Used in e.g. iframes. |
aot | True if this is a Nitro AOT document (used in the Editor only). |
|
inline |
Adds the given nitro code to the document. Used by script tags. Note that this will not work at runtime if the code if this document has already been compiled.
code | The nitro code to add to the document. |
|
inline |
Adds the given nitro code to the document. Used by script tags. Note that this will not work at runtime if the code if this document has already been compiled.
code | The nitro code to add to the document. |
index | The index in the code buffer to add the code into. |
|
inline |
Adds the given css style to the document. Used by style tags.
css | The css to add to the document. |
|
inline |
Adds the given css style to the document. Used by style tags.
css | The css to add to the document. |
index | The index in the style buffer to add the css into. |
|
inline |
Clears the document of all it's content, including scripts and styles.
|
inline |
Clears all code.
|
inline |
Clears all events on this document.
|
inline |
Clears all css style definitions from this document.
|
inline |
Creates a new element in this document. You'll need to parent it to something. E.g. with thisDocument.body.appendChild(...). Alternative to innerHTML and appendInnerHTML.
tag | The tag, e.g. <div id='myNewElement' .. > |
|
inline |
Gets a new code index in the CodeBuffer array.
|
inline |
Gets all elements with the given attribute. May include this element or any of it's kids.
property | The name of the attribute to find. E.g. "id". |
value | Optional. The value that the attribute should be; null for any value. |
|
inline |
Gets the first html element found with the given ID attribute.
id | The ID of the element to search for. |
|
inline |
Gets the first child element with the given tag.
tag | The html tag to look for. |
|
inline |
Gets all elements with the given attribute. May include this element or any of it's kids.
property | The name of the attribute to find. E.g. "id". |
value | Optional. The value that the attribute should be; null for any value. |
|
inline |
Gets all elements with the given class name(s), seperated by spaces. May include this element or any of it's kids.
className | The name of the classes to find. E.g. "red box". |
|
inline |
Gets all child elements with the given tag.
tag | The html tag to look for. |
|
inline |
Gets the font with the given name.
fontName | The name of the font to find. |
|
inline |
Gets the font with the given name. May load it from the cache or generate a new one.
fontName | The name of the font to find. |
|
inline |
Gets a style definition by css selector from the StyleSheet. If it's not found in the style sheet, the default stylesheet is checked.
selector | The css selector to search for. |
|
inline |
Gets a new style index in the StyleBuffer array.
|
inline |
Request that the given attribute will be indexed.
|
inline |
Called after the innerHTML of the body tag was changed.
|
inline |
A shortcut for calling the nitro OnWindowOpen function.
extra | Additional parameters to pass into the nitro domain. |
|
inline |
Removes the given element from any attribute caches. You must check AttributesCached first.
|
inline |
Runs a nitro function by name with optional arguments.
name | The name of the function in lowercase. |
args | Optional arguments to use when calling the function. |
|
inline |
Runs the keydown events.
e | The event which has occured. |
|
inline |
Runs the keyup events.
e | The event which has occured. |
|
inline |
Runs a nitro function by name with a set of arguments.
name | The name of the function in lowercase. |
args | The set of arguments to use when calling the function. |
|
inline |
Runs a nitro function by name with a set of arguments.
name | The name of the function in lowercase. |
element | The element to use for the 'this' value. |
args | The set of arguments to use when calling the function. |
|
inline |
Runs a nitro function by name with a set of arguments only if the method exists.
name | The name of the function in lowercase. |
args | The set of arguments to use when calling the function. |
optional | True if the method call is optional. No exception is thrown if not found. |
|
inline |
Runs a nitro function by name with a set of arguments only if the method exists.
name | The name of the function in lowercase. |
element | The element to use for the 'this' value. |
args | The set of arguments to use when calling the function. |
optional | True if the method call is optional. No exception is thrown if not found. |
|
inline |
Called when the mouse moves over this document.
e | The mouse event containing the position. |
|
inline |
Runs a nitro function by name with a set of arguments only if the method exists.
name | The name of the function in lowercase. |
element | The element to use for the 'this' value. |
optional | True if the method call is optional. No exception is thrown if not found. |
args | The set of arguments to use when calling the function. |
|
inline |
Runs a nitro function by name with a set of arguments only if the method exists.
name | The name of the function in lowercase. |
optional | True if the method call is optional. No exception is thrown if not found. |
args | The set of arguments to use when calling the function. |
|
inline |
Starts indexing the given attribute right now.
|
inline |
Attempts to compile the code then run OnWindowLoaded. It's only successful if there are no nulls in the code buffer.
|
inline |
Attempts to apply any added css. It's only successful if there are no nulls in the style buffer.
|
inline |
Writes the given html to the end of the document.
text | The html to write. |
Dictionary<string,DynamicFont> PowerUI.Document.ActiveFonts |
A set of all fonts available to this renderer, indexed by font name.
bool PowerUI.Document.AotDocument |
True if this is a Nitro AOT compilation document.
Dictionary<string,AttributeLookup> PowerUI.Document.AttributeIndex |
An attribute index, used to dramatically speed up frequently used unique attributes (like id).
Element PowerUI.Document.body |
The body element of the document. It's contained within the html element. Set the innerHTML of this.
string [] PowerUI.Document.CodeBuffer |
All code in script tags is buffered and compiled in one go. This is the buffer.
UICode PowerUI.Document.CodeInstance |
An instance of the compiled code on this page. May also be null of there is no script on the page.
|
private |
The title of the document. This originates from <title> tags.
|
private |
The tooltip of the document. This originates from <.. title="tooltip">. See Document.tooltip.
|
static |
The default style sheet. Contains styling for e.g. div/span etc.
Element PowerUI.Document.DropdownBox |
A global dropdown box for showing dropdown content. Note that this is only available on the top document. See PowerUI.Window.top.
bool PowerUI.Document.FinishedParsing |
True if we're done parsing and setting the innerHTML of the body tag. Used to guage when the code should be compiled.
Element PowerUI.Document.html |
The HTML element of the document. This is the outermost tag of the document.
FilePath PowerUI.Document.location |
The current location (i.e. base URL) of this document. Originates from the src attribute of iframes.
DynamicMethod<Nitro.Void> PowerUI.Document.onkeydown |
DynamicMethod<Nitro.Void> PowerUI.Document.onkeyup |
DynamicMethod<Nitro.Void> PowerUI.Document.onmousemove |
A method called when the mouse moves over this document.
DynamicMethod<Nitro.Void> PowerUI.Document.onresize |
A method called when the document resizes.
OnSizeChange PowerUI.Document.OnResized |
Called when the document resizes.
TitleChange PowerUI.Document.OnTitleChange |
Called when the title of this document changes.
TitleChange PowerUI.Document.OnTooltipChange |
Called when the tooltip for this document changes.
Renderman PowerUI.Document.Renderer |
The renderer which will render this document.
string PowerUI.Document.ScriptLocation |
Only used by Nitro AOT. The location of the html file for error reporting.
|
private |
The nitro securty domain for this document.
Css.StyleSheet PowerUI.Document.Style |
The css stylesheet for this document. All style tags place their content into this stylesheet.
string [] PowerUI.Document.StyleBuffer |
Some styles are loaded externally. Them and any styles after them are buffered to be loaded in order.
Window PowerUI.Document.window |
The window that this document belongs to.
|
get |
An iteratable set of all elements from this document. Whilst iterating you can actively skip nodes, so it's often useful to cache this first.
|
get |
True if more than one attribute is cached.
|
get |
The path that this document is relative to (if any).
|
getset |
Gets or sets the innerHTML of this document.
|
getset |
Gets or sets script variable values.
index | The name of the variable. |
|
getset |
The title of the document. This originates from <title> tags.
|
getset |
The tooltip of the document. This originates from <.. title="tooltip">. Note that this is set internally.
InputEvent PowerUI.Document.KeyDown |
Called when a key goes down.
InputEvent PowerUI.Document.KeyUp |
Called when a key goes up.
InputEvent PowerUI.Document.MouseMove |
Called when the mouse moves.