]> www.fi.muni.cz Git - evince.git/blob - libdocument/ev-file-helpers.h
Add functions to delete temporary files created by evince in a safe way.
[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 #ifndef EPHY_FILE_HELPERS_H
22 #define EPHY_FILE_HELPERS_H
23
24 #include <glib.h>
25
26 G_BEGIN_DECLS
27
28 typedef enum {
29         EV_COMPRESSION_NONE,
30         EV_COMPRESSION_BZIP2,
31         EV_COMPRESSION_GZIP
32 } EvCompressionType;
33
34 const gchar *ev_dot_dir               (void);
35
36 const gchar *ev_tmp_dir               (void);
37
38 void         ev_file_helpers_init     (void);
39
40 void         ev_file_helpers_shutdown (void);
41
42 gchar       *ev_tmp_filename          (const char        *prefix);
43 void         ev_tmp_filename_unlink   (const gchar       *filename);
44 void         ev_tmp_uri_unlink        (const gchar       *uri);
45
46 gboolean     ev_xfer_uri_simple       (const char        *from,
47                                        const char        *to,
48                                        GError           **error);
49
50 gchar       *ev_file_uncompress       (const gchar       *uri,
51                                        EvCompressionType  type,
52                                        GError           **error);
53 gchar       *ev_file_compress         (const gchar       *uri,
54                                        EvCompressionType  type,
55                                        GError           **error);
56
57
58 G_END_DECLS
59
60 #endif /* EPHY_FILE_HELPERS_H */