2012-02-14 18:54:38 +01:00
|
|
|
// Copyright (c) 2012 The Chromium Embedded Framework Authors. All rights
|
2011-05-20 16:42:25 +02:00
|
|
|
// reserved. Use of this source code is governed by a BSD-style license that
|
|
|
|
// can be found in the LICENSE file.
|
|
|
|
//
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
//
|
2011-12-08 02:38:30 +01:00
|
|
|
// 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
|
2011-05-20 16:42:25 +02:00
|
|
|
// implementations. See the translator.README.txt file in the tools directory
|
|
|
|
// for more information.
|
|
|
|
//
|
|
|
|
|
|
|
|
#include "libcef_dll/cpptoc/print_handler_cpptoc.h"
|
|
|
|
#include "libcef_dll/ctocpp/browser_ctocpp.h"
|
|
|
|
#include "libcef_dll/ctocpp/frame_ctocpp.h"
|
|
|
|
|
|
|
|
|
|
|
|
// MEMBER FUNCTIONS - Body may be edited by hand.
|
|
|
|
|
|
|
|
int CEF_CALLBACK print_handler_get_print_options(
|
|
|
|
struct _cef_print_handler_t* self, cef_browser_t* browser,
|
|
|
|
struct _cef_print_options_t* printOptions)
|
|
|
|
{
|
2011-12-08 02:38:30 +01:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
2011-05-20 16:42:25 +02:00
|
|
|
DCHECK(self);
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!self)
|
|
|
|
return 0;
|
|
|
|
// Verify param: browser; type: refptr_diff
|
2011-05-20 16:42:25 +02:00
|
|
|
DCHECK(browser);
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!browser)
|
|
|
|
return 0;
|
|
|
|
// Verify param: printOptions; type: struct_byref
|
2011-05-20 16:42:25 +02:00
|
|
|
DCHECK(printOptions);
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!printOptions)
|
2011-05-20 16:42:25 +02:00
|
|
|
return 0;
|
|
|
|
|
2011-12-08 02:38:30 +01:00
|
|
|
// Translate param: printOptions; type: struct_byref
|
|
|
|
CefPrintOptions printOptionsObj;
|
|
|
|
if (printOptions)
|
|
|
|
printOptionsObj.AttachTo(*printOptions);
|
|
|
|
|
|
|
|
// Execute
|
|
|
|
bool _retval = CefPrintHandlerCppToC::Get(self)->GetPrintOptions(
|
|
|
|
CefBrowserCToCpp::Wrap(browser),
|
|
|
|
printOptionsObj);
|
|
|
|
|
|
|
|
// Restore param: printOptions; type: struct_byref
|
|
|
|
if (printOptions)
|
|
|
|
printOptionsObj.DetachTo(*printOptions);
|
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
2011-05-20 16:42:25 +02:00
|
|
|
}
|
|
|
|
|
2011-12-08 02:38:30 +01:00
|
|
|
|
2011-05-20 16:42:25 +02:00
|
|
|
int CEF_CALLBACK print_handler_get_print_header_footer(
|
|
|
|
struct _cef_print_handler_t* self, cef_browser_t* browser,
|
|
|
|
cef_frame_t* frame, const cef_print_info_t* printInfo,
|
|
|
|
const cef_string_t* url, const cef_string_t* title, int currentPage,
|
|
|
|
int maxPages, cef_string_t* topLeft, cef_string_t* topCenter,
|
|
|
|
cef_string_t* topRight, cef_string_t* bottomLeft,
|
|
|
|
cef_string_t* bottomCenter, cef_string_t* bottomRight)
|
|
|
|
{
|
2011-12-08 02:38:30 +01:00
|
|
|
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
|
|
|
|
2011-05-20 16:42:25 +02:00
|
|
|
DCHECK(self);
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!self)
|
|
|
|
return 0;
|
|
|
|
// Verify param: browser; type: refptr_diff
|
2011-05-20 16:42:25 +02:00
|
|
|
DCHECK(browser);
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!browser)
|
|
|
|
return 0;
|
|
|
|
// Verify param: frame; type: refptr_diff
|
2011-05-20 16:42:25 +02:00
|
|
|
DCHECK(frame);
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!frame)
|
|
|
|
return 0;
|
|
|
|
// Verify param: printInfo; type: struct_byref_const
|
2011-05-20 16:42:25 +02:00
|
|
|
DCHECK(printInfo);
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!printInfo)
|
|
|
|
return 0;
|
|
|
|
// Verify param: url; type: string_byref_const
|
2011-05-20 16:42:25 +02:00
|
|
|
DCHECK(url);
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!url)
|
|
|
|
return 0;
|
|
|
|
// Verify param: title; type: string_byref_const
|
2011-05-20 16:42:25 +02:00
|
|
|
DCHECK(title);
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!title)
|
|
|
|
return 0;
|
|
|
|
// Verify param: topLeft; type: string_byref
|
2011-05-20 16:42:25 +02:00
|
|
|
DCHECK(topLeft);
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!topLeft)
|
|
|
|
return 0;
|
|
|
|
// Verify param: topCenter; type: string_byref
|
2011-05-20 16:42:25 +02:00
|
|
|
DCHECK(topCenter);
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!topCenter)
|
|
|
|
return 0;
|
|
|
|
// Verify param: topRight; type: string_byref
|
2011-05-20 16:42:25 +02:00
|
|
|
DCHECK(topRight);
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!topRight)
|
|
|
|
return 0;
|
|
|
|
// Verify param: bottomLeft; type: string_byref
|
2011-05-20 16:42:25 +02:00
|
|
|
DCHECK(bottomLeft);
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!bottomLeft)
|
|
|
|
return 0;
|
|
|
|
// Verify param: bottomCenter; type: string_byref
|
2011-05-20 16:42:25 +02:00
|
|
|
DCHECK(bottomCenter);
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!bottomCenter)
|
|
|
|
return 0;
|
|
|
|
// Verify param: bottomRight; type: string_byref
|
2011-05-20 16:42:25 +02:00
|
|
|
DCHECK(bottomRight);
|
2011-12-08 02:38:30 +01:00
|
|
|
if (!bottomRight)
|
2011-05-20 16:42:25 +02:00
|
|
|
return 0;
|
|
|
|
|
2011-12-08 02:38:30 +01:00
|
|
|
// Translate param: printInfo; type: struct_byref_const
|
|
|
|
CefPrintInfo printInfoObj;
|
|
|
|
if (printInfo)
|
|
|
|
printInfoObj.Set(*printInfo, false);
|
|
|
|
// Translate param: topLeft; type: string_byref
|
2011-05-20 16:42:25 +02:00
|
|
|
CefString topLeftStr(topLeft);
|
2011-12-08 02:38:30 +01:00
|
|
|
// Translate param: topCenter; type: string_byref
|
2011-05-20 16:42:25 +02:00
|
|
|
CefString topCenterStr(topCenter);
|
2011-12-08 02:38:30 +01:00
|
|
|
// Translate param: topRight; type: string_byref
|
2011-05-20 16:42:25 +02:00
|
|
|
CefString topRightStr(topRight);
|
2011-12-08 02:38:30 +01:00
|
|
|
// Translate param: bottomLeft; type: string_byref
|
2011-05-20 16:42:25 +02:00
|
|
|
CefString bottomLeftStr(bottomLeft);
|
2011-12-08 02:38:30 +01:00
|
|
|
// Translate param: bottomCenter; type: string_byref
|
2011-05-20 16:42:25 +02:00
|
|
|
CefString bottomCenterStr(bottomCenter);
|
2011-12-08 02:38:30 +01:00
|
|
|
// Translate param: bottomRight; type: string_byref
|
2011-05-20 16:42:25 +02:00
|
|
|
CefString bottomRightStr(bottomRight);
|
2011-12-08 02:38:30 +01:00
|
|
|
|
|
|
|
// Execute
|
|
|
|
bool _retval = CefPrintHandlerCppToC::Get(self)->GetPrintHeaderFooter(
|
|
|
|
CefBrowserCToCpp::Wrap(browser),
|
|
|
|
CefFrameCToCpp::Wrap(frame),
|
|
|
|
printInfoObj,
|
|
|
|
CefString(url),
|
|
|
|
CefString(title),
|
|
|
|
currentPage,
|
|
|
|
maxPages,
|
|
|
|
topLeftStr,
|
|
|
|
topCenterStr,
|
|
|
|
topRightStr,
|
|
|
|
bottomLeftStr,
|
|
|
|
bottomCenterStr,
|
2011-05-20 16:42:25 +02:00
|
|
|
bottomRightStr);
|
2011-12-08 02:38:30 +01:00
|
|
|
|
|
|
|
// Return type: bool
|
|
|
|
return _retval;
|
2011-05-20 16:42:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2011-12-08 02:38:30 +01:00
|
|
|
|
2011-05-20 16:42:25 +02:00
|
|
|
// CONSTRUCTOR - Do not edit by hand.
|
|
|
|
|
|
|
|
CefPrintHandlerCppToC::CefPrintHandlerCppToC(CefPrintHandler* cls)
|
|
|
|
: CefCppToC<CefPrintHandlerCppToC, CefPrintHandler, cef_print_handler_t>(
|
|
|
|
cls)
|
|
|
|
{
|
|
|
|
struct_.struct_.get_print_options = print_handler_get_print_options;
|
|
|
|
struct_.struct_.get_print_header_footer =
|
|
|
|
print_handler_get_print_header_footer;
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifndef NDEBUG
|
|
|
|
template<> long CefCppToC<CefPrintHandlerCppToC, CefPrintHandler,
|
|
|
|
cef_print_handler_t>::DebugObjCt = 0;
|
|
|
|
#endif
|
|
|
|
|