예제 #1
0
        /// <summary>
        /// Returns the document element with the specified ID value.
        /// </summary>
        public CefDomNode GetElementById(string id)
        {
            fixed(char *id_str = id)
            {
                var n_id = new cef_string_t(id_str, id != null ? id.Length : 0);

                return(CefDomNode.From(
                           cef_domdocument_t.invoke_get_element_by_id(this.ptr, &n_id)
                           ));
            }
        }
예제 #2
0
        /// <summary>
        /// Called when a new node in the the browser gets focus. The |node|
        /// value may be empty if no specific node has gained focus. The node
        /// object passed to this method represents a snapshot of the DOM at the
        /// time this method is executed. DOM objects are only valid for the
        /// scope of this method. Do not keep references to or attempt to access
        /// any DOM objects outside the scope of this method.
        /// </summary>
        private void on_focused_node_changed(cef_focus_handler_t *self, cef_browser_t *browser, cef_frame_t *frame, cef_domnode_t *node)
        {
            ThrowIfObjectDisposed();

            var mBrowser = CefBrowser.From(browser);
            var mFrame   = CefFrame.From(frame);
            var mNode    = CefDomNode.FromOrDefault(node);

            // TODO: DOM nodes context
            this.OnFocusedNodeChanged(mBrowser, mFrame, mNode);

            if (mNode != null)
            {
                mNode.Dispose();
            }
        }
예제 #3
0
 /// <summary>
 /// Returns the selection start node.
 /// </summary>
 public CefDomNode GetSelectionStartNode()
 {
     return(CefDomNode.From(
                cef_domdocument_t.invoke_get_selection_start_node(this.ptr)
                ));
 }
예제 #4
0
 /// <summary>
 /// Returns the node that currently has keyboard focus.
 /// </summary>
 public CefDomNode GetFocusedNode()
 {
     return(CefDomNode.From(
                cef_domdocument_t.invoke_get_focused_node(this.ptr)
                ));
 }
예제 #5
0
 /// <summary>
 /// Returns the HEAD node of an HTML document.
 /// </summary>
 public CefDomNode GetHead()
 {
     return(CefDomNode.From(
                cef_domdocument_t.invoke_get_head(this.ptr)
                ));
 }
예제 #6
0
 /// <summary>
 /// Returns the BODY node of an HTML document.
 /// </summary>
 public CefDomNode GetBody()
 {
     return(CefDomNode.From(
                cef_domdocument_t.invoke_get_body(this.ptr)
                ));
 }
예제 #7
0
 /// <summary>
 /// Called when a new node in the the browser gets focus.
 /// The |node| value may be empty if no specific node has gained focus.
 /// The node object passed to this method represents a snapshot of the DOM at the time this method is executed.
 /// DOM objects are only valid for the scope of this method.
 /// Do not keep references to or attempt to access any DOM objects outside the scope of this method.
 /// </summary>
 protected virtual void OnFocusedNodeChanged(CefBrowser browser, CefFrame frame, CefDomNode node)
 {
 }
예제 #8
0
 /// <summary>
 /// Returns true if this object is pointing to the same handle as |that| object.
 /// </summary>
 public bool IsSame(CefDomNode that)
 {
     return(cef_domnode_t.invoke_is_same(this.ptr, that.GetNativePointerAndAddRef()) != 0);
 }
예제 #9
0
        /// <summary>
        /// Returns the next sibling node.
        /// </summary>
        public CefDomNode GetNextSibling()
        {
            var n_result = cef_domnode_t.invoke_get_next_sibling(this.ptr);

            return(CefDomNode.From(n_result));
        }
예제 #10
0
 /// <summary>
 /// Returns the last child node.
 /// </summary>
 public CefDomNode GetLastChild()
 {
     return(CefDomNode.From(
                cef_domnode_t.invoke_get_last_child(this.ptr)
                ));
 }
예제 #11
0
        /// <summary>
        /// Returns the previous sibling node.
        /// </summary>
        public CefDomNode GetPreviousSibling()
        {
            var n_result = cef_domnode_t.invoke_get_previous_sibling(this.ptr);

            return(CefDomNode.From(n_result));
        }
예제 #12
0
        /// <summary>
        /// Returns the parent node.
        /// </summary>
        public CefDomNode GetParent()
        {
            var n_parent = cef_domnode_t.invoke_get_parent(this.ptr);

            return(CefDomNode.From(n_parent));
        }
예제 #13
0
 /// <summary>
 /// Returns the current target of the event.
 /// </summary>
 public CefDomNode GetCurrentTarget()
 {
     return(CefDomNode.From(
                cef_domevent_t.invoke_get_current_target(this.ptr)
                ));
 }
예제 #14
0
 /// <summary>
 /// Called when a new node in the the browser gets focus.
 /// The |node| value may be empty if no specific node has gained focus.
 /// The node object passed to this method represents a snapshot of the DOM at the time this method is executed.
 /// DOM objects are only valid for the scope of this method.
 /// Do not keep references to or attempt to access any DOM objects outside the scope of this method.
 /// </summary>
 protected virtual void OnFocusedNodeChanged(CefBrowser browser, CefFrame frame, CefDomNode node)
 {
 }
예제 #15
0
 /// <summary>
 /// Returns true if this object is pointing to the same handle as |that| object.
 /// </summary>
 public bool IsSame(CefDomNode that)
 {
     return cef_domnode_t.invoke_is_same(this.ptr, that.GetNativePointerAndAddRef()) != 0;
 }