]> www.fi.muni.cz Git - evince.git/blob - libdocument/ev-file-helpers.h
adec69c35b23b4d1004eedb5c801966bfd0840c1
[evince.git] / libdocument / ev-file-helpers.h
1 /*
2  *  Copyright (C) 2002 Jorn Baayen
3  *
4  *  This program is free software; you can redistribute it and/or modify
5  *  it under the terms of the GNU General Public License as published by
6  *  the Free Software Foundation; either version 2, or (at your option)
7  *  any later version.
8  *
9  *  This program 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
12  *  GNU General Public License for more details.
13  *
14  *  You should have received a copy of the GNU General Public License
15  *  along with this program; if not, write to the Free Software
16  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17  *
18  *  $Id$
19  */
20
21 #if !defined (__EV_EVINCE_DOCUMENT_H_INSIDE__) && !defined (EVINCE_COMPILATION)
22 #error "Only <evince-document.h> can be included directly."
23 #endif
24
25 #ifndef EV_FILE_HELPERS_H
26 #define EV_FILE_HELPERS_H
27
28 #include <glib.h>
29 #include <gio/gio.h>
30
31 G_BEGIN_DECLS
32
33 typedef enum {
34         EV_COMPRESSION_NONE,
35         EV_COMPRESSION_BZIP2,
36         EV_COMPRESSION_GZIP
37 } EvCompressionType;
38
39 const gchar *ev_tmp_dir               (void);
40
41 void        _ev_file_helpers_init     (void);
42
43 void        _ev_file_helpers_shutdown (void);
44
45 gboolean     ev_dir_ensure_exists     (const gchar       *dir,
46                                        int                mode);
47
48 GFile       *ev_tmp_file_get          (const gchar       *prefix);
49 gchar       *ev_tmp_filename          (const char        *prefix);
50 void         ev_tmp_filename_unlink   (const gchar       *filename);
51 void         ev_tmp_file_unlink       (GFile             *file);
52 void         ev_tmp_uri_unlink        (const gchar       *uri);
53
54 gboolean     ev_xfer_uri_simple       (const char        *from,
55                                        const char        *to,
56                                        GError           **error);
57
58 gchar       *ev_file_get_mime_type    (const gchar       *uri,
59                                        gboolean           fast,
60                                        GError           **error);
61
62 gchar       *ev_file_uncompress       (const gchar       *uri,
63                                        EvCompressionType  type,
64                                        GError           **error);
65 gchar       *ev_file_compress         (const gchar       *uri,
66                                        EvCompressionType  type,
67                                        GError           **error);
68
69
70 G_END_DECLS
71
72 #endif /* EV_FILE_HELPERS_H */