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

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

Initial release

File size: 4.7 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.SimpleActionGroup;
22
23private import gi.gio;
24public  import gi.giotypes;
25private import gio.Action;
26private import gio.ActionGroupIF;
27private import gio.ActionGroupT;
28private import gio.ActionIF;
29private import gio.ActionMapIF;
30private import gio.ActionMapT;
31private import glib.ConstructionException;
32private import glib.Str;
33private import gobject.ObjectG;
34
35
36/**
37 * #GSimpleActionGroup is a hash table filled with #GAction objects,
38 * implementing the #GActionGroup and #GActionMap interfaces.
39 *
40 * Since: 2.28
41 */
42public class SimpleActionGroup : ObjectG, ActionGroupIF, ActionMapIF
43{
44        /** the main Gtk struct */
45        protected GSimpleActionGroup* gSimpleActionGroup;
46
47        /** Get the main Gtk struct */
48        public GSimpleActionGroup* getSimpleActionGroupStruct()
49        {
50                return gSimpleActionGroup;
51        }
52
53        /** the main Gtk struct as a void* */
54        protected override void* getStruct()
55        {
56                return cast(void*)gSimpleActionGroup;
57        }
58
59        protected override void setStruct(GObject* obj)
60        {
61                gSimpleActionGroup = cast(GSimpleActionGroup*)obj;
62                super.setStruct(obj);
63        }
64
65        /**
66         * Sets our main struct and passes it to the parent class.
67         */
68        public this (GSimpleActionGroup* gSimpleActionGroup, bool ownedRef = false)
69        {
70                this.gSimpleActionGroup = gSimpleActionGroup;
71                super(cast(GObject*)gSimpleActionGroup, ownedRef);
72        }
73
74        // add the ActionGroup capabilities
75        mixin ActionGroupT!(GSimpleActionGroup);
76
77        // add the ActionMap capabilities
78        mixin ActionMapT!(GSimpleActionGroup);
79
80
81        /** */
82        public static GType getType()
83        {
84                return g_simple_action_group_get_type();
85        }
86
87        /**
88         * Creates a new, empty, #GSimpleActionGroup.
89         *
90         * Returns: a new #GSimpleActionGroup
91         *
92         * Since: 2.28
93         *
94         * Throws: ConstructionException GTK+ fails to create the object.
95         */
96        public this()
97        {
98                auto p = g_simple_action_group_new();
99               
100                if(p is null)
101                {
102                        throw new ConstructionException("null returned by new");
103                }
104               
105                this(cast(GSimpleActionGroup*) p, true);
106        }
107
108        /**
109         * A convenience function for creating multiple #GSimpleAction instances
110         * and adding them to the action group.
111         *
112         * Deprecated: Use g_action_map_add_action_entries()
113         *
114         * Params:
115         *     entries = a pointer to the first item in
116         *         an array of #GActionEntry structs
117         *     nEntries = the length of @entries, or -1
118         *     userData = the user data for signal connections
119         *
120         * Since: 2.30
121         */
122        public void addEntries(GActionEntry[] entries, void* userData)
123        {
124                g_simple_action_group_add_entries(gSimpleActionGroup, entries.ptr, cast(int)entries.length, userData);
125        }
126
127        /**
128         * Adds an action to the action group.
129         *
130         * If the action group already contains an action with the same name as
131         * @action then the old action is dropped from the group.
132         *
133         * The action group takes its own reference on @action.
134         *
135         * Deprecated: Use g_action_map_add_action()
136         *
137         * Params:
138         *     action = a #GAction
139         *
140         * Since: 2.28
141         */
142        public void insert(ActionIF action)
143        {
144                g_simple_action_group_insert(gSimpleActionGroup, (action is null) ? null : action.getActionStruct());
145        }
146
147        /**
148         * Looks up the action with the name @action_name in the group.
149         *
150         * If no such action exists, returns %NULL.
151         *
152         * Deprecated: Use g_action_map_lookup_action()
153         *
154         * Params:
155         *     actionName = the name of an action
156         *
157         * Returns: a #GAction, or %NULL
158         *
159         * Since: 2.28
160         */
161        public ActionIF lookup(string actionName)
162        {
163                auto p = g_simple_action_group_lookup(gSimpleActionGroup, Str.toStringz(actionName));
164               
165                if(p is null)
166                {
167                        return null;
168                }
169               
170                return ObjectG.getDObject!(Action, ActionIF)(cast(GAction*) p);
171        }
172
173        /**
174         * Removes the named action from the action group.
175         *
176         * If no action of this name is in the group then nothing happens.
177         *
178         * Deprecated: Use g_action_map_remove_action()
179         *
180         * Params:
181         *     actionName = the name of the action
182         *
183         * Since: 2.28
184         */
185        public void remove(string actionName)
186        {
187                g_simple_action_group_remove(gSimpleActionGroup, Str.toStringz(actionName));
188        }
189}
Note: See TracBrowser for help on using the repository browser.