AsContentRating

AsContentRating — Object representing a content rating

Stability Level

Unstable, unless otherwise indicated

Synopsis

#include <appstream-glib.h>

#define             AS_TYPE_CONTENT
struct              AsContentRatingClass;
enum                AsContentRatingValue;
AsContentRating *   as_content_rating_new               (void);
const gchar *       as_content_rating_value_to_string   (AsContentRatingValue value);
AsContentRatingValue as_content_rating_value_from_string
                                                        (const gchar *value);
const gchar *       as_content_rating_get_kind          (AsContentRating *content_rating);
guint               as_content_rating_get_minimum_age   (AsContentRating *content_rating);
AsContentRatingValue as_content_rating_get_value        (AsContentRating *content_rating,
                                                         const gchar *id);
void                as_content_rating_set_kind          (AsContentRating *content_rating,
                                                         const gchar *kind);

Description

Content ratings are age-specific guidelines for applications.

See also: AsApp

Details

AS_TYPE_CONTENT

#define AS_TYPE_CONTENT (as_content_rating_get_type ())

struct AsContentRatingClass

struct AsContentRatingClass {
	GObjectClass		parent_class;
};

enum AsContentRatingValue

typedef enum {
	AS_CONTENT_RATING_VALUE_UNKNOWN,
	AS_CONTENT_RATING_VALUE_NONE,
	AS_CONTENT_RATING_VALUE_MILD,
	AS_CONTENT_RATING_VALUE_MODERATE,
	AS_CONTENT_RATING_VALUE_INTENSE,
} AsContentRatingValue;

The specified level of an content_rating rating ID.

AS_CONTENT_RATING_VALUE_UNKNOWN

Unknown value

AS_CONTENT_RATING_VALUE_NONE

None

AS_CONTENT_RATING_VALUE_MILD

A small amount

AS_CONTENT_RATING_VALUE_MODERATE

A moderate amount

AS_CONTENT_RATING_VALUE_INTENSE

An intense amount

as_content_rating_new ()

AsContentRating *   as_content_rating_new               (void);

Creates a new AsContentRating.

Returns :

a AsContentRating. [transfer full]

Since 0.5.12


as_content_rating_value_to_string ()

const gchar *       as_content_rating_value_to_string   (AsContentRatingValue value);

Converts the enumerated value to an text representation.

value :

the AsContentRatingValue.

Returns :

string version of value

Since 0.5.12


as_content_rating_value_from_string ()

AsContentRatingValue as_content_rating_value_from_string
                                                        (const gchar *value);

Converts the text representation to an enumerated value.

value :

the string.

Returns :

a AsContentRatingValue or AS_CONTENT_RATING_VALUE_UNKNOWN for unknown

Since 0.5.12


as_content_rating_get_kind ()

const gchar *       as_content_rating_get_kind          (AsContentRating *content_rating);

Gets the content_rating kind.

content_rating :

a AsContentRating instance.

Returns :

a string, e.g. "oars-1.0", or NULL

Since 0.5.12


as_content_rating_get_minimum_age ()

guint               as_content_rating_get_minimum_age   (AsContentRating *content_rating);

Gets the lowest Common Sense Media approved age for the content_rating block. NOTE: these numbers are based on the data and descriptions available from https://www.commonsensemedia.org/about-us/our-mission/about-our-ratings and you may disagree with them.

You're free to disagree with these, and of course you should use your own brain to work our if your child is able to cope with the concepts enumerated here. Some 13 year olds mey be fine with the concept of mutilation of body parts, others may get nightmares.

content_rating :

a AsContentRating

Returns :

The age in years, 0 for no rating, or G_MAXUINT for no details.

Since 0.5.12


as_content_rating_get_value ()

AsContentRatingValue as_content_rating_get_value        (AsContentRating *content_rating,
                                                         const gchar *id);

Gets the set value of a content rating key.

content_rating :

a AsContentRating

id :

A ratings ID, e.g. `violence-bloodshed`.

Returns :

the AsContentRatingValue, or AS_CONTENT_RATING_VALUE_UNKNOWN

Since 0.6.4


as_content_rating_set_kind ()

void                as_content_rating_set_kind          (AsContentRating *content_rating,
                                                         const gchar *kind);

Sets the content rating kind.

content_rating :

a AsContentRating instance.

kind :

the rating kind, e.g. "oars-1.0"

Since 0.5.12