1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- 2 * 3 * Copyright (C) 2016 Richard Hughes <richard@hughsie.com> 4 * 5 * SPDX-License-Identifier: LGPL-2.1+ 6 */ 7 8 #pragma once 9 10 #if !defined (__APPSTREAM_GLIB_H_INSIDE__) && !defined (AS_COMPILATION) 11 #error "Only <appstream-glib.h> can be included directly." 12 #endif 13 14 #include <glib-object.h> 15 16 G_BEGIN_DECLS 17 18 #define AS_TYPE_TRANSLATION (as_translation_get_type ()) 19 G_DECLARE_DERIVABLE_TYPE (AsTranslation, as_translation, AS, TRANSLATION, GObject) 20 21 struct _AsTranslationClass 22 { 23 GObjectClass parent_class; 24 /*< private >*/ 25 void (*_as_reserved1) (void); 26 void (*_as_reserved2) (void); 27 void (*_as_reserved3) (void); 28 void (*_as_reserved4) (void); 29 void (*_as_reserved5) (void); 30 void (*_as_reserved6) (void); 31 void (*_as_reserved7) (void); 32 void (*_as_reserved8) (void); 33 }; 34 35 /** 36 * AsTranslationKind: 37 * @AS_TRANSLATION_KIND_UNKNOWN: Type invalid or not known 38 * @AS_TRANSLATION_KIND_GETTEXT: Gettext translation system 39 * @AS_TRANSLATION_KIND_QT: QT translation system 40 * 41 * The translation type. 42 **/ 43 typedef enum { 44 AS_TRANSLATION_KIND_UNKNOWN, /* Since: 0.5.7 */ 45 AS_TRANSLATION_KIND_GETTEXT, /* Since: 0.5.7 */ 46 AS_TRANSLATION_KIND_QT, /* Since: 0.5.8 */ 47 /*< private >*/ 48 AS_TRANSLATION_KIND_LAST 49 } AsTranslationKind; 50 51 AsTranslation *as_translation_new (void); 52 53 /* helpers */ 54 AsTranslationKind as_translation_kind_from_string (const gchar *kind); 55 const gchar *as_translation_kind_to_string (AsTranslationKind kind); 56 57 /* getters */ 58 const gchar *as_translation_get_id (AsTranslation *translation); 59 AsTranslationKind as_translation_get_kind (AsTranslation *translation); 60 61 /* setters */ 62 void as_translation_set_id (AsTranslation *translation, 63 const gchar *id); 64 void as_translation_set_kind (AsTranslation *translation, 65 AsTranslationKind kind); 66 67 G_END_DECLS 68