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

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

Initial release

File size: 2.8 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.DistroDetails;
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 DistroDetails : ObjectG
32{
33        /** the main Gtk struct */
34        protected AsDistroDetails* asDistroDetails;
35
36        /** Get the main Gtk struct */
37        public AsDistroDetails* getDistroDetailsStruct()
38        {
39                return asDistroDetails;
40        }
41
42        /** the main Gtk struct as a void* */
43        protected override void* getStruct()
44        {
45                return cast(void*)asDistroDetails;
46        }
47
48        protected override void setStruct(GObject* obj)
49        {
50                asDistroDetails = cast(AsDistroDetails*)obj;
51                super.setStruct(obj);
52        }
53
54        /**
55         * Sets our main struct and passes it to the parent class.
56         */
57        public this (AsDistroDetails* asDistroDetails, bool ownedRef = false)
58        {
59                this.asDistroDetails = asDistroDetails;
60                super(cast(GObject*)asDistroDetails, ownedRef);
61        }
62
63
64        /** */
65        public static GType getType()
66        {
67                return as_distro_details_get_type();
68        }
69
70        /**
71         * Creates a new instance of #AsDistroDetails.
72         *
73         * Returns: a #AsDistroDetails.
74         *
75         * Throws: ConstructionException GTK+ fails to create the object.
76         */
77        public this()
78        {
79                auto p = as_distro_details_new();
80               
81                if(p is null)
82                {
83                        throw new ConstructionException("null returned by new");
84                }
85               
86                this(cast(AsDistroDetails*) p, true);
87        }
88
89        /** */
90        public bool getBool(string key, bool defaultVal)
91        {
92                return as_distro_details_get_bool(asDistroDetails, Str.toStringz(key), defaultVal) != 0;
93        }
94
95        /** */
96        public string getId()
97        {
98                return Str.toString(as_distro_details_get_id(asDistroDetails));
99        }
100
101        /** */
102        public string getName()
103        {
104                return Str.toString(as_distro_details_get_name(asDistroDetails));
105        }
106
107        /** */
108        public string getStr(string key)
109        {
110                auto retStr = as_distro_details_get_str(asDistroDetails, Str.toStringz(key));
111               
112                scope(exit) Str.freeString(retStr);
113                return Str.toString(retStr);
114        }
115
116        /** */
117        public string getVersion()
118        {
119                return Str.toString(as_distro_details_get_version(asDistroDetails));
120        }
121}
Note: See TracBrowser for help on using the repository browser.