File: pps-job.h

package info (click to toggle)
papers 49.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 21,140 kB
  • sloc: ansic: 37,721; sh: 197; xml: 127; makefile: 112
file content (62 lines) | stat: -rw-r--r-- 1,577 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// SPDX-License-Identifier: GPL-2.0-or-later
/* this file is part of papers, a gnome document viewer
 *
 *  Copyright (C) 2008 Carlos Garcia Campos <carlosgc@gnome.org>
 *  Copyright (C) 2005 Red Hat, Inc
 */

#pragma once

#include <libdocument/pps-macros.h>
#if !defined(__PPS_PAPERS_VIEW_H_INSIDE__) && !defined(PAPERS_COMPILATION)
#error "Only <papers-view.h> can be included directly."
#endif

#include <gio/gio.h>

#include <papers-document.h>

#define PPS_GET_TYPE_NAME(instance) g_type_name_from_instance ((gpointer) instance)

G_BEGIN_DECLS

#define PPS_TYPE_JOB (pps_job_get_type ())

PPS_PUBLIC
G_DECLARE_DERIVABLE_TYPE (PpsJob, pps_job, PPS, JOB, GObject)

struct _PpsJobClass {
	GObjectClass parent_class;

	void (*run) (PpsJob *job);

	/* Signals */
	void (*cancelled) (PpsJob *job);
	void (*finished) (PpsJob *job);
};

PPS_PUBLIC
void pps_job_run (PpsJob *job);
PPS_PUBLIC
void pps_job_cancel (PpsJob *job);
void pps_job_failed (PpsJob *job,
                     GQuark domain,
                     gint code,
                     const gchar *format,
                     ...) G_GNUC_PRINTF (4, 5);
void pps_job_failed_from_error (PpsJob *job,
                                GError *error);
void pps_job_succeeded (PpsJob *job);
PPS_PUBLIC
gboolean pps_job_is_finished (PpsJob *job);
PPS_PUBLIC
gboolean pps_job_is_succeeded (PpsJob *job,
                               GError **error);
PPS_PUBLIC
PpsDocument *pps_job_get_document (PpsJob *job);
GCancellable *pps_job_get_cancellable (PpsJob *job);

PPS_PUBLIC
void pps_job_reset (PpsJob *job);

G_END_DECLS