source: appstream-generator/build/girepo/appstream/Translation.d @ 4841

Last change on this file since 4841 was 4841, checked in by Juanma, 2 years ago

Initial release

File size: 3.4 KB
Line 
1/*
2 * Licensed under the GNU Lesser General Public License Version 3
3 *
4 * This library is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation, either version 3 of the license, or
7 * (at your option) any later version.
8 *
9 * This software is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 * GNU Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this library.  If not, see <http://www.gnu.org/licenses/>.
16 */
17
18// generated automatically - do not change
19
20
21module appstream.Translation;
22
23private import gi.appstream;
24public  import gi.appstreamtypes;
25private import glib.ConstructionException;
26private import glib.Str;
27private import gobject.ObjectG;
28
29
30/** */
31public class Translation : ObjectG
32{
33        /** the main Gtk struct */
34        protected AsTranslation* asTranslation;
35
36        /** Get the main Gtk struct */
37        public AsTranslation* getTranslationStruct()
38        {
39                return asTranslation;
40        }
41
42        /** the main Gtk struct as a void* */
43        protected override void* getStruct()
44        {
45                return cast(void*)asTranslation;
46        }
47
48        protected override void setStruct(GObject* obj)
49        {
50                asTranslation = cast(AsTranslation*)obj;
51                super.setStruct(obj);
52        }
53
54        /**
55         * Sets our main struct and passes it to the parent class.
56         */
57        public this (AsTranslation* asTranslation, bool ownedRef = false)
58        {
59                this.asTranslation = asTranslation;
60                super(cast(GObject*)asTranslation, ownedRef);
61        }
62
63
64        /** */
65        public static GType getType()
66        {
67                return as_translation_get_type();
68        }
69
70        /**
71         * Creates a new #AsTranslation.
72         *
73         * Returns: a #AsTranslation
74         *
75         * Throws: ConstructionException GTK+ fails to create the object.
76         */
77        public this()
78        {
79                auto p = as_translation_new();
80               
81                if(p is null)
82                {
83                        throw new ConstructionException("null returned by new");
84                }
85               
86                this(cast(AsTranslation*) p, true);
87        }
88
89        /**
90         * Converts the text representation to an enumerated value.
91         *
92         * Params:
93         *     kindStr = the string.
94         *
95         * Returns: a #AsTranslationKind or %AS_TRANSLATION_KIND_UNKNOWN for unknown
96         */
97        public static AsTranslationKind kindFromString(string kindStr)
98        {
99                return as_translation_kind_from_string(Str.toStringz(kindStr));
100        }
101
102        /**
103         * Converts the enumerated value to a text representation.
104         *
105         * Params:
106         *     kind = the #AsTranslationKind.
107         *
108         * Returns: string version of @kind
109         */
110        public static string kindToString(AsTranslationKind kind)
111        {
112                return Str.toString(as_translation_kind_to_string(kind));
113        }
114
115        /**
116         * The ID (e.g. Gettext translation domain) of this translation.
117         */
118        public string getId()
119        {
120                return Str.toString(as_translation_get_id(asTranslation));
121        }
122
123        /**
124         * The translation system type.
125         *
126         * Returns: an enum of type #AsTranslationKind
127         */
128        public AsTranslationKind getKind()
129        {
130                return as_translation_get_kind(asTranslation);
131        }
132
133        /**
134         * Set the ID (e.g. Gettext domain) of this translation.
135         *
136         * Params:
137         *     id = The ID of this translation.
138         */
139        public void setId(string id)
140        {
141                as_translation_set_id(asTranslation, Str.toStringz(id));
142        }
143
144        /**
145         * Set the translation system type.
146         *
147         * Params:
148         *     kind = the new #AsTranslationKind
149         */
150        public void setKind(AsTranslationKind kind)
151        {
152                as_translation_set_kind(asTranslation, kind);
153        }
154}
Note: See TracBrowser for help on using the repository browser.