## SwService

SwService

## Functions

GQuark | sw_service_error_quark ()
const char * | sw_service_get_name ()
void | sw_service_emit_capabilities_changed ()
void | sw_service_emit_user_changed ()
gboolean | sw_service_is_uid_banned ()
gboolean | sw_service_has_cap ()
void | (*SwServiceSetParamFunc) ()
void | sw_service_map_params ()

## Types and Values

enum | SwServiceError
#define | SW_SERVICE_ERROR
| SwService
struct | SwServiceClass
#define | IS_CONFIGURED
#define | CAN_VERIFY_CREDENTIALS
#define | CREDENTIALS_VALID
#define | CREDENTIALS_INVALID
#define | CAN_UPDATE_STATUS
#define | CAN_REQUEST_AVATAR
#define | CAN_GEOTAG
#define | CAN_UPDATE_STATUS_WITH_GEOTAG
#define | HAS_AVATAR_IFACE
#define | HAS_BANISHABLE_IFACE
#define | HAS_PHOTO_UPLOAD_IFACE
#define | HAS_QUERY_IFACE
#define | HAS_UPDATE_STATUS_IFACE

## Object Hierarchy

        GEnum
        ╰── SwServiceError
        GObject
        ╰── SwService

## Implemented Interfaces

SwService implements SwServiceIface and SwBanishableIface.

## Description

## Functions

### sw_service_error_quark ()

    GQuark
    sw_service_error_quark (void);

### sw_service_get_name ()

    const char *
    sw_service_get_name (SwService *service);

### sw_service_emit_capabilities_changed ()

    void
    sw_service_emit_capabilities_changed (SwService *service,
                                          const char **caps);

### sw_service_emit_user_changed ()

    void
    sw_service_emit_user_changed (SwService *service);

### sw_service_is_uid_banned ()

    gboolean
    sw_service_is_uid_banned (SwService *service,
                              const gchar *uid);

### sw_service_has_cap ()

    gboolean
    sw_service_has_cap (const char **caps,
                        const char *cap);

### SwServiceSetParamFunc ()

    void
    (*SwServiceSetParamFunc) (gpointer object,
                              const gchar *param_name,
                              const gchar *param_value);

This type signature reflects a function that sets a name/value association on a given object. Functions such as g_hash_table_insert and rest_proxy_call_add_param are good examples.

#### Parameters

object | A remote call or hash object that can store key/value pairs. |
param_name | The parameter name. |
param_value | The parameter value. |

### sw_service_map_params ()

    void
    sw_service_map_params (const ParameterNameMapping *mapping,
                           GHashTable *parameters,
                           SwServiceSetParamFunc set_param_func,
                           gpointer remote_call_object);

Re-map a group of parameters with alternative parameter names. Used for converting lsw parameter names to service-specific ones.

#### Parameters

mapping | An array of ParameterNameMapping pairs. |
parameters | The GHashtable of given parameters. |
set_param_func | A SwServiceSetParamFunc that sets a name/value association on the given object. |
remote_call_object | The remote call or hash table object that `set_param_func` takes as a first parameter. |

## Types and Values

### enum SwServiceError

#### Members

SW_SERVICE_ERROR_NO_KEYS |  |
SW_SERVICE_ERROR_INVALID_QUERY |  |
SW_SERVICE_ERROR_NOT_SUPPORTED |  |
SW_SERVICE_ERROR_REMOTE_ERROR |  |
SW_SERVICE_ERROR_INCOMPLETE_KEY_FILE |  |

### SW_SERVICE_ERROR

    #define SW_SERVICE_ERROR sw_service_error_quark ()

### SwService

    typedef struct _SwService SwService;

### struct SwServiceClass

    struct SwServiceClass {
      GObjectClass parent_class;
      /* vfuncs */
      const char *(*get_name) (SwService *service);
      const gchar ** (*get_static_caps) (SwService *service);
      const gchar ** (*get_dynamic_caps) (SwService *service);
      void (*credentials_updated) (SwService *service);
    };

### IS_CONFIGURED

    #define IS_CONFIGURED "is-configured"

### CAN_VERIFY_CREDENTIALS

    #define CAN_VERIFY_CREDENTIALS "can-verify-credentials"

### CREDENTIALS_VALID

    #define CREDENTIALS_VALID "credentials-valid"

### CREDENTIALS_INVALID

    #define CREDENTIALS_INVALID "credentials-invalid"

### CAN_UPDATE_STATUS

    #define CAN_UPDATE_STATUS "can-update-status"

### CAN_REQUEST_AVATAR

    #define CAN_REQUEST_AVATAR "can-request-avatar"

### CAN_GEOTAG

    #define CAN_GEOTAG "can-geotag"

### CAN_UPDATE_STATUS_WITH_GEOTAG

    #define CAN_UPDATE_STATUS_WITH_GEOTAG "can-update-status-with-geotag"

### HAS_AVATAR_IFACE

    #define HAS_AVATAR_IFACE "has-avatar-iface"

### HAS_BANISHABLE_IFACE

    #define HAS_BANISHABLE_IFACE "has-banishable-iface"

### HAS_PHOTO_UPLOAD_IFACE

    #define HAS_PHOTO_UPLOAD_IFACE "has-photo-upload-iface"

### HAS_QUERY_IFACE

    #define HAS_QUERY_IFACE "has-query-iface"

### HAS_UPDATE_STATUS_IFACE

    #define HAS_UPDATE_STATUS_IFACE "has-update-status-iface"