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

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

Initial release

File size: 3.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 gio.EmblemedIcon;
22
23private import gi.gio;
24public  import gi.giotypes;
25private import gio.Emblem;
26private import gio.Icon;
27private import gio.IconIF;
28private import gio.IconT;
29private import glib.ConstructionException;
30private import glib.ListG;
31private import gobject.ObjectG;
32
33
34/**
35 * #GEmblemedIcon is an implementation of #GIcon that supports
36 * adding an emblem to an icon. Adding multiple emblems to an
37 * icon is ensured via g_emblemed_icon_add_emblem().
38 *
39 * Note that #GEmblemedIcon allows no control over the position
40 * of the emblems. See also #GEmblem for more information.
41 */
42public class EmblemedIcon : ObjectG, IconIF
43{
44        /** the main Gtk struct */
45        protected GEmblemedIcon* gEmblemedIcon;
46
47        /** Get the main Gtk struct */
48        public GEmblemedIcon* getEmblemedIconStruct()
49        {
50                return gEmblemedIcon;
51        }
52
53        /** the main Gtk struct as a void* */
54        protected override void* getStruct()
55        {
56                return cast(void*)gEmblemedIcon;
57        }
58
59        protected override void setStruct(GObject* obj)
60        {
61                gEmblemedIcon = cast(GEmblemedIcon*)obj;
62                super.setStruct(obj);
63        }
64
65        /**
66         * Sets our main struct and passes it to the parent class.
67         */
68        public this (GEmblemedIcon* gEmblemedIcon, bool ownedRef = false)
69        {
70                this.gEmblemedIcon = gEmblemedIcon;
71                super(cast(GObject*)gEmblemedIcon, ownedRef);
72        }
73
74        // add the Icon capabilities
75        mixin IconT!(GEmblemedIcon);
76
77
78        /** */
79        public static GType getType()
80        {
81                return g_emblemed_icon_get_type();
82        }
83
84        /**
85         * Creates a new emblemed icon for @icon with the emblem @emblem.
86         *
87         * Params:
88         *     icon = a #GIcon
89         *     emblem = a #GEmblem, or %NULL
90         *
91         * Returns: a new #GIcon
92         *
93         * Since: 2.18
94         *
95         * Throws: ConstructionException GTK+ fails to create the object.
96         */
97        public this(IconIF icon, Emblem emblem)
98        {
99                auto p = g_emblemed_icon_new((icon is null) ? null : icon.getIconStruct(), (emblem is null) ? null : emblem.getEmblemStruct());
100               
101                if(p is null)
102                {
103                        throw new ConstructionException("null returned by new");
104                }
105               
106                this(cast(GEmblemedIcon*) p, true);
107        }
108
109        /**
110         * Adds @emblem to the #GList of #GEmblems.
111         *
112         * Params:
113         *     emblem = a #GEmblem
114         *
115         * Since: 2.18
116         */
117        public void addEmblem(Emblem emblem)
118        {
119                g_emblemed_icon_add_emblem(gEmblemedIcon, (emblem is null) ? null : emblem.getEmblemStruct());
120        }
121
122        /**
123         * Removes all the emblems from @icon.
124         *
125         * Since: 2.28
126         */
127        public void clearEmblems()
128        {
129                g_emblemed_icon_clear_emblems(gEmblemedIcon);
130        }
131
132        /**
133         * Gets the list of emblems for the @icon.
134         *
135         * Returns: a #GList of
136         *     #GEmblems that is owned by @emblemed
137         *
138         * Since: 2.18
139         */
140        public ListG getEmblems()
141        {
142                auto p = g_emblemed_icon_get_emblems(gEmblemedIcon);
143               
144                if(p is null)
145                {
146                        return null;
147                }
148               
149                return new ListG(cast(GList*) p);
150        }
151
152        /**
153         * Gets the main icon for @emblemed.
154         *
155         * Returns: a #GIcon that is owned by @emblemed
156         *
157         * Since: 2.18
158         */
159        public IconIF getIcon()
160        {
161                auto p = g_emblemed_icon_get_icon(gEmblemedIcon);
162               
163                if(p is null)
164                {
165                        return null;
166                }
167               
168                return ObjectG.getDObject!(Icon, IconIF)(cast(GIcon*) p);
169        }
170}
Note: See TracBrowser for help on using the repository browser.