2001-12-21 Lutz Müller <urc8@rz.uni-karlsruhe.de>
[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 typedef struct _ExifContent        ExifContent;
25 typedef struct _ExifContentPrivate ExifContentPrivate;
26
27 #include <libexif/exif-tag.h>
28 #include <libexif/exif-entry.h>
29 #include <libexif/exif-utils.h>
30
31 struct _ExifContent {
32         ExifByteOrder order;
33
34         ExifEntry **entries;
35         unsigned int count;
36
37         ExifEntry *parent;
38
39         ExifContentPrivate *priv;
40 };
41
42 /* Lifecycle */
43 ExifContent *exif_content_new   (void);
44 void         exif_content_ref   (ExifContent *content);
45 void         exif_content_unref (ExifContent *content);
46 void         exif_content_free  (ExifContent *content);
47
48 /* Notification */
49 typedef enum _ExifContentEvent ExifContentEvent;
50 enum _ExifContentEvent {
51         EXIF_CONTENT_EVENT_ADD    = 1 << 0,
52         EXIF_CONTENT_EVENT_REMOVE = 1 << 1
53 };
54 typedef void (* ExifContentNotifyFunc)  (ExifContent *content,
55                                          ExifEntry *entry, void *data);
56 unsigned int exif_content_add_notify    (ExifContent *content,
57                                          ExifContentEvent events,
58                                          ExifContentNotifyFunc func,
59                                          void *data);
60 void         exif_content_remove_notify (ExifContent *content,
61                                          unsigned int id);
62
63 void         exif_content_parse (ExifContent *content,
64                                  const unsigned char *data,
65                                  unsigned int size,
66                                  unsigned int offset, ExifByteOrder order);
67
68 void         exif_content_add_entry    (ExifContent *content, ExifEntry *e);
69 void         exif_content_remove_entry (ExifContent *content, ExifEntry *e);
70 ExifEntry   *exif_content_get_entry    (ExifContent *content, ExifTag tag);
71
72 void         exif_content_dump  (ExifContent *content, unsigned int indent);
73
74 #endif /* __EXIF_CONTENT_H__ */