source: trunk/Source/WebKit2/UIProcess/API/gtk/webkit2.h @ 107947

Revision 107947, 1.6 KB checked in by carlosgc@webkit.org, 3 years ago (diff)

[GTK] Add WebKitPrintOperation to WebKit2 GTK+ API
https://bugs.webkit.org/show_bug.cgi?id=76448

Reviewed by Martin Robinson.

  • GNUmakefile.am: Add new files to compilation.
  • UIProcess/API/gtk/WebKitDefines.h:
  • UIProcess/API/gtk/WebKitPrintOperation.cpp: Added.

(webViewDestroyed): Delete the print operation when the view
widget associated is destroyed.
(webkitPrintOperationConstructed): Connect to destroy signal of
associated web view.
(webkitPrintOperationGetProperty):
(webkitPrintOperationSetProperty):
(webkit_print_operation_init):
(webkit_print_operation_class_init):
(webkitPrintOperationRunDialogUnix): Use GtkPrintUnixDialog to
show the printing dialog in UNIX platforms.
(webkitPrintOperationRunDialogWin32): Empty, not implemented yet.
(drawPagesForPrintingCompleted): Callback called when printing
operation has finished in the web process.
(webkitPrintOperationRunDialogForFrame): Run the printing dialog
and start printing the given frame.
(webkit_print_operation_new): Create a new print operation for the
given web view.
(webkit_print_operation_get_print_settings):
(webkit_print_operation_set_print_settings):
(webkit_print_operation_get_page_setup):
(webkit_print_operation_set_page_setup):
(webkit_print_operation_run_dialog): Run the print dialog to print
the web view main frame.

  • UIProcess/API/gtk/WebKitPrintOperation.h: Added.
  • UIProcess/API/gtk/WebKitPrintOperationPrivate.h: Added.
  • UIProcess/API/gtk/WebKitUIClient.cpp:

(printFrame): Call webkitWebViewPrintFrame.
(attachUIClientToView): Add implementation for
printFrame callback.

  • UIProcess/API/gtk/WebKitWebView.cpp:

(webkit_web_view_class_init): Add WebKitWebView::print-requested
signal.
(webkitWebViewPrintFrame): Emit print-requested and show the print
dialog to print the frame when not signal is not handled by user.

  • UIProcess/API/gtk/WebKitWebView.h:
  • UIProcess/API/gtk/WebKitWebViewPrivate.h:
  • UIProcess/API/gtk/docs/webkit2gtk-docs.sgml: Add new section for

WebKitPrintOperation.

  • UIProcess/API/gtk/docs/webkit2gtk-sections.txt: Add new symbols.
  • UIProcess/API/gtk/tests/GNUmakefile.am:
  • UIProcess/API/gtk/tests/TestPrinting.cpp: Added.

(testPrintOperationPrintSettings):
(webViewPrintRequestedCallback):
(testWebViewPrintRequested):
(beforeAll):
(afterAll):

  • UIProcess/API/gtk/webkit2.h: Include WebKitPrintOperation.h.
  • Property svn:eol-style set to native
Line 
1/*
2 * Copyright (C) 2011 Igalia S.L.
3 * Portions Copyright (c) 2011 Motorola Mobility, Inc.  All rights reserved.
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 * Library General Public License for more details.
14 *
15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB.  If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19 */
20
21#ifndef __WEBKIT2_H__
22#define __WEBKIT2_H__
23
24#define __WEBKIT2_H_INSIDE__
25
26#include <webkit2/WebKitBackForwardList.h>
27#include <webkit2/WebKitBackForwardListItem.h>
28#include <webkit2/WebKitDefines.h>
29#include <webkit2/WebKitDownload.h>
30#include <webkit2/WebKitEditingCommands.h>
31#include <webkit2/WebKitEnumTypes.h>
32#include <webkit2/WebKitError.h>
33#include <webkit2/WebKitHitTestResult.h>
34#include <webkit2/WebKitPrintOperation.h>
35#include <webkit2/WebKitSettings.h>
36#include <webkit2/WebKitURIRequest.h>
37#include <webkit2/WebKitURIResponse.h>
38#include <webkit2/WebKitWebContext.h>
39#include <webkit2/WebKitWebViewBase.h>
40#include <webkit2/WebKitWebView.h>
41#include <webkit2/WebKitWindowProperties.h>
42
43#undef __WEBKIT2_H_INSIDE__
44
45#endif /* __WEBKIT2_H__ */
Note: See TracBrowser for help on using the repository browser.