1/*
2 * Copyright (C) 2012 Igalia S.L.
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
13 *
14 * You should have received a copy of the GNU Library General Public License
15 * along with this library; see the file COPYING.LIB. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18 */
19
20#if !defined(__WEBKIT2_H_INSIDE__) && !defined(WEBKIT2_COMPILATION)
21#error "Only <webkit2/webkit2.h> can be included directly."
22#endif
23
24#ifndef WebKitPrintOperation_h
25#define WebKitPrintOperation_h
26
27#include <glib-object.h>
28#include <webkit2/WebKitDefines.h>
29#include <webkit2/WebKitForwardDeclarations.h>
30#include <webkit2/WebKitWebView.h>
31
32G_BEGIN_DECLS
33
34#define WEBKIT_TYPE_PRINT_OPERATION (webkit_print_operation_get_type())
35#define WEBKIT_PRINT_OPERATION(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_TYPE_PRINT_OPERATION, WebKitPrintOperation))
36#define WEBKIT_IS_PRINT_OPERATION(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_TYPE_PRINT_OPERATION))
37#define WEBKIT_PRINT_OPERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WEBKIT_TYPE_PRINT_OPERATION, WebKitPrintOperationClass))
38#define WEBKIT_IS_PRINT_OPERATION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_TYPE_PRINT_OPERATION))
39#define WEBKIT_PRINT_OPERATION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WEBKIT_TYPE_PRINT_OPERATION, WebKitPrintOperationClass))
40
41typedef struct _WebKitPrintOperationClass WebKitPrintOperationClass;
42typedef struct _WebKitPrintOperationPrivate WebKitPrintOperationPrivate;
43
44/**
45 * WebKitPrintOperationResponse:
46 * @WEBKIT_PRINT_OPERATION_RESPONSE_PRINT: Print button was clicked in print dialog
47 * @WEBKIT_PRINT_OPERATION_RESPONSE_CANCEL: Print dialog was cancelled
48 *
49 * Enum values representing the response of the print dialog shown with
50 * webkit_print_operation_run_dialog().
51 */
52typedef enum {
53 WEBKIT_PRINT_OPERATION_RESPONSE_PRINT,
54 WEBKIT_PRINT_OPERATION_RESPONSE_CANCEL
55} WebKitPrintOperationResponse;
56
57struct _WebKitPrintOperation {
58 GObject parent;
59
60 WebKitPrintOperationPrivate *priv;
61};
62
63struct _WebKitPrintOperationClass {
64 GObjectClass parent_class;
65
66 void (*_webkit_reserved0) (void);
67 void (*_webkit_reserved1) (void);
68 void (*_webkit_reserved2) (void);
69 void (*_webkit_reserved3) (void);
70};
71
72WEBKIT_API GType
73webkit_print_operation_get_type (void);
74
75WEBKIT_API WebKitPrintOperation *
76webkit_print_operation_new (WebKitWebView *web_view);
77
78WEBKIT_API GtkPrintSettings *
79webkit_print_operation_get_print_settings (WebKitPrintOperation *print_operation);
80
81WEBKIT_API void
82webkit_print_operation_set_print_settings (WebKitPrintOperation *print_operation,
83 GtkPrintSettings *print_settings);
84
85WEBKIT_API GtkPageSetup *
86webkit_print_operation_get_page_setup (WebKitPrintOperation *print_operation);
87
88WEBKIT_API void
89webkit_print_operation_set_page_setup (WebKitPrintOperation *print_operation,
90 GtkPageSetup *page_setup);
91
92WEBKIT_API WebKitPrintOperationResponse
93webkit_print_operation_run_dialog (WebKitPrintOperation *print_operation,
94 GtkWindow *parent);
95
96WEBKIT_API void
97webkit_print_operation_print (WebKitPrintOperation *print_operation);
98
99G_END_DECLS
100
101#endif
102