1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /* camel-object.h: Base class for Camel */
5 * Dan Winship <danw@ximian.com>
6 * Michael Zucchi <notzed@ximian.com>
8 * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of version 2 of the GNU Lesser General Public
12 * License as published by the Free Software Foundation.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
25 #if !defined (__CAMEL_H_INSIDE__) && !defined (CAMEL_COMPILATION)
26 #error "Only <camel/camel.h> can be included directly."
29 #ifndef CAMEL_OBJECT_H
30 #define CAMEL_OBJECT_H
32 #include <stdio.h> /* FILE */
33 #include <stdlib.h> /* gsize */
37 /* Standard GObject macros */
38 #define CAMEL_TYPE_OBJECT \
39 (camel_object_get_type ())
40 #define CAMEL_OBJECT(obj) \
41 (G_TYPE_CHECK_INSTANCE_CAST \
42 ((obj), CAMEL_TYPE_OBJECT, CamelObject))
43 #define CAMEL_OBJECT_CLASS(cls) \
44 (G_TYPE_CHECK_CLASS_CAST \
45 ((cls), CAMEL_TYPE_OBJECT, CamelObjectClass))
46 #define CAMEL_IS_OBJECT(obj) \
47 (G_TYPE_CHECK_INSTANCE_TYPE \
48 ((obj), CAMEL_TYPE_OBJECT))
49 #define CAMEL_IS_OBJECT_CLASS(cls) \
50 (G_TYPE_CHECK_CLASS_TYPE \
51 ((cls), CAMEL_TYPE_OBJECT))
52 #define CAMEL_OBJECT_GET_CLASS(obj) \
53 (G_TYPE_INSTANCE_GET_CLASS \
54 ((obj), CAMEL_TYPE_OBJECT, CamelObjectClass))
62 (camel_error_quark ())
66 typedef struct _CamelObject CamelObject;
67 typedef struct _CamelObjectClass CamelObjectClass;
68 typedef struct _CamelObjectPrivate CamelObjectPrivate;
72 * @CAMEL_PARAM_PERSISTENT:
73 * The parameter is persistent, which means its value is saved to
74 * #CamelObject:state-filename during camel_object_state_write(),
75 * and restored during camel_object_state_read().
77 * These flags extend #GParamFlags. Most of the time you will use them
78 * in conjunction with g_object_class_install_property().
83 CAMEL_PARAM_PERSISTENT = 1 << (G_PARAM_USER_SHIFT + 0)
92 CAMEL_ERROR_GENERIC /* lazy fallback error */
97 CamelObjectPrivate *priv;
100 struct _CamelObjectClass {
101 GObjectClass parent_class;
103 gint (*state_read) (CamelObject *object,
105 gint (*state_write) (CamelObject *object,
109 GType camel_object_get_type (void);
110 GQuark camel_error_quark (void) G_GNUC_CONST;
111 gint camel_object_state_read (CamelObject *object);
112 gint camel_object_state_write (CamelObject *object);
113 const gchar * camel_object_get_state_filename (CamelObject *object);
114 void camel_object_set_state_filename (CamelObject *object,
115 const gchar *state_filename);
119 #endif /* CAMEL_OBJECT_H */