## OobsObject

OobsObject — Base object for all configuration objects

## Synopsis

                        OobsObject;
    void                (*OobsObjectAsyncFunc)              (OobsObject *object,
                                                             OobsResult result,
                                                             gpointer data);
    OobsResult          oobs_object_commit                  (OobsObject *object);
    OobsResult          oobs_object_commit_async            (OobsObject *object,
                                                             OobsObjectAsyncFunc func,
                                                             gpointer data);
    OobsResult          oobs_object_add                     (OobsObject *object);
    OobsResult          oobs_object_add_async               (OobsObject *object,
                                                             OobsObjectAsyncFunc func,
                                                             gpointer data);
    OobsResult          oobs_object_delete                  (OobsObject *object);
    OobsResult          oobs_object_delete_async            (OobsObject *object,
                                                             OobsObjectAsyncFunc func,
                                                             gpointer data);
    OobsResult          oobs_object_update                  (OobsObject *object);
    OobsResult          oobs_object_update_async            (OobsObject *object,
                                                             OobsObjectAsyncFunc func,
                                                             gpointer data);
    void                oobs_object_process_requests        (OobsObject *object);
    gboolean            oobs_object_has_updated             (OobsObject *object);
    void                oobs_object_ensure_update           (OobsObject *object);
    gboolean            oobs_object_authenticate            (OobsObject *object,
                                                             GError **error);

## Object Hierarchy

      GObject
       +----OobsObject
             +----OobsTimeConfig
             +----OobsNTPConfig
             +----OobsGroupsConfig
             +----OobsIfacesConfig
             +----OobsNFSConfig
             +----OobsService
             +----OobsSelfConfig
             +----OobsHostsConfig
             +----OobsServicesConfig
             +----OobsUsersConfig
             +----OobsSMBConfig
             +----OobsGroup
             +----OobsUser

## Properties

      "remote-object"            gchar*                : Write / Construct Only

## Signals

      "changed"                                        : Run Last
      "committed"                                      : Run Last
      "updated"                                        : Run Last

## Description

## Details

### OobsObject

    typedef struct _OobsObject OobsObject;

### OobsObjectAsyncFunc ()

    void                (*OobsObjectAsyncFunc)              (OobsObject *object,
                                                             OobsResult result,
                                                             gpointer data);

`object` : |
`result` : |
`data` : |

### oobs_object_commit ()

    OobsResult          oobs_object_commit                  (OobsObject *object);

Commits to the system all the changes done to the configuration held by an OobsObject.

`object` : | an OobsObject
Returns : | an OobsResult enum with the error code.

### oobs_object_commit_async ()

    OobsResult          oobs_object_commit_async            (OobsObject *object,
                                                             OobsObjectAsyncFunc func,
                                                             gpointer data);

Commits to the system all the changes done to the configuration held by an OobsObject. This change will be asynchronous, being run the function `func` when the change has been done.

`object` : | An OobsObject.
`func` : | An OobsObjectAsyncFunc that will be called when the asynchronous operation has ended.
`data` : | Additional data to pass to `func`.
Returns : | an OobsResult enum with the error code. Due to the asynchronous nature of the function, only OOBS_RESULT_MALFORMED and OOBS_RESULT_OK can be returned.

### oobs_object_add ()

    OobsResult          oobs_object_add                     (OobsObject *object);

Add an OobsObject to the system's configuration. This is only supported by certain individual objects, others are added by committing a modified objects list.

`object` : | an OobsObject
Returns : | an OobsResult enum with the error code.

### oobs_object_add_async ()

    OobsResult          oobs_object_add_async               (OobsObject *object,
                                                             OobsObjectAsyncFunc func,
                                                             gpointer data);

Add an OobsObject to the system's configuration. This change will be asynchronous, being run the function `func` when the change has been done.

`object` : | An OobsObject.
`func` : | An OobsObjectAsyncFunc that will be called when the asynchronous operation has ended.
`data` : | Additional data to pass to `func`.
Returns : | an OobsResult enum with the error code. Due to the asynchronous nature of the function, only OOBS_RESULT_MALFORMED and OOBS_RESULT_OK can be returned.

### oobs_object_delete ()

    OobsResult          oobs_object_delete                  (OobsObject *object);

Delete an OobsObject from the system's configuration. This is only supported by certain individual objects, others are added by committing a modified objects list.

`object` : | an OobsObject
Returns : | an OobsResult enum with the error code.

### oobs_object_delete_async ()

    OobsResult          oobs_object_delete_async            (OobsObject *object,
                                                             OobsObjectAsyncFunc func,
                                                             gpointer data);

Delete an OobsObject from the system's configuration. This change will be asynchronous, being run the function `func` when the change has been done.

`object` : | An OobsObject.
`func` : | An OobsObjectAsyncFunc that will be called when the asynchronous operation has ended.
`data` : | Additional data to pass to `func`.
Returns : | an OobsResult enum with the error code. Due to the asynchronous nature of the function, only OOBS_RESULT_MALFORMED and OOBS_RESULT_OK can be returned.

### oobs_object_update ()

    OobsResult          oobs_object_update                  (OobsObject *object);

Synchronizes the configuration held by the OobsObject with the actual system configuration. All the changes done to the configuration held by the OobsObject will be forgotten.

`object` : | an OobsObject
Returns : | an OobsResult enum with the error code.

### oobs_object_update_async ()

    OobsResult          oobs_object_update_async            (OobsObject *object,
                                                             OobsObjectAsyncFunc func,
                                                             gpointer data);

Synchronizes the configuration held by the OobsObject with the actual system configuration. All the changes done to the configuration held by the OobsObject will be forgotten. The update operation will be asynchronous, being run the function `func` when the update has been done.

`object` : | An OobsObject
`func` : | An OobsObjectAsyncFunc that will be called when the asynchronous operation has ended.
`data` : | Aditional data to pass to `func`.
Returns : | an OobsResult enum with the error code. Due to the asynchronous nature of the function, only OOBS_RESULT_MALFORMED and OOBS_RESULT_OK can be returned.

### oobs_object_process_requests ()

    void                oobs_object_process_requests        (OobsObject *object);

Blocks until all pending asynchronous requests to this object have been processed.

`object` : | An OobsObject

### oobs_object_has_updated ()

    gboolean            oobs_object_has_updated             (OobsObject *object);

Returns whether the object has been updated since its creation. see `oobs_object_update()` and `oobs_object_update_async()`.

`object` : | An OobsObject
Returns : | TRUE if the object has been updated.

### oobs_object_ensure_update ()

    void                oobs_object_ensure_update           (OobsObject *object);

Ensures that the given object has been updated. If not it either blocks until any update request sent is dispatched or updates synchronously.

`object` : | An OobsObject

### oobs_object_authenticate ()

    gboolean            oobs_object_authenticate            (OobsObject *object,
                                                             GError **error);

Performs a PolicyKit authentication via the backends for the action required by the given object. User interaction will occur synchronously if needed.

You may want to check the returned error for `OOBS_ERROR_AUTHENTICATION_CANCELLED`, in which case you should avoid showing an error dialog to the user.

`object` : | An OobsObject.
`error` : | Return location for error or NULL.
Returns : | `TRUE` if allowed to commit `object`, `FALSE` otherwise.

## Property Details

### The `"remote-object"` property

      "remote-object"            gchar*                : Write / Construct Only

Name of the remote object at the other side of the connection.

Default value: NULL

## Signal Details

### The `"changed"` signal

    void                user_function                      (OobsObject *oobsobject,
                                                            gpointer    user_data)       : Run Last

`oobsobject` : | the object which received the signal.
`user_data` : | user data set when the signal handler was connected.

### The `"committed"` signal

    void                user_function                      (OobsObject *oobsobject,
                                                            gpointer    user_data)       : Run Last

`oobsobject` : | the object which received the signal.
`user_data` : | user data set when the signal handler was connected.

### The `"updated"` signal

    void                user_function                      (OobsObject *oobsobject,
                                                            gpointer    user_data)       : Run Last

`oobsobject` : | the object which received the signal.
`user_data` : | user data set when the signal handler was connected.

## See Also

OobsList