E2kProperties

## E2kProperties E2kProperties — WebDAV properties |

## Synopsis

    typedef             E2kProperties;
    E2kProperties *     e2k_properties_new                  (void);
    E2kProperties *     e2k_properties_copy                 (E2kProperties *props);
    gboolean            e2k_properties_empty                (E2kProperties *props);
    void                e2k_properties_free                 (E2kProperties *props);

    gpointer            e2k_properties_get_prop             (E2kProperties *props,
                                                             const gchar *propname);
    void                e2k_properties_remove               (E2kProperties *props,
                                                             const gchar *propname);

    enum                E2kPropType;
    #define             E2K_PROP_TYPE_IS_ARRAY              (type)
    void                e2k_properties_set_string           (E2kProperties *props,
                                                             const gchar *propname,
                                                             gchar *value);
    void                e2k_properties_set_string_array     (E2kProperties *props,
                                                             const gchar *propname,
                                                             GPtrArray *value);
    void                e2k_properties_set_binary           (E2kProperties *props,
                                                             const gchar *propname,
                                                             GByteArray *value);
    void                e2k_properties_set_binary_array     (E2kProperties *props,
                                                             const gchar *propname,
                                                             GPtrArray *value);
    void                e2k_properties_set_int              (E2kProperties *props,
                                                             const gchar *propname,
                                                             gint value);
    void                e2k_properties_set_int_array        (E2kProperties *props,
                                                             const gchar *propname,
                                                             GPtrArray *value);
    void                e2k_properties_set_xml              (E2kProperties *props,
                                                             const gchar *propname,
                                                             xmlNode *value);
    void                e2k_properties_set_bool             (E2kProperties *props,
                                                             const gchar *propname,
                                                             gboolean value);
    void                e2k_properties_set_float            (E2kProperties *props,
                                                             const gchar *propname,
                                                             gfloat value);
    void                e2k_properties_set_date             (E2kProperties *props,
                                                             const gchar *propname,
                                                             gchar *value);
    void                e2k_properties_set_type_as_string   (E2kProperties *props,
                                                             const gchar *propname,
                                                             E2kPropType type,
                                                             gchar *value);
    void                e2k_properties_set_type_as_string_array
                                                            (E2kProperties *props,
                                                             const gchar *propname,
                                                             E2kPropType type,
                                                             GPtrArray *value);

    void                (*E2kPropertiesForeachFunc)         (const gchar *propname,
                                                             E2kPropType type,
                                                             gpointer value,
                                                             gpointer user_data);
    void                e2k_properties_foreach              (E2kProperties *props,
                                                             E2kPropertiesForeachFunc callback,
                                                             gpointer user_data);
    void                e2k_properties_foreach_removed      (E2kProperties *props,
                                                             E2kPropertiesForeachFunc callback,
                                                             gpointer user_data);
    void                (*E2kPropertiesForeachNamespaceFunc)
                                                            (const gchar *namespace,
                                                             gchar abbrev,
                                                             gpointer user_data);
    void                e2k_properties_foreach_namespace    (E2kProperties *props,
                                                             E2kPropertiesForeachNamespaceFunc callback,
                                                             gpointer user_data);

    const gchar *       e2k_prop_namespace_name             (const gchar *prop);
    gchar               e2k_prop_namespace_abbrev           (const gchar *prop);
    const gchar *       e2k_prop_property_name              (const gchar *prop);

    guint32             e2k_prop_proptag                    (const gchar *prop);
    const gchar *       e2k_proptag_prop                    (guint32 proptag);
    #define             E2K_PROPTAG_TYPE                    (proptag)
    #define             E2K_PROPTAG_ID                      (proptag)

## Description

## Details

### E2kProperties

    typedef struct E2kProperties E2kProperties;

### e2k_properties_new ()

    E2kProperties *     e2k_properties_new                  (void);

Creates a new (empty) E2kProperties structure

Returns : | the structure

### e2k_properties_copy ()

    E2kProperties *     e2k_properties_copy                 (E2kProperties *props);

Performs a deep copy of `props`

`props` : | an E2kProperties
Returns : | a new copy of `props`

### e2k_properties_empty ()

    gboolean            e2k_properties_empty                (E2kProperties *props);

Tests if `props` is empty.

`props` : | an E2kProperties
Returns : | `TRUE` if `props` has no properties set, `FALSE` if it has at least one value set.

### e2k_properties_free ()

    void                e2k_properties_free                 (E2kProperties *props);

Frees `props` and all of the properties it contains.

`props` : | an E2kProperties

### e2k_properties_get_prop ()

    gpointer            e2k_properties_get_prop             (E2kProperties *props,
                                                             const gchar *propname);

Retrieves the value of `propname` in `props`.

`props` : | an E2kProperties
`propname` : | a property name
Returns : | the value of `propname` in `props`, or `NULL` if it is not set. The caller should not free the value; it is owned by `props`.

### e2k_properties_remove ()

    void                e2k_properties_remove               (E2kProperties *props,
                                                             const gchar *propname);

Marks `propname` removed in `props`, so that the corresponding property will be removed from the object on the server if `props` is used in a PROPPATCH. If the property was formerly set in `props`, this frees the old value.

`props` : | an E2kProperties
`propname` : | the name of a property

### enum E2kPropType

    typedef enum {
    	E2K_PROP_TYPE_UNKNOWN,

    	E2K_PROP_TYPE_STRING,
    	E2K_PROP_TYPE_BINARY,
    	E2K_PROP_TYPE_STRING_ARRAY,
    	E2K_PROP_TYPE_BINARY_ARRAY,
    	E2K_PROP_TYPE_XML,

    	/* These are all stored as STRING or STRING_ARRAY */
    	E2K_PROP_TYPE_INT,
    	E2K_PROP_TYPE_INT_ARRAY,
    	E2K_PROP_TYPE_BOOL,
    	E2K_PROP_TYPE_FLOAT,
    	E2K_PROP_TYPE_DATE
    } E2kPropType;

### E2K_PROP_TYPE_IS_ARRAY()

    #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))

### e2k_properties_set_string ()

    void                e2k_properties_set_string           (E2kProperties *props,
                                                             const gchar *propname,
                                                             gchar *value);

Sets `propname` in `props` to `value`. `props` assumes ownership of `value`.

`props` : | an E2kProperties
`propname` : | the name of a property
`value` : | an allocated string

### e2k_properties_set_string_array ()

    void                e2k_properties_set_string_array     (E2kProperties *props,
                                                             const gchar *propname,
                                                             GPtrArray *value);

Sets `propname` in `props` to `value`. `props` assumes ownership of `value`.

`props` : | an E2kProperties
`propname` : | the name of a property
`value` : | an array of allocated strings

### e2k_properties_set_binary ()

    void                e2k_properties_set_binary           (E2kProperties *props,
                                                             const gchar *propname,
                                                             GByteArray *value);

Sets `propname` in `props` to `value`. `props` assumes ownership of `value`.

`props` : | an E2kProperties
`propname` : | the name of a property
`value` : | a byte array

### e2k_properties_set_binary_array ()

    void                e2k_properties_set_binary_array     (E2kProperties *props,
                                                             const gchar *propname,
                                                             GPtrArray *value);

Sets `propname` in `props` to `value`. `props` assumes ownership of `value`.

`props` : | an E2kProperties
`propname` : | the name of a property
`value` : | an array of byte arrays

### e2k_properties_set_int ()

    void                e2k_properties_set_int              (E2kProperties *props,
                                                             const gchar *propname,
                                                             gint value);

Sets `propname` in `props` to `value`.

`props` : | an E2kProperties
`propname` : | the name of a property
`value` : | an integer

### e2k_properties_set_int_array ()

    void                e2k_properties_set_int_array        (E2kProperties *props,
                                                             const gchar *propname,
                                                             GPtrArray *value);

Sets `propname` in `props` to `value`. `props` assumes ownership of `value`.

`props` : | an E2kProperties
`propname` : | the name of a property
`value` : | an array of integers

### e2k_properties_set_xml ()

    void                e2k_properties_set_xml              (E2kProperties *props,
                                                             const gchar *propname,
                                                             xmlNode *value);

Sets `propname` in `props` to `value`. `props` assumes ownership of `value`.

`props` : | an E2kProperties
`propname` : | the name of a property
`value` : | an xmlNode

### e2k_properties_set_bool ()

    void                e2k_properties_set_bool             (E2kProperties *props,
                                                             const gchar *propname,
                                                             gboolean value);

Sets `propname` in `props` to `value`.

`props` : | an E2kProperties
`propname` : | the name of a property
`value` : | a boolean value

### e2k_properties_set_float ()

    void                e2k_properties_set_float            (E2kProperties *props,
                                                             const gchar *propname,
                                                             gfloat value);

Sets `propname` in `props` to `value`.

`props` : | an E2kProperties
`propname` : | the name of a property
`value` : | a floating-point value

### e2k_properties_set_date ()

    void                e2k_properties_set_date             (E2kProperties *props,
                                                             const gchar *propname,
                                                             gchar *value);

Sets `propname` in `props` to `value`. `props` assumes ownership of `value`.

`props` : | an E2kProperties
`propname` : | the name of a property
`value` : | an allocated string containing an Exchange timestamp

### e2k_properties_set_type_as_string ()

    void                e2k_properties_set_type_as_string   (E2kProperties *props,
                                                             const gchar *propname,
                                                             E2kPropType type,
                                                             gchar *value);

Sets `propname` in `props` to `value`, but with type `type`. `props` assumes ownership of `value`.

`props` : | an E2kProperties
`propname` : | the name of a property
`type` : | the type of `value`
`value` : | an allocated string

### e2k_properties_set_type_as_string_array ()

    void                e2k_properties_set_type_as_string_array
                                                            (E2kProperties *props,
                                                             const gchar *propname,
                                                             E2kPropType type,
                                                             GPtrArray *value);

Sets `propname` in `props` to `value`, but with type `type`. `props` assumes ownership of `value`.

`props` : | an E2kProperties
`propname` : | the name of a property
`type` : | the type of `value`
`value` : | an array of allocated strings

### E2kPropertiesForeachFunc ()

    void                (*E2kPropertiesForeachFunc)         (const gchar *propname,
                                                             E2kPropType type,
                                                             gpointer value,
                                                             gpointer user_data);

### e2k_properties_foreach ()

    void                e2k_properties_foreach              (E2kProperties *props,
                                                             E2kPropertiesForeachFunc callback,
                                                             gpointer user_data);

Calls `callback` once for each property that is set in `props` (in unspecified order), passing it the name of the property, the property's type, its value, and `user_data`.

`props` : | an E2kProperties
`callback` : | callback function to call for each set property
`user_data` : | data to pass to `callback`

### e2k_properties_foreach_removed ()

    void                e2k_properties_foreach_removed      (E2kProperties *props,
                                                             E2kPropertiesForeachFunc callback,
                                                             gpointer user_data);

Calls `callback` once for each property marked removed in `props` (in unspecified order), passing it the name of the property, the property's type (if known), a `NULL` value, and `user_data`.

`props` : | an E2kProperties
`callback` : | callback function to call for each set property
`user_data` : | data to pass to `callback`

### E2kPropertiesForeachNamespaceFunc ()

    void                (*E2kPropertiesForeachNamespaceFunc)
                                                            (const gchar *namespace,
                                                             gchar abbrev,
                                                             gpointer user_data);

### e2k_properties_foreach_namespace ()

    void                e2k_properties_foreach_namespace    (E2kProperties *props,
                                                             E2kPropertiesForeachNamespaceFunc callback,
                                                             gpointer user_data);

Calls `callback` once for each unique namespace used by the properties (set or removed) in `props`, passing it the name of the namespace, its standard abbreviation, and `user_data`.

`props` : | an E2kProperties
`callback` : | callback function to call for each namespace
`user_data` : | data to pass to `callback`

### e2k_prop_namespace_name ()

    const gchar *       e2k_prop_namespace_name             (const gchar *prop);

Splits out the namespace portion of `prop`

`prop` : | the name of a property
Returns : | the URI of `prop`'s namespace

### e2k_prop_namespace_abbrev ()

    gchar               e2k_prop_namespace_abbrev           (const gchar *prop);

Splits out the namespace portion of `prop` and assigns a unique abbreviation for it.

`prop` : | the name of a property
Returns : | the abbreviation used for prop's namespace

### e2k_prop_property_name ()

    const gchar *       e2k_prop_property_name              (const gchar *prop);

Splits out the non-namespace portion of `prop`

`prop` : | the name of a property
Returns : | the non-namespaced name of `prop`

### e2k_prop_proptag ()

    guint32             e2k_prop_proptag                    (const gchar *prop);

Computes the MAPI proptag value of `prop`, which must be the name of a MAPI property.

`prop` : | the name of a MAPI property
Returns : | the MAPI proptag value

### e2k_proptag_prop ()

    const gchar *       e2k_proptag_prop                    (guint32 proptag);

Computes the WebDAV property name of the property with the given proptag.

`proptag` : | a MAPI property
Returns : | the WebDAV property name associated with `proptag`

### E2K_PROPTAG_TYPE()

    #define E2K_PROPTAG_TYPE(proptag) (proptag & 0xFFFF)

### E2K_PROPTAG_ID()

    #define E2K_PROPTAG_ID(proptag) (proptag & 0xFFFF0000)