AgService

## AgService AgService — A representation of a service. |

## Functions

const gchar * | ag_service_get_display_name ()
const gchar * | ag_service_get_description ()
void | ag_service_get_file_contents ()
const gchar * | ag_service_get_i18n_domain ()
const gchar * | ag_service_get_icon_name ()
const gchar * | ag_service_get_name ()
const gchar * | ag_service_get_provider ()
const gchar * | ag_service_get_service_type ()
GList * | ag_service_get_tags ()
gboolean | ag_service_has_tag ()
void | ag_service_list_free ()
AgService * | ag_service_ref ()
void | ag_service_unref ()

## Types and Values

| AgService

## Object Hierarchy

        GBoxed
        ╰── AgService

## Includes

    #include <libaccounts-glib/ag-service.h>

## Description

The AgService structure represents a service. The structure is not directly exposed to applications, but its fields are accessible via getter methods. It is instantiated by AgManager, with `ag_manager_get_service()`, `ag_manager_list_services()` or `ag_manager_list_services_by_type()`. The structure is reference counted. One must use `ag_service_unref()` when done with it.

## Functions

### ag_service_get_display_name ()

    const gchar *
    ag_service_get_display_name (AgService *service);

Gets the display name of the AgService.

#### Parameters

service | the AgService. |

#### Returns

the display name of `service` .

### ag_service_get_description ()

    const gchar *
    ag_service_get_description (AgService *service);

Gets the description of the AgService.

#### Parameters

service | the AgService. |

#### Returns

the description of `service` , or `NULL` upon failure.

Since: 1.2

### ag_service_get_file_contents ()

    void
    ag_service_get_file_contents (AgService *service,
                                  const gchar **contents,
                                  gsize *data_offset);

Gets the contents of the XML service file. The buffer returned in `contents` should not be modified or freed, and is guaranteed to be valid as long as `service` is referenced. If `data_offset` is not `NULL`, it is set to the offset where the <type_data> element can be found. If some error occurs, `contents` is set to `NULL`.

#### Parameters

service | the AgService. |
contents | location to receive the pointer to the file contents. |
data_offset | pointer to receive the offset of the type data. |

### ag_service_get_i18n_domain ()

    const gchar *
    ag_service_get_i18n_domain (AgService *service);

Gets the translation domain of the AgService.

#### Parameters

service | the AgService. |

#### Returns

the name of the translation catalog.

### ag_service_get_icon_name ()

    const gchar *
    ag_service_get_icon_name (AgService *service);

Gets the icon name of the AgService.

#### Parameters

service | the AgService. |

#### Returns

the name of the icon of `service` .

### ag_service_get_name ()

    const gchar *
    ag_service_get_name (AgService *service);

Gets the name of the AgService.

#### Parameters

service | the AgService. |

#### Returns

the name of `service` .

### ag_service_get_provider ()

    const gchar *
    ag_service_get_provider (AgService *service);

Gets the provider name of the AgService.

#### Parameters

service | the AgService. |

#### Returns

the name of the provider of `service` .

### ag_service_get_service_type ()

    const gchar *
    ag_service_get_service_type (AgService *service);

Gets the service type of the AgService.

#### Parameters

service | the AgService. |

#### Returns

the type of `service` .

### ag_service_get_tags ()

    GList *
    ag_service_get_tags (AgService *service);

Get list of tags specified for the AgService. If the service has not defined tags, tags from the service type will be returned.

#### Parameters

service | the AgService. |

#### Returns

GList of tags for `service` . The list must be freed with `g_list_free()`. Entries are owned by the AgService type and must not be free'd.

[transfer container][element-type utf8]

### ag_service_has_tag ()

    gboolean
    ag_service_has_tag (AgService *service,
                        const gchar *tag);

Checks if the AgService has the requested tag.

#### Parameters

service | the AgService. |
tag | tag to check for. |

#### Returns

TRUE if AgService has the tag, FALSE otherwise

### ag_service_list_free ()

    void
    ag_service_list_free (GList *list);

Frees the list `list` .

#### Parameters

list | a GList of services returned by some function of this library. | [element-type AgService]

### ag_service_ref ()

    AgService *
    ag_service_ref (AgService *service);

Adds a reference to `service` .

#### Parameters

service | the AgService. |

#### Returns

`service` .

### ag_service_unref ()

    void
    ag_service_unref (AgService *service);

Used to unreference the AgService structure.

#### Parameters

service | the AgService. |

## Types and Values

### AgService

    typedef struct _AgService AgService;

Opaque structure. Use related accessor functions.