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 | |
32 | G_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 | |
41 | typedef struct _WebKitPrintOperationClass WebKitPrintOperationClass; |
42 | typedef 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 | */ |
52 | typedef enum { |
53 | WEBKIT_PRINT_OPERATION_RESPONSE_PRINT, |
54 | WEBKIT_PRINT_OPERATION_RESPONSE_CANCEL |
55 | } WebKitPrintOperationResponse; |
56 | |
57 | struct _WebKitPrintOperation { |
58 | GObject parent; |
59 | |
60 | WebKitPrintOperationPrivate *priv; |
61 | }; |
62 | |
63 | struct _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 | |
72 | WEBKIT_API GType |
73 | webkit_print_operation_get_type (void); |
74 | |
75 | WEBKIT_API WebKitPrintOperation * |
76 | webkit_print_operation_new (WebKitWebView *web_view); |
77 | |
78 | WEBKIT_API GtkPrintSettings * |
79 | webkit_print_operation_get_print_settings (WebKitPrintOperation *print_operation); |
80 | |
81 | WEBKIT_API void |
82 | webkit_print_operation_set_print_settings (WebKitPrintOperation *print_operation, |
83 | GtkPrintSettings *print_settings); |
84 | |
85 | WEBKIT_API GtkPageSetup * |
86 | webkit_print_operation_get_page_setup (WebKitPrintOperation *print_operation); |
87 | |
88 | WEBKIT_API void |
89 | webkit_print_operation_set_page_setup (WebKitPrintOperation *print_operation, |
90 | GtkPageSetup *page_setup); |
91 | |
92 | WEBKIT_API WebKitPrintOperationResponse |
93 | webkit_print_operation_run_dialog (WebKitPrintOperation *print_operation, |
94 | GtkWindow *parent); |
95 | |
96 | WEBKIT_API void |
97 | webkit_print_operation_print (WebKitPrintOperation *print_operation); |
98 | |
99 | G_END_DECLS |
100 | |
101 | #endif |
102 | |