AsProblem

AsProblem — Object representing a problem with an application

Stability Level

Stable, unless otherwise indicated

Synopsis

#include <appstream-glib.h>

#define             AS_TYPE_PROBLEM
struct              AsProblemClass;
enum                AsProblemKind;
AsProblem *         as_problem_new                      (void);
const gchar *       as_problem_kind_to_string           (AsProblemKind kind);
AsProblemKind       as_problem_get_kind                 (AsProblem *problem);
guint               as_problem_get_line_number          (AsProblem *problem);
const gchar *       as_problem_get_message              (AsProblem *problem);
void                as_problem_set_kind                 (AsProblem *problem,
                                                         AsProblemKind kind);
void                as_problem_set_line_number          (AsProblem *problem,
                                                         guint line_number);
void                as_problem_set_message              (AsProblem *problem,
                                                         const gchar *message);

Description

Problems have a unlocalized message and also contain a line number and kind.

See also: AsApp

Details

AS_TYPE_PROBLEM

#define AS_TYPE_PROBLEM (as_problem_get_type ())

struct AsProblemClass

struct AsProblemClass {
	GObjectClass		parent_class;
};

enum AsProblemKind

typedef enum {
	AS_PROBLEM_KIND_UNKNOWN,
	AS_PROBLEM_KIND_TAG_DUPLICATED,
	AS_PROBLEM_KIND_TAG_MISSING,
	AS_PROBLEM_KIND_TAG_INVALID,
	AS_PROBLEM_KIND_ATTRIBUTE_MISSING,
	AS_PROBLEM_KIND_ATTRIBUTE_INVALID,
	AS_PROBLEM_KIND_MARKUP_INVALID,
	AS_PROBLEM_KIND_STYLE_INCORRECT,
	AS_PROBLEM_KIND_TRANSLATIONS_REQUIRED,
	AS_PROBLEM_KIND_DUPLICATE_DATA,
	AS_PROBLEM_KIND_VALUE_MISSING,
	AS_PROBLEM_KIND_URL_NOT_FOUND,
	AS_PROBLEM_KIND_FILE_INVALID,
	AS_PROBLEM_KIND_ASPECT_RATIO_INCORRECT,
	AS_PROBLEM_KIND_RESOLUTION_INCORRECT,
} AsProblemKind;

The problem type.

AS_PROBLEM_KIND_UNKNOWN

Type invalid or not known

AS_PROBLEM_KIND_TAG_DUPLICATED

A tag is duplicated

AS_PROBLEM_KIND_TAG_MISSING

A required tag is missing

AS_PROBLEM_KIND_TAG_INVALID

A tag value is invalid

AS_PROBLEM_KIND_ATTRIBUTE_MISSING

A required attribute is missing

AS_PROBLEM_KIND_ATTRIBUTE_INVALID

An attribute is invalid

AS_PROBLEM_KIND_MARKUP_INVALID

The XML markup is invalid

AS_PROBLEM_KIND_STYLE_INCORRECT

Style guidelines are incorrect

AS_PROBLEM_KIND_TRANSLATIONS_REQUIRED

Translations are required

AS_PROBLEM_KIND_DUPLICATE_DATA

Some data is duplicated

AS_PROBLEM_KIND_VALUE_MISSING

A value is required

AS_PROBLEM_KIND_URL_NOT_FOUND

The URL is not found

AS_PROBLEM_KIND_FILE_INVALID

The file is invalid

AS_PROBLEM_KIND_ASPECT_RATIO_INCORRECT

The image aspect ratio is wrong

AS_PROBLEM_KIND_RESOLUTION_INCORRECT

The image resolution is wrong

as_problem_new ()

AsProblem *         as_problem_new                      (void);

Creates a new AsProblem.

Returns :

a AsProblem. [transfer full]

Since 0.1.4


as_problem_kind_to_string ()

const gchar *       as_problem_kind_to_string           (AsProblemKind kind);

Converts the enumerated value to an text representation.

kind :

the AsProblemKind.

Returns :

string version of kind

Since 0.1.4


as_problem_get_kind ()

AsProblemKind       as_problem_get_kind                 (AsProblem *problem);

Gets the problem kind.

problem :

a AsProblem instance.

Returns :

a AsProblemKind, e.g. AS_PROBLEM_KIND_TAG_MISSING

Since 0.1.4


as_problem_get_line_number ()

guint               as_problem_get_line_number          (AsProblem *problem);

Gets the line number of the problem if known.

problem :

a AsProblem instance.

Returns :

a line number, where 0 is unknown

Since 0.1.4


as_problem_get_message ()

const gchar *       as_problem_get_message              (AsProblem *problem);

Gets the specific message for the problem.

problem :

a AsProblem instance.

Returns :

the message

Since 0.1.4


as_problem_set_kind ()

void                as_problem_set_kind                 (AsProblem *problem,
                                                         AsProblemKind kind);

Sets the problem kind.

problem :

a AsProblem instance.

kind :

the AsProblemKind.

Since 0.1.4


as_problem_set_line_number ()

void                as_problem_set_line_number          (AsProblem *problem,
                                                         guint line_number);

Adds an line_number to the problem.

problem :

a AsProblem instance.

line_number :

a guint instance.

Since 0.1.4


as_problem_set_message ()

void                as_problem_set_message              (AsProblem *problem,
                                                         const gchar *message);

Sets a message on the problem.

problem :

a AsProblem instance.

message :

the message text.

Since 0.1.4