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

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

Initial release

File size: 4.2 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.MenuLinkIter;
22
23private import gi.gio;
24public  import gi.giotypes;
25private import gio.MenuModel;
26private import glib.Str;
27private import gobject.ObjectG;
28
29
30/**
31 * #GMenuLinkIter is an opaque structure type.  You must access it using
32 * the functions below.
33 *
34 * Since: 2.32
35 */
36public class MenuLinkIter : ObjectG
37{
38        /** the main Gtk struct */
39        protected GMenuLinkIter* gMenuLinkIter;
40
41        /** Get the main Gtk struct */
42        public GMenuLinkIter* getMenuLinkIterStruct()
43        {
44                return gMenuLinkIter;
45        }
46
47        /** the main Gtk struct as a void* */
48        protected override void* getStruct()
49        {
50                return cast(void*)gMenuLinkIter;
51        }
52
53        protected override void setStruct(GObject* obj)
54        {
55                gMenuLinkIter = cast(GMenuLinkIter*)obj;
56                super.setStruct(obj);
57        }
58
59        /**
60         * Sets our main struct and passes it to the parent class.
61         */
62        public this (GMenuLinkIter* gMenuLinkIter, bool ownedRef = false)
63        {
64                this.gMenuLinkIter = gMenuLinkIter;
65                super(cast(GObject*)gMenuLinkIter, ownedRef);
66        }
67
68
69        /** */
70        public static GType getType()
71        {
72                return g_menu_link_iter_get_type();
73        }
74
75        /**
76         * Gets the name of the link at the current iterator position.
77         *
78         * The iterator is not advanced.
79         *
80         * Returns: the type of the link
81         *
82         * Since: 2.32
83         */
84        public string getName()
85        {
86                return Str.toString(g_menu_link_iter_get_name(gMenuLinkIter));
87        }
88
89        /**
90         * This function combines g_menu_link_iter_next() with
91         * g_menu_link_iter_get_name() and g_menu_link_iter_get_value().
92         *
93         * First the iterator is advanced to the next (possibly first) link.
94         * If that fails, then %FALSE is returned and there are no other effects.
95         *
96         * If successful, @out_link and @value are set to the name and #GMenuModel
97         * of the link that has just been advanced to.  At this point,
98         * g_menu_link_iter_get_name() and g_menu_link_iter_get_value() will return the
99         * same values again.
100         *
101         * The value returned in @out_link remains valid for as long as the iterator
102         * remains at the current position.  The value returned in @value must
103         * be unreffed using g_object_unref() when it is no longer in use.
104         *
105         * Params:
106         *     outLink = the name of the link
107         *     value = the linked #GMenuModel
108         *
109         * Returns: %TRUE on success, or %FALSE if there is no additional link
110         *
111         * Since: 2.32
112         */
113        public bool getNext(out string outLink, out MenuModel value)
114        {
115                char* outoutLink = null;
116                GMenuModel* outvalue = null;
117               
118                auto p = g_menu_link_iter_get_next(gMenuLinkIter, &outoutLink, &outvalue) != 0;
119               
120                outLink = Str.toString(outoutLink);
121                value = ObjectG.getDObject!(MenuModel)(outvalue);
122               
123                return p;
124        }
125
126        /**
127         * Gets the linked #GMenuModel at the current iterator position.
128         *
129         * The iterator is not advanced.
130         *
131         * Returns: the #GMenuModel that is linked to
132         *
133         * Since: 2.32
134         */
135        public MenuModel getValue()
136        {
137                auto p = g_menu_link_iter_get_value(gMenuLinkIter);
138               
139                if(p is null)
140                {
141                        return null;
142                }
143               
144                return ObjectG.getDObject!(MenuModel)(cast(GMenuModel*) p, true);
145        }
146
147        /**
148         * Attempts to advance the iterator to the next (possibly first)
149         * link.
150         *
151         * %TRUE is returned on success, or %FALSE if there are no more links.
152         *
153         * You must call this function when you first acquire the iterator to
154         * advance it to the first link (and determine if the first link exists
155         * at all).
156         *
157         * Returns: %TRUE on success, or %FALSE when there are no more links
158         *
159         * Since: 2.32
160         */
161        public bool next()
162        {
163                return g_menu_link_iter_next(gMenuLinkIter) != 0;
164        }
165}
Note: See TracBrowser for help on using the repository browser.