AsScreenshot

## AsScreenshot AsScreenshot — Object representing a single screenshot |

## Functions

AsScreenshotKind | as_screenshot_kind_from_string ()
const gchar * | as_screenshot_kind_to_string ()
gboolean | as_screenshot_is_valid ()
AsScreenshot * | as_screenshot_new ()
AsScreenshotKind | as_screenshot_get_kind ()
void | as_screenshot_set_kind ()
AsScreenshotMediaKind | as_screenshot_get_media_kind ()
const gchar * | as_screenshot_get_caption ()
void | as_screenshot_set_caption ()
GPtrArray * | as_screenshot_get_images_all ()
GPtrArray * | as_screenshot_get_images ()
AsImage * | as_screenshot_get_image ()
void | as_screenshot_add_image ()
void | as_screenshot_clear_images ()
GPtrArray * | as_screenshot_get_videos_all ()
GPtrArray * | as_screenshot_get_videos ()
void | as_screenshot_add_video ()
const gchar * | as_screenshot_get_active_locale ()
void | as_screenshot_set_active_locale ()

## Types and Values

#define | AS_TYPE_SCREENSHOT
struct | AsScreenshotClass
enum | AsScreenshotKind
enum | AsScreenshotMediaKind
| AsScreenshot

## Description

Screenshots have a localized caption and contain either a set of images of different resolution or a video screencast showcasing the software.

See also: AsImage, AsVideo

## Functions

### as_screenshot_kind_from_string ()

    AsScreenshotKind
    as_screenshot_kind_from_string (const gchar *kind);

Converts the text representation to an enumerated value.

#### Parameters

kind | the string. |

#### Returns

a `AsScreenshotKind`, or `AS_SCREENSHOT_KIND_UNKNOWN` if not known.

### as_screenshot_kind_to_string ()

    const gchar *
    as_screenshot_kind_to_string (AsScreenshotKind kind);

Converts the enumerated value to an text representation.

#### Parameters

kind | the AsScreenshotKind. |

#### Returns

string version of `kind`

### as_screenshot_is_valid ()

    gboolean
    as_screenshot_is_valid (AsScreenshot *screenshot);

Performs a quick validation on this screenshot

#### Parameters

screenshot | a AsScreenshot instance. |

#### Returns

TRUE if the screenshot is a complete AsScreenshot

### as_screenshot_new ()

    AsScreenshot *
    as_screenshot_new (void);

Creates a new AsScreenshot.

#### Returns

a AsScreenshot.

[transfer full]

### as_screenshot_get_kind ()

    AsScreenshotKind
    as_screenshot_get_kind (AsScreenshot *screenshot);

Gets the screenshot kind.

#### Parameters

screenshot | a AsScreenshot instance. |

#### Returns

a AsScreenshotKind

### as_screenshot_set_kind ()

    void
    as_screenshot_set_kind (AsScreenshot *screenshot,
                            AsScreenshotKind kind);

Sets the screenshot kind.

#### Parameters

screenshot | a AsScreenshot instance. |
kind | the AsScreenshotKind. |

### as_screenshot_get_media_kind ()

    AsScreenshotMediaKind
    as_screenshot_get_media_kind (AsScreenshot *screenshot);

Gets the screenshot media kind.

#### Parameters

screenshot | a AsScreenshot instance. |

#### Returns

a AsScreenshotMediaKind

### as_screenshot_get_caption ()

    const gchar *
    as_screenshot_get_caption (AsScreenshot *screenshot);

Gets the image caption

#### Parameters

screenshot | a AsScreenshot instance. |

#### Returns

the caption

### as_screenshot_set_caption ()

    void
    as_screenshot_set_caption (AsScreenshot *screenshot,
                               const gchar *caption,
                               const gchar *locale);

Sets a caption on the screenshot

#### Parameters

screenshot | a AsScreenshot instance. |
caption | the caption text. |

### as_screenshot_get_images_all ()

    GPtrArray *
    as_screenshot_get_images_all (AsScreenshot *screenshot);

Returns an array of all images we have, regardless of their size and language.

#### Parameters

screenshot | an AsScreenshot instance. |

#### Returns

an array.

[transfer none][element-type AsImage]

Since: 0.10

### as_screenshot_get_images ()

    GPtrArray *
    as_screenshot_get_images (AsScreenshot *screenshot);

Gets the images for this screenshots. Only images valid for the current language are returned. We return all sizes.

#### Parameters

screenshot | a AsScreenshot instance. |

#### Returns

an array.

[transfer none][element-type AsImage]

### as_screenshot_get_image ()

    AsImage *
    as_screenshot_get_image (AsScreenshot *screenshot,
                             guint width,
                             guint height);

Gets the AsImage closest to the target size. The AsImage may not actually be the requested size, and the application may have to pad / rescale the image to make it fit. Only images for the current active locale (or fallback, if images are not localized) are considered.

#### Parameters

screenshot | a AsScreenshot instance. |
width | target width |
height | target height |

#### Returns

an AsImage, or `NULL`.

[transfer none]

Since: 0.14.0

### as_screenshot_add_image ()

    void
    as_screenshot_add_image (AsScreenshot *screenshot,
                             AsImage *image);

Adds an image to the screenshot.

#### Parameters

screenshot | a AsScreenshot instance. |
image | a AsImage instance. |

### as_screenshot_clear_images ()

    void
    as_screenshot_clear_images (AsScreenshot *screenshot);

Remove all images associated with this screenshot.

#### Parameters

screenshot | a AsScreenshot instance. |

Since: 0.15.4

### as_screenshot_get_videos_all ()

    GPtrArray *
    as_screenshot_get_videos_all (AsScreenshot *screenshot);

Returns an array of all screencast videos we have, regardless of their size and locale.

#### Parameters

screenshot | a AsScreenshot instance. |

#### Returns

an array.

[transfer none][element-type AsVideo]

### as_screenshot_get_videos ()

    GPtrArray *
    as_screenshot_get_videos (AsScreenshot *screenshot);

Gets the videos for this screenshots. Only videos valid for the current language selection are returned. We return all sizes.

#### Parameters

screenshot | a AsScreenshot instance. |

#### Returns

an array.

[transfer none][element-type AsVideo]

### as_screenshot_add_video ()

    void
    as_screenshot_add_video (AsScreenshot *screenshot,
                             AsVideo *video);

Adds a video to the screenshot.

#### Parameters

screenshot | a AsScreenshot instance. |
video | a AsVideo instance. |

### as_screenshot_get_active_locale ()

    const gchar *
    as_screenshot_get_active_locale (AsScreenshot *screenshot);

Get the current active locale, which is used to get localized messages.

### as_screenshot_set_active_locale ()

    void
    as_screenshot_set_active_locale (AsScreenshot *screenshot,
                                     const gchar *locale);

Set the current active locale, which is used to get localized messages. If the AsComponent linking this AsScreenshot was fetched from a localized database, usually only one locale is available.

#### Parameters

screenshot | a AsScreenshot instance. |
locale | a POSIX or BCP47 locale, or `NULL`. e.g. "de_DE". | [nullable]

## Types and Values

### AS_TYPE_SCREENSHOT

    #define AS_TYPE_SCREENSHOT (as_screenshot_get_type ())

### struct AsScreenshotClass

    struct AsScreenshotClass {
    	GObjectClass		parent_class;
    };

### enum AsScreenshotKind

The screenshot type.

#### Members

AS_SCREENSHOT_KIND_UNKNOWN | Type invalid or not known |
AS_SCREENSHOT_KIND_DEFAULT | The primary screenshot to show by default |
AS_SCREENSHOT_KIND_EXTRA | Optional screenshot |

### enum AsScreenshotMediaKind

The media kind contained in this screenshot.

#### Members

AS_SCREENSHOT_MEDIA_KIND_UNKNOWN | Media kind is unknown |
AS_SCREENSHOT_MEDIA_KIND_IMAGE | The screenshot contains images |
AS_SCREENSHOT_MEDIA_KIND_VIDEO | The screenshot contains videos |

### AsScreenshot

    typedef struct _AsScreenshot AsScreenshot;