1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 
3 /*
4  *  File-Roller
5  *
6  *  Copyright (C) 2003 Free Software Foundation, Inc.
7  *
8  *  This program is free software; you can redistribute it and/or modify
9  *  it under the terms of the GNU General Public License as published by
10  *  the Free Software Foundation; either version 2 of the License, or
11  *  (at your option) any later version.
12  *
13  *  This program is distributed in the hope that it will be useful,
14  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  *  GNU General Public License for more details.
17  *
18  *  You should have received a copy of the GNU General Public License
19  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
20  */
21 
22 #ifndef __FR_ERROR_H__
23 #define __FR_ERROR_H__
24 
25 #include <glib.h>
26 #include <glib-object.h>
27 
28 #define FR_ERROR fr_error_quark ()
29 #define FR_TYPE_ERROR (fr_error_get_type ())
30 
31 typedef enum { /*< skip >*/
32 	FR_ERROR_NONE,
33 	FR_ERROR_GENERIC,
34 	FR_ERROR_COMMAND_ERROR,
35 	FR_ERROR_COMMAND_NOT_FOUND,
36 	FR_ERROR_EXITED_ABNORMALLY,
37 	FR_ERROR_SPAWN,
38 	FR_ERROR_STOPPED,
39 	FR_ERROR_ASK_PASSWORD,
40 	FR_ERROR_MISSING_VOLUME,
41 	FR_ERROR_IO_CHANNEL,
42 	FR_ERROR_BAD_CHARSET,
43 	FR_ERROR_UNSUPPORTED_FORMAT
44 } FrErrorType;
45 
46 typedef struct {
47 	GError      *gerror;
48 	FrErrorType  type;
49 	int          status;
50 } FrError;
51 
52 GQuark     fr_error_quark          (void);
53 GType      fr_error_get_type       (void);
54 FrError *  fr_error_new            (FrErrorType   type,
55 		 		    int           status,
56 			 	    GError       *gerror);
57 FrError *  fr_error_copy           (FrError      *error);
58 void       fr_error_free           (FrError      *error);
59 void       fr_error_set            (FrError      *error,
60 				    FrErrorType   type,
61 				    int           status,
62 				    GError       *gerror);
63 void       fr_error_take_gerror    (FrError      *error,
64 				    GError       *gerror);
65 void       fr_error_clear_gerror   (FrError      *error);
66 void       fr_clear_error          (FrError     **error);
67 
68 #endif /* __FR_ERROR_H__ */
69