~ubuntu-branches/ubuntu/saucy/epiphany-browser/saucy

« back to all changes in this revision

Viewing changes to lib/ephy-snapshot-service.h

  • Committer: Package Import Robot
  • Author(s): Jeremy Bicha
  • Date: 2012-10-02 20:30:38 UTC
  • mfrom: (1.6.14)
  • Revision ID: package-import@ubuntu.com-20121002203038-ijw6x1x3vgv6tyi5
Tags: 3.6.0-0ubuntu1
* New upstream release (LP: #1033909)
  - New overview with most visited sites as start page (LP: #343397)
* Rename gir1.2-epiphany-3.4 -> gir1.2-epiphany-3.6
* debian/control.in:
  - Bump minimum webkit and libsoup
  - Drop build-depends on gnome-doc-utils and seed
  - Build-depend on gcr and gnome-desktop3
* debian/rules:
  - Copy Debian fix to rename epiphany.desktop to
    epiphany-browser.desktop so that the shell recognizes it.
* debian/patches/00_epiphany-browser.patch: Refreshed
* debian/patches/14_pkglibdir.patch:
  - Dropped, applied in new version

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 
2
/*
 
3
 *  Copyright © 2012 Igalia S.L.
 
4
 *
 
5
 *  This program is free software; you can redistribute it and/or modify
 
6
 *  it under the terms of the GNU General Public License as published by
 
7
 *  the Free Software Foundation; either version 2, or (at your option)
 
8
 *  any later version.
 
9
 *
 
10
 *  This program 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
 
13
 *  GNU General Public License for more details.
 
14
 *
 
15
 *  You should have received a copy of the GNU General Public License
 
16
 *  along with this program; if not, write to the Free Software
 
17
 *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
18
 *
 
19
 */
 
20
 
 
21
#ifndef _EPHY_SNAPSHOT_SERVICE_H
 
22
#define _EPHY_SNAPSHOT_SERVICE_H
 
23
 
 
24
#include <gtk/gtk.h>
 
25
#ifdef HAVE_WEBKIT2
 
26
#include <webkit2/webkit2.h>
 
27
#else
 
28
#include <webkit/webkit.h>
 
29
#endif
 
30
 
 
31
#include <glib-object.h>
 
32
 
 
33
G_BEGIN_DECLS
 
34
 
 
35
#define EPHY_TYPE_SNAPSHOT_SERVICE            (ephy_snapshot_service_get_type())
 
36
#define EPHY_SNAPSHOT_SERVICE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), EPHY_TYPE_SNAPSHOT_SERVICE, EphySnapshotService))
 
37
#define EPHY_SNAPSHOT_SERVICE_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), EPHY_TYPE_SNAPSHOT_SERVICE, EphySnapshotServiceClass))
 
38
#define EPHY_IS_SNAPSHOT_SERVICE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), EPHY_TYPE_SNAPSHOT_SERVICE))
 
39
#define EPHY_IS_SNAPSHOT_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), EPHY_TYPE_SNAPSHOT_SERVICE))
 
40
#define EPHY_SNAPSHOT_SERVICE_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), EPHY_TYPE_SNAPSHOT_SERVICE, EphySnapshotServiceClass))
 
41
 
 
42
#define EPHY_SNAPSHOT_SERVICE_ERROR           (ephy_snapshot_service_error_quark())
 
43
 
 
44
typedef struct _EphySnapshotService        EphySnapshotService;
 
45
typedef struct _EphySnapshotServiceClass   EphySnapshotServiceClass;
 
46
typedef struct _EphySnapshotServicePrivate EphySnapshotServicePrivate;
 
47
 
 
48
struct _EphySnapshotService
 
49
{
 
50
  GObject parent;
 
51
 
 
52
  /*< private >*/
 
53
  EphySnapshotServicePrivate *priv;
 
54
};
 
55
 
 
56
struct _EphySnapshotServiceClass
 
57
{
 
58
  GObjectClass parent_class;
 
59
};
 
60
 
 
61
typedef enum {
 
62
  EPHY_SNAPSHOT_SERVICE_ERROR_NOT_FOUND,
 
63
  EPHY_SNAPSHOT_SERVICE_ERROR_WEB_VIEW,
 
64
  EPHY_SNAPSHOT_SERVICE_ERROR_INVALID
 
65
} EphySnapshotServiceError;
 
66
 
 
67
/* Values taken from the Web mockups. */
 
68
#define EPHY_THUMBNAIL_WIDTH 180
 
69
#define EPHY_THUMBNAIL_HEIGHT 135
 
70
 
 
71
GType                ephy_snapshot_service_get_type                    (void) G_GNUC_CONST;
 
72
GQuark               ephy_snapshot_service_error_quark                 (void);
 
73
 
 
74
EphySnapshotService *ephy_snapshot_service_get_default                 (void);
 
75
 
 
76
void                 ephy_snapshot_service_get_snapshot_for_url_async  (EphySnapshotService *service,
 
77
                                                                        const char *url,
 
78
                                                                        const time_t mtime,
 
79
                                                                        GCancellable *cancellable,
 
80
                                                                        GAsyncReadyCallback callback,
 
81
                                                                        gpointer user_data);
 
82
 
 
83
GdkPixbuf           *ephy_snapshot_service_get_snapshot_for_url_finish (EphySnapshotService *service,
 
84
                                                                        GAsyncResult *result,
 
85
                                                                        GError **error);
 
86
 
 
87
void                 ephy_snapshot_service_get_snapshot_async          (EphySnapshotService *service,
 
88
                                                                        WebKitWebView *web_view,
 
89
                                                                        const time_t mtime,
 
90
                                                                        GCancellable *cancellable,
 
91
                                                                        GAsyncReadyCallback callback,
 
92
                                                                        gpointer user_data);
 
93
 
 
94
GdkPixbuf           *ephy_snapshot_service_get_snapshot_finish         (EphySnapshotService *service,
 
95
                                                                        GAsyncResult *result,
 
96
                                                                        GError **error);
 
97
 
 
98
void                 ephy_snapshot_service_save_snapshot_async         (EphySnapshotService *service,
 
99
                                                                        GdkPixbuf *snapshot,
 
100
                                                                        const char *url,
 
101
                                                                        time_t mtime,
 
102
                                                                        GCancellable *cancellable,
 
103
                                                                        GAsyncReadyCallback callback,
 
104
                                                                        gpointer user_data);
 
105
 
 
106
gboolean             ephy_snapshot_service_save_snapshot_finish        (EphySnapshotService *service,
 
107
                                                                        GAsyncResult *result,
 
108
                                                                        GError **error);
 
109
 
 
110
GdkPixbuf           *ephy_snapshot_service_crop_snapshot               (cairo_surface_t *surface);
 
111
 
 
112
G_END_DECLS
 
113
 
 
114
#endif /* _EPHY_SNAPSHOT_SERVICE_H */