Add direct DOM access (issue #511).

git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@610 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
This commit is contained in:
Marshall Greenblatt
2012-04-27 21:19:06 +00:00
parent 4fe0ddf640
commit db3a9817ed
58 changed files with 5089 additions and 7 deletions

View File

@@ -0,0 +1,255 @@
// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool. If making changes by
// hand only do so within the body of existing method and function
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
#include "libcef_dll/ctocpp/domdocument_ctocpp.h"
#include "libcef_dll/ctocpp/domnode_ctocpp.h"
// VIRTUAL METHODS - Body may be edited by hand.
CefDOMDocument::Type CefDOMDocumentCToCpp::GetType() {
if (CEF_MEMBER_MISSING(struct_, get_type))
return DOM_DOCUMENT_TYPE_UNKNOWN;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_dom_document_type_t _retval = struct_->get_type(struct_);
// Return type: simple
return _retval;
}
CefRefPtr<CefDOMNode> CefDOMDocumentCToCpp::GetDocument() {
if (CEF_MEMBER_MISSING(struct_, get_document))
return NULL;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_domnode_t* _retval = struct_->get_document(struct_);
// Return type: refptr_same
return CefDOMNodeCToCpp::Wrap(_retval);
}
CefRefPtr<CefDOMNode> CefDOMDocumentCToCpp::GetBody() {
if (CEF_MEMBER_MISSING(struct_, get_body))
return NULL;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_domnode_t* _retval = struct_->get_body(struct_);
// Return type: refptr_same
return CefDOMNodeCToCpp::Wrap(_retval);
}
CefRefPtr<CefDOMNode> CefDOMDocumentCToCpp::GetHead() {
if (CEF_MEMBER_MISSING(struct_, get_head))
return NULL;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_domnode_t* _retval = struct_->get_head(struct_);
// Return type: refptr_same
return CefDOMNodeCToCpp::Wrap(_retval);
}
CefString CefDOMDocumentCToCpp::GetTitle() {
if (CEF_MEMBER_MISSING(struct_, get_title))
return CefString();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_string_userfree_t _retval = struct_->get_title(struct_);
// Return type: string
CefString _retvalStr;
_retvalStr.AttachToUserFree(_retval);
return _retvalStr;
}
CefRefPtr<CefDOMNode> CefDOMDocumentCToCpp::GetElementById(
const CefString& id) {
if (CEF_MEMBER_MISSING(struct_, get_element_by_id))
return NULL;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: id; type: string_byref_const
DCHECK(!id.empty());
if (id.empty())
return NULL;
// Execute
cef_domnode_t* _retval = struct_->get_element_by_id(struct_,
id.GetStruct());
// Return type: refptr_same
return CefDOMNodeCToCpp::Wrap(_retval);
}
CefRefPtr<CefDOMNode> CefDOMDocumentCToCpp::GetFocusedNode() {
if (CEF_MEMBER_MISSING(struct_, get_focused_node))
return NULL;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_domnode_t* _retval = struct_->get_focused_node(struct_);
// Return type: refptr_same
return CefDOMNodeCToCpp::Wrap(_retval);
}
bool CefDOMDocumentCToCpp::HasSelection() {
if (CEF_MEMBER_MISSING(struct_, has_selection))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = struct_->has_selection(struct_);
// Return type: bool
return _retval?true:false;
}
CefRefPtr<CefDOMNode> CefDOMDocumentCToCpp::GetSelectionStartNode() {
if (CEF_MEMBER_MISSING(struct_, get_selection_start_node))
return NULL;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_domnode_t* _retval = struct_->get_selection_start_node(struct_);
// Return type: refptr_same
return CefDOMNodeCToCpp::Wrap(_retval);
}
int CefDOMDocumentCToCpp::GetSelectionStartOffset() {
if (CEF_MEMBER_MISSING(struct_, get_selection_start_offset))
return 0;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = struct_->get_selection_start_offset(struct_);
// Return type: simple
return _retval;
}
CefRefPtr<CefDOMNode> CefDOMDocumentCToCpp::GetSelectionEndNode() {
if (CEF_MEMBER_MISSING(struct_, get_selection_end_node))
return NULL;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_domnode_t* _retval = struct_->get_selection_end_node(struct_);
// Return type: refptr_same
return CefDOMNodeCToCpp::Wrap(_retval);
}
int CefDOMDocumentCToCpp::GetSelectionEndOffset() {
if (CEF_MEMBER_MISSING(struct_, get_selection_end_offset))
return 0;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = struct_->get_selection_end_offset(struct_);
// Return type: simple
return _retval;
}
CefString CefDOMDocumentCToCpp::GetSelectionAsMarkup() {
if (CEF_MEMBER_MISSING(struct_, get_selection_as_markup))
return CefString();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_string_userfree_t _retval = struct_->get_selection_as_markup(struct_);
// Return type: string
CefString _retvalStr;
_retvalStr.AttachToUserFree(_retval);
return _retvalStr;
}
CefString CefDOMDocumentCToCpp::GetSelectionAsText() {
if (CEF_MEMBER_MISSING(struct_, get_selection_as_text))
return CefString();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_string_userfree_t _retval = struct_->get_selection_as_text(struct_);
// Return type: string
CefString _retvalStr;
_retvalStr.AttachToUserFree(_retval);
return _retvalStr;
}
CefString CefDOMDocumentCToCpp::GetBaseURL() {
if (CEF_MEMBER_MISSING(struct_, get_base_url))
return CefString();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_string_userfree_t _retval = struct_->get_base_url(struct_);
// Return type: string
CefString _retvalStr;
_retvalStr.AttachToUserFree(_retval);
return _retvalStr;
}
CefString CefDOMDocumentCToCpp::GetCompleteURL(const CefString& partialURL) {
if (CEF_MEMBER_MISSING(struct_, get_complete_url))
return CefString();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: partialURL; type: string_byref_const
DCHECK(!partialURL.empty());
if (partialURL.empty())
return CefString();
// Execute
cef_string_userfree_t _retval = struct_->get_complete_url(struct_,
partialURL.GetStruct());
// Return type: string
CefString _retvalStr;
_retvalStr.AttachToUserFree(_retval);
return _retvalStr;
}
#ifndef NDEBUG
template<> long CefCToCpp<CefDOMDocumentCToCpp, CefDOMDocument,
cef_domdocument_t>::DebugObjCt = 0;
#endif

View File

@@ -0,0 +1,57 @@
// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool. If making changes by
// hand only do so within the body of existing method and function
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_DOMDOCUMENT_CTOCPP_H_
#define CEF_LIBCEF_DLL_CTOCPP_DOMDOCUMENT_CTOCPP_H_
#pragma once
#ifndef USING_CEF_SHARED
#pragma message("Warning: "__FILE__" may be accessed wrapper-side only")
#else // USING_CEF_SHARED
#include "include/cef_dom.h"
#include "include/capi/cef_dom_capi.h"
#include "libcef_dll/ctocpp/ctocpp.h"
// Wrap a C structure with a C++ class.
// This class may be instantiated and accessed wrapper-side only.
class CefDOMDocumentCToCpp
: public CefCToCpp<CefDOMDocumentCToCpp, CefDOMDocument,
cef_domdocument_t> {
public:
explicit CefDOMDocumentCToCpp(cef_domdocument_t* str)
: CefCToCpp<CefDOMDocumentCToCpp, CefDOMDocument, cef_domdocument_t>(
str) {}
virtual ~CefDOMDocumentCToCpp() {}
// CefDOMDocument methods
virtual Type GetType() OVERRIDE;
virtual CefRefPtr<CefDOMNode> GetDocument() OVERRIDE;
virtual CefRefPtr<CefDOMNode> GetBody() OVERRIDE;
virtual CefRefPtr<CefDOMNode> GetHead() OVERRIDE;
virtual CefString GetTitle() OVERRIDE;
virtual CefRefPtr<CefDOMNode> GetElementById(const CefString& id) OVERRIDE;
virtual CefRefPtr<CefDOMNode> GetFocusedNode() OVERRIDE;
virtual bool HasSelection() OVERRIDE;
virtual CefRefPtr<CefDOMNode> GetSelectionStartNode() OVERRIDE;
virtual int GetSelectionStartOffset() OVERRIDE;
virtual CefRefPtr<CefDOMNode> GetSelectionEndNode() OVERRIDE;
virtual int GetSelectionEndOffset() OVERRIDE;
virtual CefString GetSelectionAsMarkup() OVERRIDE;
virtual CefString GetSelectionAsText() OVERRIDE;
virtual CefString GetBaseURL() OVERRIDE;
virtual CefString GetCompleteURL(const CefString& partialURL) OVERRIDE;
};
#endif // USING_CEF_SHARED
#endif // CEF_LIBCEF_DLL_CTOCPP_DOMDOCUMENT_CTOCPP_H_

View File

@@ -0,0 +1,131 @@
// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool. If making changes by
// hand only do so within the body of existing method and function
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
#include "libcef_dll/ctocpp/domdocument_ctocpp.h"
#include "libcef_dll/ctocpp/domevent_ctocpp.h"
#include "libcef_dll/ctocpp/domnode_ctocpp.h"
// VIRTUAL METHODS - Body may be edited by hand.
CefString CefDOMEventCToCpp::GetType() {
if (CEF_MEMBER_MISSING(struct_, get_type))
return CefString();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_string_userfree_t _retval = struct_->get_type(struct_);
// Return type: string
CefString _retvalStr;
_retvalStr.AttachToUserFree(_retval);
return _retvalStr;
}
CefDOMEvent::Category CefDOMEventCToCpp::GetCategory() {
if (CEF_MEMBER_MISSING(struct_, get_category))
return DOM_EVENT_CATEGORY_UNKNOWN;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_dom_event_category_t _retval = struct_->get_category(struct_);
// Return type: simple
return _retval;
}
CefDOMEvent::Phase CefDOMEventCToCpp::GetPhase() {
if (CEF_MEMBER_MISSING(struct_, get_phase))
return DOM_EVENT_PHASE_UNKNOWN;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_dom_event_phase_t _retval = struct_->get_phase(struct_);
// Return type: simple
return _retval;
}
bool CefDOMEventCToCpp::CanBubble() {
if (CEF_MEMBER_MISSING(struct_, can_bubble))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = struct_->can_bubble(struct_);
// Return type: bool
return _retval?true:false;
}
bool CefDOMEventCToCpp::CanCancel() {
if (CEF_MEMBER_MISSING(struct_, can_cancel))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = struct_->can_cancel(struct_);
// Return type: bool
return _retval?true:false;
}
CefRefPtr<CefDOMDocument> CefDOMEventCToCpp::GetDocument() {
if (CEF_MEMBER_MISSING(struct_, get_document))
return NULL;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_domdocument_t* _retval = struct_->get_document(struct_);
// Return type: refptr_same
return CefDOMDocumentCToCpp::Wrap(_retval);
}
CefRefPtr<CefDOMNode> CefDOMEventCToCpp::GetTarget() {
if (CEF_MEMBER_MISSING(struct_, get_target))
return NULL;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_domnode_t* _retval = struct_->get_target(struct_);
// Return type: refptr_same
return CefDOMNodeCToCpp::Wrap(_retval);
}
CefRefPtr<CefDOMNode> CefDOMEventCToCpp::GetCurrentTarget() {
if (CEF_MEMBER_MISSING(struct_, get_current_target))
return NULL;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_domnode_t* _retval = struct_->get_current_target(struct_);
// Return type: refptr_same
return CefDOMNodeCToCpp::Wrap(_retval);
}
#ifndef NDEBUG
template<> long CefCToCpp<CefDOMEventCToCpp, CefDOMEvent,
cef_domevent_t>::DebugObjCt = 0;
#endif

View File

@@ -0,0 +1,47 @@
// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool. If making changes by
// hand only do so within the body of existing method and function
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_DOMEVENT_CTOCPP_H_
#define CEF_LIBCEF_DLL_CTOCPP_DOMEVENT_CTOCPP_H_
#pragma once
#ifndef USING_CEF_SHARED
#pragma message("Warning: "__FILE__" may be accessed wrapper-side only")
#else // USING_CEF_SHARED
#include "include/cef_dom.h"
#include "include/capi/cef_dom_capi.h"
#include "libcef_dll/ctocpp/ctocpp.h"
// Wrap a C structure with a C++ class.
// This class may be instantiated and accessed wrapper-side only.
class CefDOMEventCToCpp
: public CefCToCpp<CefDOMEventCToCpp, CefDOMEvent, cef_domevent_t> {
public:
explicit CefDOMEventCToCpp(cef_domevent_t* str)
: CefCToCpp<CefDOMEventCToCpp, CefDOMEvent, cef_domevent_t>(str) {}
virtual ~CefDOMEventCToCpp() {}
// CefDOMEvent methods
virtual CefString GetType() OVERRIDE;
virtual Category GetCategory() OVERRIDE;
virtual Phase GetPhase() OVERRIDE;
virtual bool CanBubble() OVERRIDE;
virtual bool CanCancel() OVERRIDE;
virtual CefRefPtr<CefDOMDocument> GetDocument() OVERRIDE;
virtual CefRefPtr<CefDOMNode> GetTarget() OVERRIDE;
virtual CefRefPtr<CefDOMNode> GetCurrentTarget() OVERRIDE;
};
#endif // USING_CEF_SHARED
#endif // CEF_LIBCEF_DLL_CTOCPP_DOMEVENT_CTOCPP_H_

View File

@@ -0,0 +1,40 @@
// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool. If making changes by
// hand only do so within the body of existing method and function
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
#include "libcef_dll/cpptoc/domevent_cpptoc.h"
#include "libcef_dll/ctocpp/domevent_listener_ctocpp.h"
// VIRTUAL METHODS - Body may be edited by hand.
void CefDOMEventListenerCToCpp::HandleEvent(CefRefPtr<CefDOMEvent> event) {
if (CEF_MEMBER_MISSING(struct_, handle_event))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: event; type: refptr_diff
DCHECK(event.get());
if (!event.get())
return;
// Execute
struct_->handle_event(struct_,
CefDOMEventCppToC::Wrap(event));
}
#ifndef NDEBUG
template<> long CefCToCpp<CefDOMEventListenerCToCpp, CefDOMEventListener,
cef_domevent_listener_t>::DebugObjCt = 0;
#endif

View File

@@ -0,0 +1,42 @@
// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool. If making changes by
// hand only do so within the body of existing method and function
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_DOMEVENT_LISTENER_CTOCPP_H_
#define CEF_LIBCEF_DLL_CTOCPP_DOMEVENT_LISTENER_CTOCPP_H_
#pragma once
#ifndef BUILDING_CEF_SHARED
#pragma message("Warning: "__FILE__" may be accessed DLL-side only")
#else // BUILDING_CEF_SHARED
#include "include/cef_dom.h"
#include "include/capi/cef_dom_capi.h"
#include "libcef_dll/ctocpp/ctocpp.h"
// Wrap a C structure with a C++ class.
// This class may be instantiated and accessed DLL-side only.
class CefDOMEventListenerCToCpp
: public CefCToCpp<CefDOMEventListenerCToCpp, CefDOMEventListener,
cef_domevent_listener_t> {
public:
explicit CefDOMEventListenerCToCpp(cef_domevent_listener_t* str)
: CefCToCpp<CefDOMEventListenerCToCpp, CefDOMEventListener,
cef_domevent_listener_t>(str) {}
virtual ~CefDOMEventListenerCToCpp() {}
// CefDOMEventListener methods
virtual void HandleEvent(CefRefPtr<CefDOMEvent> event) OVERRIDE;
};
#endif // BUILDING_CEF_SHARED
#endif // CEF_LIBCEF_DLL_CTOCPP_DOMEVENT_LISTENER_CTOCPP_H_

View File

@@ -0,0 +1,423 @@
// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool. If making changes by
// hand only do so within the body of existing method and function
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
#include "libcef_dll/cpptoc/domevent_listener_cpptoc.h"
#include "libcef_dll/ctocpp/domdocument_ctocpp.h"
#include "libcef_dll/ctocpp/domnode_ctocpp.h"
#include "libcef_dll/transfer_util.h"
// VIRTUAL METHODS - Body may be edited by hand.
CefDOMNode::Type CefDOMNodeCToCpp::GetType() {
if (CEF_MEMBER_MISSING(struct_, get_type))
return DOM_NODE_TYPE_UNSUPPORTED;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_dom_node_type_t _retval = struct_->get_type(struct_);
// Return type: simple
return _retval;
}
bool CefDOMNodeCToCpp::IsText() {
if (CEF_MEMBER_MISSING(struct_, is_text))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = struct_->is_text(struct_);
// Return type: bool
return _retval?true:false;
}
bool CefDOMNodeCToCpp::IsElement() {
if (CEF_MEMBER_MISSING(struct_, is_element))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = struct_->is_element(struct_);
// Return type: bool
return _retval?true:false;
}
bool CefDOMNodeCToCpp::IsFormControlElement() {
if (CEF_MEMBER_MISSING(struct_, is_form_control_element))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = struct_->is_form_control_element(struct_);
// Return type: bool
return _retval?true:false;
}
CefString CefDOMNodeCToCpp::GetFormControlElementType() {
if (CEF_MEMBER_MISSING(struct_, get_form_control_element_type))
return CefString();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_string_userfree_t _retval = struct_->get_form_control_element_type(
struct_);
// Return type: string
CefString _retvalStr;
_retvalStr.AttachToUserFree(_retval);
return _retvalStr;
}
bool CefDOMNodeCToCpp::IsSame(CefRefPtr<CefDOMNode> that) {
if (CEF_MEMBER_MISSING(struct_, is_same))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: that; type: refptr_same
DCHECK(that.get());
if (!that.get())
return false;
// Execute
int _retval = struct_->is_same(struct_,
CefDOMNodeCToCpp::Unwrap(that));
// Return type: bool
return _retval?true:false;
}
CefString CefDOMNodeCToCpp::GetName() {
if (CEF_MEMBER_MISSING(struct_, get_name))
return CefString();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_string_userfree_t _retval = struct_->get_name(struct_);
// Return type: string
CefString _retvalStr;
_retvalStr.AttachToUserFree(_retval);
return _retvalStr;
}
CefString CefDOMNodeCToCpp::GetValue() {
if (CEF_MEMBER_MISSING(struct_, get_value))
return CefString();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_string_userfree_t _retval = struct_->get_value(struct_);
// Return type: string
CefString _retvalStr;
_retvalStr.AttachToUserFree(_retval);
return _retvalStr;
}
bool CefDOMNodeCToCpp::SetValue(const CefString& value) {
if (CEF_MEMBER_MISSING(struct_, set_value))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: value; type: string_byref_const
DCHECK(!value.empty());
if (value.empty())
return false;
// Execute
int _retval = struct_->set_value(struct_,
value.GetStruct());
// Return type: bool
return _retval?true:false;
}
CefString CefDOMNodeCToCpp::GetAsMarkup() {
if (CEF_MEMBER_MISSING(struct_, get_as_markup))
return CefString();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_string_userfree_t _retval = struct_->get_as_markup(struct_);
// Return type: string
CefString _retvalStr;
_retvalStr.AttachToUserFree(_retval);
return _retvalStr;
}
CefRefPtr<CefDOMDocument> CefDOMNodeCToCpp::GetDocument() {
if (CEF_MEMBER_MISSING(struct_, get_document))
return NULL;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_domdocument_t* _retval = struct_->get_document(struct_);
// Return type: refptr_same
return CefDOMDocumentCToCpp::Wrap(_retval);
}
CefRefPtr<CefDOMNode> CefDOMNodeCToCpp::GetParent() {
if (CEF_MEMBER_MISSING(struct_, get_parent))
return NULL;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_domnode_t* _retval = struct_->get_parent(struct_);
// Return type: refptr_same
return CefDOMNodeCToCpp::Wrap(_retval);
}
CefRefPtr<CefDOMNode> CefDOMNodeCToCpp::GetPreviousSibling() {
if (CEF_MEMBER_MISSING(struct_, get_previous_sibling))
return NULL;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_domnode_t* _retval = struct_->get_previous_sibling(struct_);
// Return type: refptr_same
return CefDOMNodeCToCpp::Wrap(_retval);
}
CefRefPtr<CefDOMNode> CefDOMNodeCToCpp::GetNextSibling() {
if (CEF_MEMBER_MISSING(struct_, get_next_sibling))
return NULL;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_domnode_t* _retval = struct_->get_next_sibling(struct_);
// Return type: refptr_same
return CefDOMNodeCToCpp::Wrap(_retval);
}
bool CefDOMNodeCToCpp::HasChildren() {
if (CEF_MEMBER_MISSING(struct_, has_children))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = struct_->has_children(struct_);
// Return type: bool
return _retval?true:false;
}
CefRefPtr<CefDOMNode> CefDOMNodeCToCpp::GetFirstChild() {
if (CEF_MEMBER_MISSING(struct_, get_first_child))
return NULL;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_domnode_t* _retval = struct_->get_first_child(struct_);
// Return type: refptr_same
return CefDOMNodeCToCpp::Wrap(_retval);
}
CefRefPtr<CefDOMNode> CefDOMNodeCToCpp::GetLastChild() {
if (CEF_MEMBER_MISSING(struct_, get_last_child))
return NULL;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_domnode_t* _retval = struct_->get_last_child(struct_);
// Return type: refptr_same
return CefDOMNodeCToCpp::Wrap(_retval);
}
void CefDOMNodeCToCpp::AddEventListener(const CefString& eventType,
CefRefPtr<CefDOMEventListener> listener, bool useCapture) {
if (CEF_MEMBER_MISSING(struct_, add_event_listener))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: eventType; type: string_byref_const
DCHECK(!eventType.empty());
if (eventType.empty())
return;
// Verify param: listener; type: refptr_diff
DCHECK(listener.get());
if (!listener.get())
return;
// Execute
struct_->add_event_listener(struct_,
eventType.GetStruct(),
CefDOMEventListenerCppToC::Wrap(listener),
useCapture);
}
CefString CefDOMNodeCToCpp::GetElementTagName() {
if (CEF_MEMBER_MISSING(struct_, get_element_tag_name))
return CefString();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_string_userfree_t _retval = struct_->get_element_tag_name(struct_);
// Return type: string
CefString _retvalStr;
_retvalStr.AttachToUserFree(_retval);
return _retvalStr;
}
bool CefDOMNodeCToCpp::HasElementAttributes() {
if (CEF_MEMBER_MISSING(struct_, has_element_attributes))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = struct_->has_element_attributes(struct_);
// Return type: bool
return _retval?true:false;
}
bool CefDOMNodeCToCpp::HasElementAttribute(const CefString& attrName) {
if (CEF_MEMBER_MISSING(struct_, has_element_attribute))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: attrName; type: string_byref_const
DCHECK(!attrName.empty());
if (attrName.empty())
return false;
// Execute
int _retval = struct_->has_element_attribute(struct_,
attrName.GetStruct());
// Return type: bool
return _retval?true:false;
}
CefString CefDOMNodeCToCpp::GetElementAttribute(const CefString& attrName) {
if (CEF_MEMBER_MISSING(struct_, get_element_attribute))
return CefString();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: attrName; type: string_byref_const
DCHECK(!attrName.empty());
if (attrName.empty())
return CefString();
// Execute
cef_string_userfree_t _retval = struct_->get_element_attribute(struct_,
attrName.GetStruct());
// Return type: string
CefString _retvalStr;
_retvalStr.AttachToUserFree(_retval);
return _retvalStr;
}
void CefDOMNodeCToCpp::GetElementAttributes(AttributeMap& attrMap) {
if (CEF_MEMBER_MISSING(struct_, get_element_attributes))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Translate param: attrMap; type: string_map_single_byref
cef_string_map_t attrMapMap = cef_string_map_alloc();
DCHECK(attrMapMap);
if (attrMapMap)
transfer_string_map_contents(attrMap, attrMapMap);
// Execute
struct_->get_element_attributes(struct_,
attrMapMap);
// Restore param:attrMap; type: string_map_single_byref
if (attrMapMap) {
attrMap.clear();
transfer_string_map_contents(attrMapMap, attrMap);
cef_string_map_free(attrMapMap);
}
}
bool CefDOMNodeCToCpp::SetElementAttribute(const CefString& attrName,
const CefString& value) {
if (CEF_MEMBER_MISSING(struct_, set_element_attribute))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: attrName; type: string_byref_const
DCHECK(!attrName.empty());
if (attrName.empty())
return false;
// Verify param: value; type: string_byref_const
DCHECK(!value.empty());
if (value.empty())
return false;
// Execute
int _retval = struct_->set_element_attribute(struct_,
attrName.GetStruct(),
value.GetStruct());
// Return type: bool
return _retval?true:false;
}
CefString CefDOMNodeCToCpp::GetElementInnerText() {
if (CEF_MEMBER_MISSING(struct_, get_element_inner_text))
return CefString();
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
cef_string_userfree_t _retval = struct_->get_element_inner_text(struct_);
// Return type: string
CefString _retvalStr;
_retvalStr.AttachToUserFree(_retval);
return _retvalStr;
}
#ifndef NDEBUG
template<> long CefCToCpp<CefDOMNodeCToCpp, CefDOMNode,
cef_domnode_t>::DebugObjCt = 0;
#endif

View File

@@ -0,0 +1,66 @@
// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool. If making changes by
// hand only do so within the body of existing method and function
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_DOMNODE_CTOCPP_H_
#define CEF_LIBCEF_DLL_CTOCPP_DOMNODE_CTOCPP_H_
#pragma once
#ifndef USING_CEF_SHARED
#pragma message("Warning: "__FILE__" may be accessed wrapper-side only")
#else // USING_CEF_SHARED
#include "include/cef_dom.h"
#include "include/capi/cef_dom_capi.h"
#include "libcef_dll/ctocpp/ctocpp.h"
// Wrap a C structure with a C++ class.
// This class may be instantiated and accessed wrapper-side only.
class CefDOMNodeCToCpp
: public CefCToCpp<CefDOMNodeCToCpp, CefDOMNode, cef_domnode_t> {
public:
explicit CefDOMNodeCToCpp(cef_domnode_t* str)
: CefCToCpp<CefDOMNodeCToCpp, CefDOMNode, cef_domnode_t>(str) {}
virtual ~CefDOMNodeCToCpp() {}
// CefDOMNode methods
virtual Type GetType() OVERRIDE;
virtual bool IsText() OVERRIDE;
virtual bool IsElement() OVERRIDE;
virtual bool IsFormControlElement() OVERRIDE;
virtual CefString GetFormControlElementType() OVERRIDE;
virtual bool IsSame(CefRefPtr<CefDOMNode> that) OVERRIDE;
virtual CefString GetName() OVERRIDE;
virtual CefString GetValue() OVERRIDE;
virtual bool SetValue(const CefString& value) OVERRIDE;
virtual CefString GetAsMarkup() OVERRIDE;
virtual CefRefPtr<CefDOMDocument> GetDocument() OVERRIDE;
virtual CefRefPtr<CefDOMNode> GetParent() OVERRIDE;
virtual CefRefPtr<CefDOMNode> GetPreviousSibling() OVERRIDE;
virtual CefRefPtr<CefDOMNode> GetNextSibling() OVERRIDE;
virtual bool HasChildren() OVERRIDE;
virtual CefRefPtr<CefDOMNode> GetFirstChild() OVERRIDE;
virtual CefRefPtr<CefDOMNode> GetLastChild() OVERRIDE;
virtual void AddEventListener(const CefString& eventType,
CefRefPtr<CefDOMEventListener> listener, bool useCapture) OVERRIDE;
virtual CefString GetElementTagName() OVERRIDE;
virtual bool HasElementAttributes() OVERRIDE;
virtual bool HasElementAttribute(const CefString& attrName) OVERRIDE;
virtual CefString GetElementAttribute(const CefString& attrName) OVERRIDE;
virtual void GetElementAttributes(AttributeMap& attrMap) OVERRIDE;
virtual bool SetElementAttribute(const CefString& attrName,
const CefString& value) OVERRIDE;
virtual CefString GetElementInnerText() OVERRIDE;
};
#endif // USING_CEF_SHARED
#endif // CEF_LIBCEF_DLL_CTOCPP_DOMNODE_CTOCPP_H_

View File

@@ -0,0 +1,40 @@
// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool. If making changes by
// hand only do so within the body of existing method and function
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
#include "libcef_dll/cpptoc/domdocument_cpptoc.h"
#include "libcef_dll/ctocpp/domvisitor_ctocpp.h"
// VIRTUAL METHODS - Body may be edited by hand.
void CefDOMVisitorCToCpp::Visit(CefRefPtr<CefDOMDocument> document) {
if (CEF_MEMBER_MISSING(struct_, visit))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: document; type: refptr_diff
DCHECK(document.get());
if (!document.get())
return;
// Execute
struct_->visit(struct_,
CefDOMDocumentCppToC::Wrap(document));
}
#ifndef NDEBUG
template<> long CefCToCpp<CefDOMVisitorCToCpp, CefDOMVisitor,
cef_domvisitor_t>::DebugObjCt = 0;
#endif

View File

@@ -0,0 +1,40 @@
// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights
// reserved. Use of this source code is governed by a BSD-style license that
// can be found in the LICENSE file.
//
// ---------------------------------------------------------------------------
//
// This file was generated by the CEF translator tool. If making changes by
// hand only do so within the body of existing method and function
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_DOMVISITOR_CTOCPP_H_
#define CEF_LIBCEF_DLL_CTOCPP_DOMVISITOR_CTOCPP_H_
#pragma once
#ifndef BUILDING_CEF_SHARED
#pragma message("Warning: "__FILE__" may be accessed DLL-side only")
#else // BUILDING_CEF_SHARED
#include "include/cef_dom.h"
#include "include/capi/cef_dom_capi.h"
#include "libcef_dll/ctocpp/ctocpp.h"
// Wrap a C structure with a C++ class.
// This class may be instantiated and accessed DLL-side only.
class CefDOMVisitorCToCpp
: public CefCToCpp<CefDOMVisitorCToCpp, CefDOMVisitor, cef_domvisitor_t> {
public:
explicit CefDOMVisitorCToCpp(cef_domvisitor_t* str)
: CefCToCpp<CefDOMVisitorCToCpp, CefDOMVisitor, cef_domvisitor_t>(str) {}
virtual ~CefDOMVisitorCToCpp() {}
// CefDOMVisitor methods
virtual void Visit(CefRefPtr<CefDOMDocument> document) OVERRIDE;
};
#endif // BUILDING_CEF_SHARED
#endif // CEF_LIBCEF_DLL_CTOCPP_DOMVISITOR_CTOCPP_H_

View File

@@ -10,6 +10,7 @@
// for more information.
//
#include "libcef_dll/cpptoc/domvisitor_cpptoc.h"
#include "libcef_dll/cpptoc/string_visitor_cpptoc.h"
#include "libcef_dll/ctocpp/browser_ctocpp.h"
#include "libcef_dll/ctocpp/frame_ctocpp.h"
@@ -326,6 +327,22 @@ CefRefPtr<CefV8Context> CefFrameCToCpp::GetV8Context() {
return CefV8ContextCToCpp::Wrap(_retval);
}
void CefFrameCToCpp::VisitDOM(CefRefPtr<CefDOMVisitor> visitor) {
if (CEF_MEMBER_MISSING(struct_, visit_dom))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: visitor; type: refptr_diff
DCHECK(visitor.get());
if (!visitor.get())
return;
// Execute
struct_->visit_dom(struct_,
CefDOMVisitorCppToC::Wrap(visitor));
}
#ifndef NDEBUG
template<> long CefCToCpp<CefFrameCToCpp, CefFrame, cef_frame_t>::DebugObjCt =

View File

@@ -61,6 +61,7 @@ class CefFrameCToCpp
virtual CefString GetURL() OVERRIDE;
virtual CefRefPtr<CefBrowser> GetBrowser() OVERRIDE;
virtual CefRefPtr<CefV8Context> GetV8Context() OVERRIDE;
virtual void VisitDOM(CefRefPtr<CefDOMVisitor> visitor) OVERRIDE;
};
#endif // USING_CEF_SHARED