1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module gtk.ActionableIF;
26 
27 private import glib.Str;
28 private import glib.Variant;
29 private import gtk.c.functions;
30 public  import gtk.c.types;
31 public  import gtkc.gtktypes;
32 
33 
34 /**
35  * This interface provides a convenient way of associating widgets with
36  * actions on a #GtkApplicationWindow or #GtkApplication.
37  * 
38  * It primarily consists of two properties: #GtkActionable:action-name
39  * and #GtkActionable:action-target. There are also some convenience APIs
40  * for setting these properties.
41  * 
42  * The action will be looked up in action groups that are found among
43  * the widgets ancestors. Most commonly, these will be the actions with
44  * the “win.” or “app.” prefix that are associated with the #GtkApplicationWindow
45  * or #GtkApplication, but other action groups that are added with
46  * gtk_widget_insert_action_group() will be consulted as well.
47  */
48 public interface ActionableIF{
49 	/** Get the main Gtk struct */
50 	public GtkActionable* getActionableStruct(bool transferOwnership = false);
51 
52 	/** the main Gtk struct as a void* */
53 	protected void* getStruct();
54 
55 
56 	/** */
57 	public static GType getType()
58 	{
59 		return gtk_actionable_get_type();
60 	}
61 
62 	/**
63 	 * Gets the action name for @actionable.
64 	 *
65 	 * See gtk_actionable_set_action_name() for more information.
66 	 *
67 	 * Returns: the action name, or %NULL if none is set
68 	 *
69 	 * Since: 3.4
70 	 */
71 	public string getActionName();
72 
73 	/**
74 	 * Gets the current target value of @actionable.
75 	 *
76 	 * See gtk_actionable_set_action_target_value() for more information.
77 	 *
78 	 * Returns: the current target value
79 	 *
80 	 * Since: 3.4
81 	 */
82 	public Variant getActionTargetValue();
83 
84 	/**
85 	 * Specifies the name of the action with which this widget should be
86 	 * associated.  If @action_name is %NULL then the widget will be
87 	 * unassociated from any previous action.
88 	 *
89 	 * Usually this function is used when the widget is located (or will be
90 	 * located) within the hierarchy of a #GtkApplicationWindow.
91 	 *
92 	 * Names are of the form “win.save” or “app.quit” for actions on the
93 	 * containing #GtkApplicationWindow or its associated #GtkApplication,
94 	 * respectively.  This is the same form used for actions in the #GMenu
95 	 * associated with the window.
96 	 *
97 	 * Params:
98 	 *     actionName = an action name, or %NULL
99 	 *
100 	 * Since: 3.4
101 	 */
102 	public void setActionName(string actionName);
103 
104 	/**
105 	 * Sets the target value of an actionable widget.
106 	 *
107 	 * If @target_value is %NULL then the target value is unset.
108 	 *
109 	 * The target value has two purposes.  First, it is used as the
110 	 * parameter to activation of the action associated with the
111 	 * #GtkActionable widget. Second, it is used to determine if the widget
112 	 * should be rendered as “active” — the widget is active if the state
113 	 * is equal to the given target.
114 	 *
115 	 * Consider the example of associating a set of buttons with a #GAction
116 	 * with string state in a typical “radio button” situation.  Each button
117 	 * will be associated with the same action, but with a different target
118 	 * value for that action.  Clicking on a particular button will activate
119 	 * the action with the target of that button, which will typically cause
120 	 * the action’s state to change to that value.  Since the action’s state
121 	 * is now equal to the target value of the button, the button will now
122 	 * be rendered as active (and the other buttons, with different targets,
123 	 * rendered inactive).
124 	 *
125 	 * Params:
126 	 *     targetValue = a #GVariant to set as the target value, or %NULL
127 	 *
128 	 * Since: 3.4
129 	 */
130 	public void setActionTargetValue(Variant targetValue);
131 
132 	/**
133 	 * Sets the action-name and associated string target value of an
134 	 * actionable widget.
135 	 *
136 	 * @detailed_action_name is a string in the format accepted by
137 	 * g_action_parse_detailed_name().
138 	 *
139 	 * (Note that prior to version 3.22.25,
140 	 * this function is only usable for actions with a simple "s" target, and
141 	 * @detailed_action_name must be of the form `"action::target"` where
142 	 * `action` is the action name and `target` is the string to use
143 	 * as the target.)
144 	 *
145 	 * Params:
146 	 *     detailedActionName = the detailed action name
147 	 *
148 	 * Since: 3.4
149 	 */
150 	public void setDetailedActionName(string detailedActionName);
151 }