1
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
2
/* Copyright (C) 2001-2004 Novell, Inc. */
4
#ifndef __E2K_PROPERTIES_H__
5
#define __E2K_PROPERTIES_H__
8
#include <libxml/tree.h>
10
typedef struct E2kProperties E2kProperties;
13
E2K_PROP_TYPE_UNKNOWN,
17
E2K_PROP_TYPE_STRING_ARRAY,
18
E2K_PROP_TYPE_BINARY_ARRAY,
21
/* These are all stored as STRING or STRING_ARRAY */
23
E2K_PROP_TYPE_INT_ARRAY,
29
#define E2K_PROP_TYPE_IS_ARRAY(type) (((type) == E2K_PROP_TYPE_STRING_ARRAY) || ((type) == E2K_PROP_TYPE_BINARY_ARRAY) || ((type) == E2K_PROP_TYPE_INT_ARRAY))
31
E2kProperties *e2k_properties_new (void);
32
E2kProperties *e2k_properties_copy (E2kProperties *props);
33
void e2k_properties_free (E2kProperties *props);
35
gpointer e2k_properties_get_prop (E2kProperties *props,
36
const gchar *propname);
37
gboolean e2k_properties_empty (E2kProperties *props);
39
void e2k_properties_set_string (E2kProperties *props,
40
const gchar *propname,
42
void e2k_properties_set_string_array (E2kProperties *props,
43
const gchar *propname,
45
void e2k_properties_set_binary (E2kProperties *props,
46
const gchar *propname,
48
void e2k_properties_set_binary_array (E2kProperties *props,
49
const gchar *propname,
51
void e2k_properties_set_int (E2kProperties *props,
52
const gchar *propname,
54
void e2k_properties_set_int_array (E2kProperties *props,
55
const gchar *propname,
57
void e2k_properties_set_xml (E2kProperties *props,
58
const gchar *propname,
60
void e2k_properties_set_bool (E2kProperties *props,
61
const gchar *propname,
63
void e2k_properties_set_float (E2kProperties *props,
64
const gchar *propname,
66
void e2k_properties_set_date (E2kProperties *props,
67
const gchar *propname,
70
void e2k_properties_set_type_as_string (E2kProperties *props,
71
const gchar *propname,
74
void e2k_properties_set_type_as_string_array (E2kProperties *props,
75
const gchar *propname,
79
void e2k_properties_remove (E2kProperties *props,
80
const gchar *propname);
82
typedef void (*E2kPropertiesForeachFunc) (const gchar *propname,
86
void e2k_properties_foreach (E2kProperties *props,
87
E2kPropertiesForeachFunc callback,
89
void e2k_properties_foreach_removed (E2kProperties *props,
90
E2kPropertiesForeachFunc callback,
93
typedef void(*E2kPropertiesForeachNamespaceFunc)(const gchar *namespace,
96
void e2k_properties_foreach_namespace (E2kProperties *props,
97
E2kPropertiesForeachNamespaceFunc callback,
100
const gchar *e2k_prop_namespace_name (const gchar *prop);
101
gchar e2k_prop_namespace_abbrev (const gchar *prop);
102
const gchar *e2k_prop_property_name (const gchar *prop);
104
guint32 e2k_prop_proptag (const gchar *prop);
105
const gchar *e2k_proptag_prop (guint32 proptag);
107
#define E2K_PROPTAG_TYPE(proptag) (proptag & 0xFFFF)
108
#define E2K_PROPTAG_ID(proptag) (proptag & 0xFFFF0000)
110
#define E2K_PT_SHORT 0x0002
111
#define E2K_PT_LONG 0x0003
112
#define E2K_PT_ERROR 0x000a
113
#define E2K_PT_BOOLEAN 0x000b
114
#define E2K_PT_OBJECT 0x000d
115
#define E2K_PT_LONGLONG 0x0014
116
#define E2K_PT_STRING8 0x001e
117
#define E2K_PT_UNICODE 0x001f
118
#define E2K_PT_SYSTIME 0x0040
119
#define E2K_PT_BINARY 0x0102
121
#endif /* __E2K_PROPERTIES_H__ */