#include <map>
class CefDOMDocument;
-class CefDOMEventListener;
class CefDOMNode;
///
// be called on the render process main thread.
///
/*--cef(source=client)--*/
-class CefDOMVisitor : public virtual CefBase {
+class CefDOMVisitor : public virtual CefBaseRefCounted {
public:
///
// Method executed for visiting the DOM. The document object passed to this
// be called on the render process main thread thread.
///
/*--cef(source=library)--*/
-class CefDOMDocument : public virtual CefBase {
+class CefDOMDocument : public virtual CefBaseRefCounted {
public:
typedef cef_dom_document_type_t Type;
/*--cef()--*/
virtual bool HasSelection() =0;
- ///
- // Returns the selection start node.
- ///
- /*--cef()--*/
- virtual CefRefPtr<CefDOMNode> GetSelectionStartNode() =0;
-
///
// Returns the selection offset within the start node.
///
/*--cef()--*/
virtual int GetSelectionStartOffset() =0;
- ///
- // Returns the selection end node.
- ///
- /*--cef()--*/
- virtual CefRefPtr<CefDOMNode> GetSelectionEndNode() =0;
-
///
// Returns the selection offset within the end node.
///
// called on the render process main thread.
///
/*--cef(source=library)--*/
-class CefDOMNode : public virtual CefBase {
+class CefDOMNode : public virtual CefBaseRefCounted {
public:
typedef std::map<CefString, CefString> AttributeMap;
typedef cef_dom_node_type_t Type;
/*--cef()--*/
virtual CefRefPtr<CefDOMNode> GetLastChild() =0;
- ///
- // Add an event listener to this node for the specified event type. If
- // |useCapture| is true then this listener will be considered a capturing
- // listener. Capturing listeners will recieve all events of the specified
- // type before the events are dispatched to any other event targets beneath
- // the current node in the tree. Events which are bubbling upwards through
- // the tree will not trigger a capturing listener. Separate calls to this
- // method can be used to register the same listener with and without capture.
- // See WebCore/dom/EventNames.h for the list of supported event types.
- ///
- /*--cef()--*/
- virtual void AddEventListener(const CefString& eventType,
- CefRefPtr<CefDOMEventListener> listener,
- bool useCapture) =0;
-
-
// The following methods are valid only for element nodes.
///
///
/*--cef()--*/
virtual CefString GetElementInnerText() =0;
-};
-
-
-///
-// Class used to represent a DOM event. The methods of this class should only
-// be called on the render process main thread.
-///
-/*--cef(source=library)--*/
-class CefDOMEvent : public virtual CefBase {
- public:
- typedef cef_dom_event_category_t Category;
- typedef cef_dom_event_phase_t Phase;
-
- ///
- // Returns the event type.
- ///
- /*--cef()--*/
- virtual CefString GetType() =0;
-
- ///
- // Returns the event category.
- ///
- /*--cef(default_retval=DOM_EVENT_CATEGORY_UNKNOWN)--*/
- virtual Category GetCategory() =0;
-
- ///
- // Returns the event processing phase.
- ///
- /*--cef(default_retval=DOM_EVENT_PHASE_UNKNOWN)--*/
- virtual Phase GetPhase() =0;
-
- ///
- // Returns true if the event can bubble up the tree.
- ///
- /*--cef()--*/
- virtual bool CanBubble() =0;
-
- ///
- // Returns true if the event can be canceled.
- ///
- /*--cef()--*/
- virtual bool CanCancel() =0;
-
- ///
- // Returns the document associated with this event.
- ///
- /*--cef()--*/
- virtual CefRefPtr<CefDOMDocument> GetDocument() =0;
///
- // Returns the target of the event.
- ///
- /*--cef()--*/
- virtual CefRefPtr<CefDOMNode> GetTarget() =0;
-
- ///
- // Returns the current target of the event.
- ///
- /*--cef()--*/
- virtual CefRefPtr<CefDOMNode> GetCurrentTarget() =0;
-};
-
-
-///
-// Interface to implement for handling DOM events. The methods of this class
-// will be called on the render process main thread.
-///
-/*--cef(source=client)--*/
-class CefDOMEventListener : public virtual CefBase {
- public:
- ///
- // Called when an event is received. The event object passed to this method
- // contains 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.
+ // Returns the bounds of the element.
///
/*--cef()--*/
- virtual void HandleEvent(CefRefPtr<CefDOMEvent> event) =0;
+ virtual CefRect GetElementBounds() =0;
};
#endif // CEF_INCLUDE_CEF_DOM_H_