File: modulemd-translation-entry.h

package info (click to toggle)
libmodulemd 2.15.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,180 kB
  • sloc: ansic: 37,927; python: 3,233; xml: 1,739; sh: 389; makefile: 42
file content (181 lines) | stat: -rw-r--r-- 4,962 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
/*
 * This file is part of libmodulemd
 * Copyright (C) 2018 Red Hat, Inc.
 *
 * Fedora-License-Identifier: MIT
 * SPDX-2.0-License-Identifier: MIT
 * SPDX-3.0-License-Identifier: MIT
 *
 * This program is free software.
 * For more information on the license, see COPYING.
 * For more information on free software, see <https://www.gnu.org/philosophy/free-sw.en.html>.
 */

#pragma once

#include <glib-object.h>

G_BEGIN_DECLS

/**
 * SECTION: modulemd-translation-entry
 * @title: Modulemd.TranslationEntry
 * @stability: stable
 * @short_description: Contains the translated strings of a module stream for a specific locale.
 */

#define MODULEMD_TYPE_TRANSLATION_ENTRY                                       \
  (modulemd_translation_entry_get_type ())

G_DECLARE_FINAL_TYPE (ModulemdTranslationEntry,
                      modulemd_translation_entry,
                      MODULEMD,
                      TRANSLATION_ENTRY,
                      GObject)

/**
 * modulemd_translation_entry_new:
 * @locale: (not nullable): The locale for this translation entry.
 * It must correspond to the format specified by libc locale names.
 *
 * Returns: (transfer full): A newly-allocated #ModulemdTranslationEntry
 * object. This object must be freed with g_object_unref().
 *
 * Since: 2.0
 */
ModulemdTranslationEntry *
modulemd_translation_entry_new (const gchar *locale);


/**
 * modulemd_translation_entry_copy:
 * @self: This #ModulemdTranslationEntry object.
 *
 * Create a copy of this #ModulemdTranslationEntry object.
 *
 * Returns: (transfer full): The copied #ModulemdTranslationEntry object.
 *
 * Since: 2.0
 */
ModulemdTranslationEntry *
modulemd_translation_entry_copy (ModulemdTranslationEntry *self);


/**
 * modulemd_translation_entry_get_locale:
 * @self: This #ModulemdTranslationEntry object.
 *
 * Get the locale of this translation entry.
 *
 * Returns: (transfer none): The locale of this translation entry. This is a pointer
 * to the internal memory location and must not be freed.
 *
 * Since: 2.0
 */
const gchar *
modulemd_translation_entry_get_locale (ModulemdTranslationEntry *self);


/**
 * modulemd_translation_entry_set_summary:
 * @self: This #ModulemdTranslationEntry object.
 * @summary: (nullable): The summary of this module translated appropriately
 * for this locale.
 *
 * Since: 2.0
 */
void
modulemd_translation_entry_set_summary (ModulemdTranslationEntry *self,
                                        const gchar *summary);


/**
 * modulemd_translation_entry_get_summary:
 * @self: This #ModulemdTranslationEntry object.
 *
 * Get the summary of this translation entry.
 *
 * Returns: (transfer none): The summary of this module stream translated into
 * the language specified by locale.
 *
 * Since: 2.0
 */
const gchar *
modulemd_translation_entry_get_summary (ModulemdTranslationEntry *self);


/**
 * modulemd_translation_entry_set_description:
 * @self: This #ModulemdTranslationEntry object.
 * @description: (nullable): The description of this module stream translated
 * into the language specified by locale.
 *
 * Since: 2.0
 */
void
modulemd_translation_entry_set_description (ModulemdTranslationEntry *self,
                                            const char *description);


/**
 * modulemd_translation_entry_get_description:
 * @self: This #ModulemdTranslationEntry object.
 *
 * Get the description of this translation entry.
 *
 * Returns: (transfer none): The description of this module stream translated
 * into the language specified by locale.
 *
 * Since: 2.0
 */
const gchar *
modulemd_translation_entry_get_description (ModulemdTranslationEntry *self);


/**
 * modulemd_translation_entry_get_profiles_as_strv: (rename-to modulemd_translation_entry_get_profiles)
 * @self: This #ModulemdTranslationEntry object.
 *
 * Get a list of profiles that have descriptions.
 *
 * Returns: (transfer full): An ordered #GStrv list of profiles for which
 * descriptions have been translated for this locale.
 *
 * Since: 2.0
 */
GStrv
modulemd_translation_entry_get_profiles_as_strv (
  ModulemdTranslationEntry *self);


/**
 * modulemd_translation_entry_set_profile_description:
 * @self: This #ModulemdTranslationEntry object.
 * @profile_name: The name of the profile.
 * @profile_description: (nullable): The translated description of the profile.
 *
 * Adds a profile name translation.
 *
 * Since: 2.0
 */
void
modulemd_translation_entry_set_profile_description (
  ModulemdTranslationEntry *self,
  const gchar *profile_name,
  const gchar *profile_description);


/**
 * module_translation_entry_get_profile_description:
 * @self: This #ModulemdTranslationEntry object.
 * @profile_name: The name of the profile whose description is being translated.
 *
 * Returns: (transfer none): The description for the specified profile.
 *
 * Since: 2.0
 */
const gchar *
modulemd_translation_entry_get_profile_description (
  ModulemdTranslationEntry *self, const gchar *profile_name);

G_END_DECLS