2002-04-18 Lutz Müller <lutz@users.sourceforge.net>
[platform/upstream/libexif.git] / libexif / exif-content.h
1 /* exif-content.h
2  *
3  * Copyright (C) 2001 Lutz Müller <lutz@users.sourceforge.net>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful, 
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of 
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details. 
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18  * Boston, MA 02111-1307, USA.
19  */
20
21 #ifndef __EXIF_CONTENT_H__
22 #define __EXIF_CONTENT_H__
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif /* __cplusplus */
27
28 typedef struct _ExifContent        ExifContent;
29 typedef struct _ExifContentPrivate ExifContentPrivate;
30
31 #include <libexif/exif-tag.h>
32 #include <libexif/exif-entry.h>
33 #include <libexif/exif-data.h>
34
35 struct _ExifContent
36 {
37         ExifEntry **entries;
38         unsigned int count;
39
40         /* Data containing this content */
41         ExifData *parent;
42
43         ExifContentPrivate *priv;
44 };
45
46 /* Lifecycle */
47 ExifContent *exif_content_new   (void);
48 void         exif_content_ref   (ExifContent *content);
49 void         exif_content_unref (ExifContent *content);
50 void         exif_content_free  (ExifContent *content);
51
52 void         exif_content_add_entry     (ExifContent *content, ExifEntry *e);
53 void         exif_content_remove_entry  (ExifContent *content, ExifEntry *e);
54 ExifEntry   *exif_content_get_entry     (ExifContent *content, ExifTag tag);
55
56 typedef void (* ExifContentForeachEntryFunc) (ExifEntry *, void *user_data);
57 void         exif_content_foreach_entry (ExifContent *content,
58                                          ExifContentForeachEntryFunc func,
59                                          void *user_data);
60
61 /* For your convenience */
62 #define exif_content_get_value(c,t)                                     \
63         (exif_content_get_entry (c,t) ?                                 \
64          exif_entry_get_value (exif_content_get_entry (c,t)) : NULL)
65 #define exif_content_get_value_brief(c,t)                               \
66         (exif_content_get_entry (c,t) ?                                 \
67          exif_entry_get_value_brief (exif_content_get_entry (c,t)) : NULL)
68
69 void         exif_content_dump  (ExifContent *content, unsigned int indent);
70
71 #ifdef __cplusplus
72 }
73 #endif /* __cplusplus */
74
75 #endif /* __EXIF_CONTENT_H__ */