GsReview

GsReview — An application user review

Stability Level

Unstable, unless otherwise indicated

Functions

Properties

GsReview * date Read / Write / Construct
guint64 flags Read / Write / Construct
gint karma Read / Write / Construct
gint rating Read / Write / Construct
gchar * reviewer Read / Write / Construct
gchar * summary Read / Write / Construct
gchar * text Read / Write / Construct
gchar * version Read / Write / Construct

Types and Values

Object Hierarchy

    GObject
    ╰── GsReview

Includes

#include <gnome-software.h>

Description

This object represents a user-submitted application review.

Functions

gs_review_new ()

GsReview *
gs_review_new (void);

Returns

a new GsReview object.


gs_review_get_karma ()

gint
gs_review_get_karma (GsReview *review);

Gets the karma for the review, where positive numbers indicate more positive feedback for the review.

Parameters

review

a GsReview

 

Returns

the karma value, or 0 for unset.


gs_review_set_karma ()

void
gs_review_set_karma (GsReview *review,
                     gint karma);

Sets the karma for the review, where positive numbers indicate more positive feedback for the review.

Karma can be positive or negative, or 0 for unset.

Parameters

review

a GsReview

 

karma

a karma value

 

gs_review_get_score ()

gint
gs_review_get_score (GsReview *review);

This allows the UI to sort reviews into the correct order. Higher numbers indicate a more important or relevant review.

Parameters

review

a GsReview

 

Returns

the review score, or 0 for unset.


gs_review_set_score ()

void
gs_review_set_score (GsReview *review,
                     gint score);

Sets the score for the review, where positive numbers indicate a better review for the specific user.

Parameters

review

a GsReview

 

score

a score value

 

gs_review_get_summary ()

const gchar *
gs_review_get_summary (GsReview *review);

Gets the review summary.

Parameters

review

a GsReview

 

Returns

the one-line summary, e.g. "Awesome application"


gs_review_set_summary ()

void
gs_review_set_summary (GsReview *review,
                       const gchar *summary);

Sets the one-line summary that may be displayed in bold.

Parameters

review

a GsReview

 

summary

a one-line summary, e.g. "Awesome application"

 

gs_review_get_text ()

const gchar *
gs_review_get_text (GsReview *review);

Gets the multi-line review text that forms the body of the review.

Parameters

review

a GsReview

 

Returns

the string, or NULL


gs_review_set_text ()

void
gs_review_set_text (GsReview *review,
                    const gchar *text);

Sets the multi-line review text that forms the body of the review.

Parameters

review

a GsReview

 

text

multi-line text

 

gs_review_get_rating ()

gint
gs_review_get_rating (GsReview *review);

Gets the star rating of the review, where 100 is 5 stars.

Parameters

review

a GsReview

 

Returns

integer as a percentage, or -1 for unset


gs_review_set_rating ()

void
gs_review_set_rating (GsReview *review,
                      gint rating);

Sets the star rating of the review, where 100 is 5 stars..

Parameters

review

a GsReview

 

rating

a integer as a percentage, or -1 for unset

 

gs_review_get_version ()

const gchar *
gs_review_get_version (GsReview *review);

Gets the version string for the application being reviewed..

Parameters

review

a GsReview

 

Returns

the version string, e.g. "0.1.2", or NULL for unset


gs_review_set_version ()

void
gs_review_set_version (GsReview *review,
                       const gchar *version);

Sets the version string for the application being reviewed.

Parameters

review

a GsReview

 

version

a version string, e.g. "0.1.2"

 

gs_review_get_reviewer ()

const gchar *
gs_review_get_reviewer (GsReview *review);

Gets the name of the reviewer.

Parameters

review

a GsReview

 

Returns

the reviewer name, e.g. "David Smith", or NULL


gs_review_set_reviewer ()

void
gs_review_set_reviewer (GsReview *review,
                        const gchar *reviewer);

Sets the name of the reviewer, which can be left unset.

Parameters

review

a GsReview

 

reviewer

the reviewer name, e.g. "David Smith"

 

gs_review_get_date ()

GDateTime *
gs_review_get_date (GsReview *review);

Gets the date the review was originally submitted.

Parameters

review

a GsReview

 

Returns

the GDateTime, or NULL for unset.

[transfer none]


gs_review_set_date ()

void
gs_review_set_date (GsReview *review,
                    GDateTime *date);

Sets the date the review was originally submitted.

Parameters

review

a GsReview

 

date

a GDateTime, or NULL

 

gs_review_get_flags ()

GsReviewFlags
gs_review_get_flags (GsReview *review);

Gets any flags set on the review, for example if the user has already voted on the review or if the user wrote the review themselves.

Parameters

review

a GsReview

 

gs_review_set_flags ()

void
gs_review_set_flags (GsReview *review,
                     GsReviewFlags flags);

Gets any flags set on the review, for example if the user has already voted on the review or if the user wrote the review themselves.

Parameters

review

a GsReview

 

flags

a GsReviewFlags, e.g. GS_REVIEW_FLAG_SELF

 

gs_review_add_flags ()

void
gs_review_add_flags (GsReview *review,
                     GsReviewFlags flags);

Adds flags to an existing review without replacing the other flags.

Parameters

review

a GsReview

 

flags

a GsReviewFlags, e.g. GS_REVIEW_FLAG_SELF

 

gs_review_get_metadata_item ()

const gchar *
gs_review_get_metadata_item (GsReview *review,
                             const gchar *key);

Gets some metadata from a review object. It is left for the the plugin to use this method as required, but a typical use would be to retrieve some secure authentication token.

Parameters

review

a GsReview

 

key

a string

 

Returns

A string value, or NULL for not found


gs_review_add_metadata ()

void
gs_review_add_metadata (GsReview *review,
                        const gchar *key,
                        const gchar *value);

Adds metadata to the review object. It is left for the the plugin to use this method as required, but a typical use would be to store some secure authentication token.

Parameters

review

a GsReview

 

key

a string

 

value

a string

 

Types and Values

GS_TYPE_REVIEW

#define GS_TYPE_REVIEW (gs_review_get_type ())

enum GsReviewAction

The review action.

Members

GS_REVIEW_ACTION_SUBMIT

Submit a new review

 

GS_REVIEW_ACTION_UPVOTE

Upvote an existing review

 

GS_REVIEW_ACTION_DOWNVOTE

Downvote an existing review

 

GS_REVIEW_ACTION_REPORT

Report an existing review

 

GS_REVIEW_ACTION_REMOVE

Remove a review written by the user

 

GS_REVIEW_ACTION_DISMISS

Dismiss (ignore) a review when moderating

 

enum GsReviewFlags

The flags for the review.

Members

GS_REVIEW_FLAG_NONE

No special flags set

 

GS_REVIEW_FLAG_SELF

The user wrote the review themselves

 

GS_REVIEW_FLAG_VOTED

The user voted on the review

 

GsReview

typedef struct _GsReview GsReview;

Property Details

The “date” property

  “date”                     GsReview *

Flags: Read / Write / Construct


The “flags” property

  “flags”                    guint64

Flags: Read / Write / Construct

Allowed values: <= 3

Default value: 0


The “karma” property

  “karma”                    gint

Flags: Read / Write / Construct

Default value: 0


The “rating” property

  “rating”                   gint

Flags: Read / Write / Construct

Allowed values: [-1,100]

Default value: -1


The “reviewer” property

  “reviewer”                 gchar *

Flags: Read / Write / Construct

Default value: NULL


The “summary” property

  “summary”                  gchar *

Flags: Read / Write / Construct

Default value: NULL


The “text” property

  “text”                     gchar *

Flags: Read / Write / Construct

Default value: NULL


The “version” property

  “version”                  gchar *

Flags: Read / Write / Construct

Default value: NULL