ag-service-type

## ag-service-type ag-service-type — A description of a service type. |

## Functions

const gchar * | ag_service_type_get_name ()
const gchar * | ag_service_type_get_i18n_domain ()
const gchar * | ag_service_type_get_display_name ()
const gchar * | ag_service_type_get_description ()
const gchar * | ag_service_type_get_icon_name ()
gboolean | ag_service_type_has_tag ()
GList * | ag_service_type_get_tags ()
void | ag_service_type_get_file_contents ()
AgServiceType * | ag_service_type_ref ()
void | ag_service_type_unref ()
void | ag_service_type_list_free ()

## Description

The AgServiceType structure represents a service type. The structure is not directly exposed to applications, but its fields are accessible via getter methods. It is instantiated by AgManager with `ag_manager_list_service_types()` or `ag_manager_load_service_type()`. Additonally, AgManager can be instantiated with a set service type with `ag_manager_new_for_service_type()`, which restricts some future operations on the manager, such as `ag_manager_list()` or `ag_manager_list_services()`, to only affect accounts or services with the set service type. The structure is reference counted. One must use `ag_service_type_unref()` when done with it.

## Functions

### ag_service_type_get_name ()

    const gchar *
    ag_service_type_get_name (AgServiceType *service_type);

Get the name of the AgServiceType.

#### Parameters

service_type | the AgServiceType. |

#### Returns

the name of `service_type` .

### ag_service_type_get_i18n_domain ()

    const gchar *
    ag_service_type_get_i18n_domain (AgServiceType *service_type);

Get the translation domain of the AgServiceType.

#### Parameters

service_type | the AgServiceType. |

#### Returns

the translation domain.

### ag_service_type_get_display_name ()

    const gchar *
    ag_service_type_get_display_name (AgServiceType *service_type);

Get the display name of the AgServiceType.

#### Parameters

service_type | the AgServiceType. |

#### Returns

the display name of `service_type` .

### ag_service_type_get_description ()

    const gchar *
    ag_service_type_get_description (AgServiceType *service_type);

Get the description of the AgServiceType.

#### Parameters

service_type | the AgServiceType. |

#### Returns

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

Since: 1.2

### ag_service_type_get_icon_name ()

    const gchar *
    ag_service_type_get_icon_name (AgServiceType *service_type);

Get the icon name of the AgServiceType.

#### Parameters

service_type | the AgServiceType. |

#### Returns

the name of the icon of `service_type` .

### ag_service_type_has_tag ()

    gboolean
    ag_service_type_has_tag (AgServiceType *service_type,
                             const gchar *tag);

Check if the AgServiceType has the requested tag.

#### Parameters

service_type | the AgServiceType. |
tag | the tag to check for. |

#### Returns

TRUE if the AgServiceType has the tag, FALSE otherwise

### ag_service_type_get_tags ()

    GList *
    ag_service_type_get_tags (AgServiceType *service_type);

Get list of tags specified for the AgServiceType.

#### Parameters

service_type | the AgServiceType. |

#### Returns

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

[transfer container][element-type utf8]

### ag_service_type_get_file_contents ()

    void
    ag_service_type_get_file_contents (AgServiceType *service_type,
                                       const gchar **contents,
                                       gsize *len);

Gets the contents of the XML service type file. The buffer returned in `contents` should not be modified or freed, and is guaranteed to be valid as long as `service_type` is referenced. If some error occurs, `contents` is set to `NULL`.

#### Parameters

service_type | the AgServiceType. |
contents | location to receive the pointer to the file contents. |
len | location to receive the length of the file, in bytes. |

### ag_service_type_ref ()

    AgServiceType *
    ag_service_type_ref (AgServiceType *service_type);

Adds a reference to `service_type` .

#### Parameters

service_type | the AgServiceType. |

#### Returns

`service_type` .

### ag_service_type_unref ()

    void
    ag_service_type_unref (AgServiceType *service_type);

Used to unreference the AgServiceType structure.

#### Parameters

service_type | the AgServiceType. |

### ag_service_type_list_free ()

    void
    ag_service_type_list_free (GList *list);

Frees the list `list` .

#### Parameters

list | a GList of service types returned by some function of this library, such as `ag_manager_list_service_types()`. | [element-type AgServiceType]