FireBreath  1.4.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Pages
Public Member Functions | Static Public Member Functions | List of all members
FB::DOM::Document Class Reference

Abstraction for accessing and manipulating a DOM Document. More...

#include "Document.h"

Inheritance diagram for FB::DOM::Document:
Inheritance graph
Collaboration diagram for FB::DOM::Document:
Collaboration graph

Public Member Functions

DocumentPtr document ()
 Gets a FB::DOM::DocumentPtr for the current object. More...
 
virtual WindowPtr getWindow () const
 Gets a DOM::WindowPtr for the window the document is contained in. More...
 
virtual ElementPtr getHead () const
 Gets a DOM::ElementPtr for the document's head. More...
 
virtual ElementPtr getBody () const
 Gets a DOM::ElementPtr for the document's body. More...
 
virtual ElementPtr createElement (const std::string &name) const
 roughly equivalent to calling document.createElement(name) from javascript More...
 
- Public Member Functions inherited from FB::DOM::Element
ElementPtr element ()
 Gets a FB::DOM::ElementPtr pointing to the current object. More...
 
virtual std::string getInnerHTML () const
 Gets the inner html for the element. More...
 
virtual void setInnerHTML (const std::string &html) const
 Sets an inner html for the element. More...
 
virtual int getWidth () const
 Gets the width property of the element. More...
 
virtual void setWidth (const int width) const
 Sets the width property of the element. More...
 
virtual int getScrollWidth () const
 Gets the scroll width property (read-only) of the element. More...
 
virtual int getHeight () const
 Gets the height property of the element. More...
 
virtual void setHeight (const int height) const
 Sets the height property of the element. More...
 
virtual int getScrollHeight () const
 Gets the scroll height property (read-only) of the element. More...
 
virtual int getChildNodeCount () const
 Gets a child node count. More...
 
virtual ElementPtr getChildNode (const int idx) const
 Gets a child node. More...
 
virtual ElementPtr getParentNode () const
 Gets the parent node of the current Element. More...
 
virtual ElementPtr getElement (const std::string &name) const
 Gets a child element of the specified name. More...
 
virtual ElementPtr getElement (const int idx) const
 Gets a child element of the specified name. More...
 
virtual ElementPtr getElementById (const std::string &elem_id) const
 Gets an element from the DOM with the specified id. More...
 
virtual std::vector< ElementPtrgetElementsByTagName (const std::string &tagName) const
 Gets a list of all elements in the document with the specified tag name. More...
 
virtual std::vector< ElementPtrgetElementsByTagName (const std::wstring &tagName) const
 
- Public Member Functions inherited from FB::DOM::Node
virtual FB::JSObjectPtr getJSObject () const
 Returns the FB::JSObjectPtr that this object is wrapping. More...
 
NodePtr node ()
 Gets the NodePtr for the current node. More...
 
template<class T >
getProperty (const std::wstring &name) const
 
virtual NodePtr getNode (const std::wstring &name) const
 
virtual NodePtr getNode (const std::string &name) const
 Gets a child node of the specified name. More...
 
virtual NodePtr getNode (const int idx) const
 Gets a child node of the specified name by index. More...
 
virtual void setProperty (const std::wstring &name, const variant &val) const
 
virtual void setProperty (const std::string &name, const variant &val) const
 Sets a property on the node to a given value. More...
 
virtual void setProperty (const int idx, const variant &val) const
 

Static Public Member Functions

static DocumentPtr create (const FB::JSObjectPtr &api)
 Creates a FB::DOM::Document object from a JSObjectPtr representing a DOM object. This will probably throw an exception and definitely not work right if the DOM object represented is not a document. More...
 
- Static Public Member Functions inherited from FB::DOM::Element
static ElementPtr create (const FB::JSObjectPtr &api)
 Creates a FB::DOM::Element object from a JSObjectPtr representing a DOM object. This will probably throw an exception and definitely not work right if the DOM object represented is not a Element. More...
 
- Static Public Member Functions inherited from FB::DOM::Node
static NodePtr create (const FB::JSObjectPtr &api)
 Creates a FB::DOM::Node object from a JSObjectPtr representing a DOM node. This will probably throw an exception and definitely not work right if the js object represented is not a node. More...
 

Detailed Description

Abstraction for accessing and manipulating a DOM Document.

This class should not be created directly; instead, use the Document::create method

Most of the time you will want to call BrowserHost::getDOMDocument() to get the reference to the containing document

Definition at line 38 of file ScriptingCore/DOM/Document.h.


The documentation for this class was generated from the following files: