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  * Conversion parameters:
26  * inFile  = GtkActivatable.html
27  * outPack = gtk
28  * outFile = ActivatableIF
29  * strct   = GtkActivatable
30  * realStrct=
31  * ctorStrct=
32  * clss    = ActivatableT
33  * interf  = ActivatableIF
34  * class Code: No
35  * interface Code: No
36  * template for:
37  * extend  = 
38  * implements:
39  * prefixes:
40  * 	- gtk_activatable_
41  * omit structs:
42  * omit prefixes:
43  * omit code:
44  * omit signals:
45  * imports:
46  * 	- gtk.Action
47  * structWrap:
48  * 	- GtkAction* -> Action
49  * module aliases:
50  * local aliases:
51  * overrides:
52  */
53 
54 module gtk.ActivatableIF;
55 
56 public  import gtkc.gtktypes;
57 
58 private import gtkc.gtk;
59 private import glib.ConstructionException;
60 private import gobject.ObjectG;
61 
62 
63 private import gtk.Action;
64 
65 
66 
67 
68 /**
69  * Description
70  * Activatable widgets can be connected to a GtkAction and reflects
71  * the state of its action. A GtkActivatable can also provide feedback
72  * through its action, as they are responsible for activating their
73  * related actions.
74  * Implementing GtkActivatable
75  * When extending a class that is already GtkActivatable; it is only
76  * necessary to implement the GtkActivatable->sync_action_properties()
77  * and GtkActivatable->update() methods and chain up to the parent
78  * implementation, however when introducing
79  * a new GtkActivatable class; the "related-action" and
80  * "use-action-appearance" properties need to be handled by
81  * the implementor. Handling these properties is mostly a matter of installing
82  * the action pointer and boolean flag on your instance, and calling
83  * gtk_activatable_do_set_related_action() and
84  * gtk_activatable_sync_action_properties() at the appropriate times.
85  * $(DDOC_COMMENT example)
86  */
87 public interface ActivatableIF
88 {
89 	
90 	
91 	public GtkActivatable* getActivatableTStruct();
92 	
93 	/** the main Gtk struct as a void* */
94 	protected void* getStruct();
95 	
96 	
97 	/**
98 	 */
99 	
100 	/**
101 	 * This is a utility function for GtkActivatable implementors.
102 	 * When implementing GtkActivatable you must call this when
103 	 * handling changes of the "related-action", and
104 	 * you must also use this to break references in GObject->dispose().
105 	 * This function adds a reference to the currently set related
106 	 * action for you, it also makes sure the GtkActivatable->update()
107 	 * method is called when the related GtkAction properties change
108 	 * and registers to the action's proxy list.
109 	 * Note
110 	 * Be careful to call this before setting the local
111 	 * copy of the GtkAction property, since this function uses
112 	 * gtk_activatable_get_action() to retrieve the previous action
113 	 * Since 2.16
114 	 * Params:
115 	 * action = the GtkAction to set
116 	 */
117 	public void doSetRelatedAction(Action action);
118 	
119 	/**
120 	 * Gets the related GtkAction for activatable.
121 	 * Since 2.16
122 	 * Returns: the related GtkAction if one is set. [transfer none]
123 	 */
124 	public Action getRelatedAction();
125 	
126 	/**
127 	 * Gets whether this activatable should reset its layout
128 	 * and appearance when setting the related action or when
129 	 * the action changes appearance.
130 	 * Since 2.16
131 	 * Returns: whether activatable uses its actions appearance.
132 	 */
133 	public int getUseActionAppearance();
134 	
135 	/**
136 	 * This is called to update the activatable completely, this is called
137 	 * internally when the "related-action" property is set
138 	 * or unset and by the implementing class when
139 	 * "use-action-appearance" changes.
140 	 * Since 2.16
141 	 * Params:
142 	 * action = the related GtkAction or NULL. [allow-none]
143 	 */
144 	public void syncActionProperties(Action action);
145 	
146 	/**
147 	 * Sets the related action on the activatable object.
148 	 * Note
149 	 * GtkActivatable implementors need to handle the "related-action"
150 	 * property and call gtk_activatable_do_set_related_action() when it changes.
151 	 * Since 2.16
152 	 * Params:
153 	 * action = the GtkAction to set
154 	 */
155 	public void setRelatedAction(Action action);
156 	
157 	/**
158 	 * Sets whether this activatable should reset its layout and appearance
159 	 * when setting the related action or when the action changes appearance
160 	 * Note
161 	 * GtkActivatable implementors need to handle the
162 	 * "use-action-appearance" property and call
163 	 * gtk_activatable_sync_action_properties() to update activatable
164 	 * if needed.
165 	 * Since 2.16
166 	 * Params:
167 	 * useAppearance = whether to use the actions appearance
168 	 */
169 	public void setUseActionAppearance(int useAppearance);
170 }