AscHint: AppStream Compose Library Reference Manual

## AscHint AscHint — A data processing hint. |

## Functions

AscHint * | asc_hint_new ()
AscHint * | asc_hint_new_for_tag ()
const gchar * | asc_hint_get_tag ()
void | asc_hint_set_tag ()
AsIssueSeverity | asc_hint_get_severity ()
void | asc_hint_set_severity ()
const gchar * | asc_hint_get_explanation_template ()
void | asc_hint_set_explanation_template ()
gboolean | asc_hint_is_error ()
gboolean | asc_hint_is_valid ()
void | asc_hint_add_explanation_var ()
GPtrArray * | asc_hint_get_explanation_vars_list ()
gchar * | asc_hint_format_explanation ()

## Types and Values

#define | ASC_TYPE_HINT
struct | AscHintClass
| AscHint

## Includes

    #include <appstream-compose.h>

## Description

## Functions

### asc_hint_new ()

    AscHint *
    asc_hint_new (void);

Creates a new AscHint.

### asc_hint_new_for_tag ()

    AscHint *
    asc_hint_new_for_tag (const gchar *tag,
                          GError **error);

Creates a new AscHint with the given tag. If the selected tag was not registered+ with the global tag registry, `NULL` is returned and an error is set.

#### Parameters

tag | The tag ID to construct this hint for. |
error | A GError or `NULL` |

### asc_hint_get_tag ()

    const gchar *
    asc_hint_get_tag (AscHint *hint);

Gets the unique tag for the type of this hint.

#### Parameters

hint | an AscHint instance. |

### asc_hint_set_tag ()

    void
    asc_hint_set_tag (AscHint *hint,
                      const gchar *tag);

Sets the unique tag for the type of this hint.

#### Parameters

hint | an AscHint instance. |

### asc_hint_get_severity ()

    AsIssueSeverity
    asc_hint_get_severity (AscHint *hint);

Gets the issue severity of this hint.

#### Parameters

hint | an AscHint instance. |

### asc_hint_set_severity ()

    void
    asc_hint_set_severity (AscHint *hint,
                           AsIssueSeverity severity);

Sets the issue severity of this hint.

#### Parameters

hint | an AscHint instance. |

### asc_hint_get_explanation_template ()

    const gchar *
    asc_hint_get_explanation_template (AscHint *hint);

Gets the explanation template for this hint.

#### Parameters

hint | an AscHint instance. |

### asc_hint_set_explanation_template ()

    void
    asc_hint_set_explanation_template (AscHint *hint,
                                       const gchar *explanation_tmpl);

Sets the explanation template for this hint.

#### Parameters

hint | an AscHint instance. |

### asc_hint_is_error ()

    gboolean
    asc_hint_is_error (AscHint *hint);

#### Parameters

hint | an AscHint instance. |

#### Returns

`TRUE` if this hint describes an error.

### asc_hint_is_valid ()

    gboolean
    asc_hint_is_valid (AscHint *hint);

Check if this hint is valid (it requires at least a tag and a severity in order to be considered valid).

#### Parameters

hint | an AscHint instance. |

#### Returns

`TRUE` if this hint is valid.

### asc_hint_add_explanation_var ()

    void
    asc_hint_add_explanation_var (AscHint *hint,
                                  const gchar *var_name,
                                  const gchar *text);

Add a replacement variable for the explanation text.

#### Parameters

hint | an AscHint instance. |
var_name | Name of the variable to be replaced. |
text | Replacement for the variable name. |

### asc_hint_get_explanation_vars_list ()

    GPtrArray *
    asc_hint_get_explanation_vars_list (AscHint *hint);

Returns a list with the flattened key/value pairs for this hint. Values are located in uneven list entries, following their keys in even list entries.

#### Parameters

hint | an AscHint instance. |

#### Returns

A flattened GPtrArray with the key/value pairs.

[transfer none][element-type utf8]

### asc_hint_format_explanation ()

    gchar *
    asc_hint_format_explanation (AscHint *hint);

Formats the explanation template to return a human-redable issue hint explanation, with all placeholder variables replaced.

#### Parameters

hint | an AscHint instance. |

#### Returns

Explanation text for this hint, with variables replaced.

[transfer full]

## Types and Values

### ASC_TYPE_HINT

    #define ASC_TYPE_HINT (asc_hint_get_type ())

### struct AscHintClass

    struct AscHintClass {
    	GObjectClass parent_class;
    };

### AscHint

    typedef struct _AscHint AscHint;