## RygelWritableContainer

RygelWritableContainer — This interface should be implemented by 'writable' containers - ones that allow adding (via upload), removal and editing of items directly under them. Currently, only addition and removal are supported.

## Functions

gboolean | rygel_writable_container_can_create ()
void | rygel_writable_container_add_item ()
void | rygel_writable_container_add_item_finish ()
void | rygel_writable_container_add_container ()
void | rygel_writable_container_add_container_finish ()
void | rygel_writable_container_add_reference ()
gchar * | rygel_writable_container_add_reference_finish ()
void | rygel_writable_container_remove_item ()
void | rygel_writable_container_remove_item_finish ()
void | rygel_writable_container_remove_container ()
void | rygel_writable_container_remove_container_finish ()
GeeArrayList * | rygel_writable_container_get_create_classes ()
void | rygel_writable_container_set_create_classes ()

## Properties

GeeArrayList * | create-classes | Read / Write

## Types and Values

enum | RygelWritableContainerError
#define | RYGEL_WRITABLE_CONTAINER_WRITABLE_SCHEME
| RygelWritableContainer
struct | RygelWritableContainerIface

## Object Hierarchy

        GInterface
        ╰── RygelWritableContainer

## Prerequisites

RygelWritableContainer requires RygelMediaContainer.

## Description

In addition to implementing this interface, a writable container must also:

1. Provide one URI that points to a writable folder on a GIO-supported filesystem.

2. Monitor not only its own URI but also that of its child items, though the latter is implied in the former if you use GIO for monitoring.

## Functions

### rygel_writable_container_can_create ()

    gboolean
    rygel_writable_container_can_create (RygelWritableContainer *self,
                                         const gchar *upnp_class);

Check if this container can contain an item with the given upnp class, meaning that `rygel_writable_container_add_item()` should succeed.

#### Parameters

self | the RygelWritableContainer instance |
upnp_class | . The upnp class of an item to check . | [in]

#### Returns

true if it can, false, if not.

### rygel_writable_container_add_item ()

    void
    rygel_writable_container_add_item (RygelWritableContainer *self,
                                       RygelMediaFileItem *item,
                                       GCancellable *cancellable,
                                       GAsyncReadyCallback _callback_,
                                       gpointer _user_data_);

Add a new item directly under this container.

The caller should not first create the file(s) pointed to by the item's URI(s). That is handled by the container class.

This method corresponds to the UPnP ContentDirectory's CreateObject action.

See also: `rygel_writable_container_add_item_finish()`

#### Parameters

self | the RygelWritableContainer instance |
item | . The item to add to this container . | [in]
cancellable | . optional cancellable for this operation . | [in][allow-none]
_callback_ | callback to call when the request is satisfied. | [scope async]
_user_data_ | the data to pass to `_callback_` function. | [closure]

### rygel_writable_container_add_item_finish ()

    void
    rygel_writable_container_add_item_finish
                                   (RygelWritableContainer *self,
                                    GAsyncResult *_res_,
                                    GError **error);

Add a new item directly under this container.

The caller should not first create the file(s) pointed to by the item's URI(s). That is handled by the container class.

This method corresponds to the UPnP ContentDirectory's CreateObject action.

See also: `rygel_writable_container_add_item()`

#### Parameters

self | the RygelWritableContainer instance |
_res_ | a GAsyncResult |
error | location to store the error occuring, or `NULL` to ignore |

#### Returns

nothing.

### rygel_writable_container_add_container ()

    void
    rygel_writable_container_add_container
                                   (RygelWritableContainer *self,
                                    RygelMediaContainer *container,
                                    GCancellable *cancellable,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_);

Add a new container directly under this container.

See also: `rygel_writable_container_add_container_finish()`

#### Parameters

self | the RygelWritableContainer instance |
container | . The container to add to this container . | [in]
cancellable | . optional cancellable for this operation . | [in][allow-none]
_callback_ | callback to call when the request is satisfied. | [scope async]
_user_data_ | the data to pass to `_callback_` function. | [closure]

### rygel_writable_container_add_container_finish ()

    void
    rygel_writable_container_add_container_finish
                                   (RygelWritableContainer *self,
                                    GAsyncResult *_res_,
                                    GError **error);

Add a new container directly under this container.

See also: `rygel_writable_container_add_container()`

#### Parameters

self | the RygelWritableContainer instance |
_res_ | a GAsyncResult |
error | location to store the error occuring, or `NULL` to ignore |

### rygel_writable_container_add_reference ()

    void
    rygel_writable_container_add_reference
                                   (RygelWritableContainer *self,
                                    RygelMediaObject *object,
                                    GCancellable *cancellable,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_);

Add a reference to an object.

See also: `rygel_writable_container_add_reference_finish()`

#### Parameters

self | the RygelWritableContainer instance |
object | . The source object to add a reference to. . | [in]
cancellable | . optional cancellable for this operation . | [in][allow-none]
_callback_ | callback to call when the request is satisfied. | [scope async]
_user_data_ | the data to pass to `_callback_` function. | [closure]

### rygel_writable_container_add_reference_finish ()

    gchar *
    rygel_writable_container_add_reference_finish
                                   (RygelWritableContainer *self,
                                    GAsyncResult *_res_,
                                    GError **error);

Add a reference to an object.

See also: `rygel_writable_container_add_reference()`

#### Parameters

self | the RygelWritableContainer instance |
_res_ | a GAsyncResult |
error | location to store the error occuring, or `NULL` to ignore |

#### Returns

the id of the newly created reference

### rygel_writable_container_remove_item ()

    void
    rygel_writable_container_remove_item (RygelWritableContainer *self,
                                          const gchar *id,
                                          GCancellable *cancellable,
                                          GAsyncReadyCallback _callback_,
                                          gpointer _user_data_);

Remove an item directly under this container that has the ID `id` .

The caller should not first remove the file(s) pointed to by the item's URI(s). That is handled by the container class.

This method corresponds to the UPnP ContentDirectory's DestroyObject action.

See also: `rygel_writable_container_remove_item_finish()`

#### Parameters

self | the RygelWritableContainer instance |
id | . The ID of the item to remove from this container . | [in]
cancellable | . optional cancellable for this operation . | [in][allow-none]
_callback_ | callback to call when the request is satisfied. | [scope async]
_user_data_ | the data to pass to `_callback_` function. | [closure]

### rygel_writable_container_remove_item_finish ()

    void
    rygel_writable_container_remove_item_finish
                                   (RygelWritableContainer *self,
                                    GAsyncResult *_res_,
                                    GError **error);

Remove an item directly under this container that has the ID `id` .

The caller should not first remove the file(s) pointed to by the item's URI(s). That is handled by the container class.

This method corresponds to the UPnP ContentDirectory's DestroyObject action.

See also: `rygel_writable_container_remove_item()`

#### Parameters

self | the RygelWritableContainer instance |
_res_ | a GAsyncResult |
error | location to store the error occuring, or `NULL` to ignore |

#### Returns

nothing.

### rygel_writable_container_remove_container ()

    void
    rygel_writable_container_remove_container
                                   (RygelWritableContainer *self,
                                    const gchar *id,
                                    GCancellable *cancellable,
                                    GAsyncReadyCallback _callback_,
                                    gpointer _user_data_);

Remove a container directly under this container that has the ID `id` .

The caller should not first remove the file(s) pointed to by the item's URI(s). That is handled by the container class.

This method corresponds to the UPnP ContentDirectory's DestroyObject action.

See also: `rygel_writable_container_remove_container_finish()`

#### Parameters

self | the RygelWritableContainer instance |
id | . The ID of the item to remove from this container . | [in]
cancellable | . optional cancellable for this operation . | [in][allow-none]
_callback_ | callback to call when the request is satisfied. | [scope async]
_user_data_ | the data to pass to `_callback_` function. | [closure]

### rygel_writable_container_remove_container_finish ()

    void
    rygel_writable_container_remove_container_finish
                                   (RygelWritableContainer *self,
                                    GAsyncResult *_res_,
                                    GError **error);

Remove a container directly under this container that has the ID `id` .

The caller should not first remove the file(s) pointed to by the item's URI(s). That is handled by the container class.

This method corresponds to the UPnP ContentDirectory's DestroyObject action.

See also: `rygel_writable_container_remove_container()`

#### Parameters

self | the RygelWritableContainer instance |
_res_ | a GAsyncResult |
error | location to store the error occuring, or `NULL` to ignore |

### rygel_writable_container_get_create_classes ()

    GeeArrayList *
    rygel_writable_container_get_create_classes
                                   (RygelWritableContainer *self);

Get and return the current value of the "create-classes" property.

The list of upnp classes that can be added to this container.

See `rygel_writable_container_add_item()`.

This corresponds to the UPnP ContentDirectory's createClass properties.

#### Parameters

self | the RygelWritableContainer instance to query |

#### Returns

the value of the "create-classes" property

### rygel_writable_container_set_create_classes ()

    void
    rygel_writable_container_set_create_classes
                                   (RygelWritableContainer *self,
                                    GeeArrayList *value);

Set the value of the "create-classes" property to `value` .

The list of upnp classes that can be added to this container.

See `rygel_writable_container_add_item()`.

This corresponds to the UPnP ContentDirectory's createClass properties.

#### Parameters

self | the RygelWritableContainer instance to modify |
value | the new value of the "create-classes" property |

## Types and Values

### enum RygelWritableContainerError

#### Members

RYGEL_WRITABLE_CONTAINER_ERROR_NOT_IMPLEMENTED |  |

### RYGEL_WRITABLE_CONTAINER_WRITABLE_SCHEME

    #define RYGEL_WRITABLE_CONTAINER_WRITABLE_SCHEME "rygel-writable://"

### RygelWritableContainer

    typedef struct _RygelWritableContainer RygelWritableContainer;

This interface should be implemented by 'writable' containers - ones that allow adding (via upload), removal and editing of items directly under them. Currently, only addition and removal are supported.

In addition to implementing this interface, a writable container must also:

1. Provide one URI that points to a writable folder on a GIO-supported filesystem.

2. Monitor not only its own URI but also that of its child items, though the latter is implied in the former if you use GIO for monitoring.

### struct RygelWritableContainerIface

    struct RygelWritableContainerIface {
    	GTypeInterface parent_iface;
    	void (*add_item) (RygelWritableContainer* self, RygelMediaFileItem* item, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
    	void (*add_item_finish) (RygelWritableContainer* self, GAsyncResult* _res_, GError** error);
    	void (*add_container) (RygelWritableContainer* self, RygelMediaContainer* container, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
    	void (*add_container_finish) (RygelWritableContainer* self, GAsyncResult* _res_, GError** error);
    	void (*add_reference) (RygelWritableContainer* self, RygelMediaObject* object, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
    	gchar* (*add_reference_finish) (RygelWritableContainer* self, GAsyncResult* _res_, GError** error);
    	void (*remove_item) (RygelWritableContainer* self, const gchar* id, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
    	void (*remove_item_finish) (RygelWritableContainer* self, GAsyncResult* _res_, GError** error);
    	void (*remove_container) (RygelWritableContainer* self, const gchar* id, GCancellable* cancellable, GAsyncReadyCallback _callback_, gpointer _user_data_);
    	void (*remove_container_finish) (RygelWritableContainer* self, GAsyncResult* _res_, GError** error);
    	GeeArrayList* (*get_create_classes) (RygelWritableContainer* self);
    	void (*set_create_classes) (RygelWritableContainer* self, GeeArrayList* value);
    };

Interface for creating RygelWritableContainer implementations.

#### Members

GTypeInterface `parent_iface`; | the parent interface structure |
`add_item` () | virtual method called by `rygel_writable_container_add_item()` |
`add_item_finish` () | asynchronous finish function for `add_item`, called by `rygel_writable_container_add_item()` |
`add_container` () | virtual method called by `rygel_writable_container_add_container()` |
`add_container_finish` () | asynchronous finish function for `add_container`, called by `rygel_writable_container_add_container()` |
`add_reference` () | virtual method called by `rygel_writable_container_add_reference()` |
`add_reference_finish` () | asynchronous finish function for `add_reference`, called by `rygel_writable_container_add_reference()` |
`remove_item` () | virtual method called by `rygel_writable_container_remove_item()` |
`remove_item_finish` () | asynchronous finish function for `remove_item`, called by `rygel_writable_container_remove_item()` |
`remove_container` () | virtual method called by `rygel_writable_container_remove_container()` |
`remove_container_finish` () | asynchronous finish function for `remove_container`, called by `rygel_writable_container_remove_container()` |
`get_create_classes` () | getter method for the abstract property "create-classes" |
`set_create_classes` () | setter method for the abstract property "create-classes" |

## Property Details

### The `“create-classes”` property

      “create-classes”           GeeArrayList *

The list of upnp classes that can be added to this container.

See `rygel_writable_container_add_item()`.

This corresponds to the UPnP ContentDirectory's createClass properties.

Flags: Read / Write