alternative to assert
[gtkD.git] / src / atk / Hyperlink.d
blob92aff8d64d4b1b806e3ff76071a79a590c98f137
1 /*
2 * This file is part of duit.
4 * duit 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 2.1 of the License, or
7 * (at your option) any later version.
9 * duit 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.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with duit; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 // generated automatically - do not change
20 // find conversion definition on APILookup.txt
21 // implement new conversion functionalities on the wrap.utils pakage
24 * Conversion parameters:
25 * inFile = AtkHyperlink.html
26 * outPack = atk
27 * outFile = Hyperlink
28 * strct = AtkHyperlink
29 * realStrct=
30 * ctorStrct=
31 * clss = Hyperlink
32 * interf =
33 * class Code: No
34 * interface Code: No
35 * template for:
36 * extend =
37 * implements:
38 * prefixes:
39 * - atk_hyperlink
40 * omit structs:
41 * omit prefixes:
42 * omit code:
43 * imports:
44 * - glib.Str
45 * structWrap:
46 * local aliases:
49 module atk.Hyperlink;
51 private import atk.atktypes;
53 private import lib.atk;
55 private import glib.Str;
57 /**
58 * Description
59 * An ATK object which encapsulates a link or set of links
60 * (for instance in the case of client-side image maps) in a hypertext document.
61 * It may implement the AtkAction interface. AtkHyperlink may also be used
62 * to refer to inline embedded content, since it allows specification of a start
63 * and end offset within the host AtkHypertext object.
65 private import gobject.ObjectG;
66 public class Hyperlink : ObjectG
69 /** the main Gtk struct */
70 protected AtkHyperlink* atkHyperlink;
73 public AtkHyperlink* getHyperlinkStruct()
75 return atkHyperlink;
79 /** the main Gtk struct as a void* */
80 protected void* getStruct()
82 return cast(void*)atkHyperlink;
85 /**
86 * Sets our main struct and passes it to the parent class
88 public this (AtkHyperlink* atkHyperlink)
90 super(cast(GObject*)atkHyperlink);
91 this.atkHyperlink = atkHyperlink;
94 /**
97 // imports for the signal processing
98 private import gobject.Signals;
99 private import gdk.gdktypes;
100 int[char[]] connectedSignals;
102 void delegate(Hyperlink)[] onLinkActivatedListeners;
103 void addOnLinkActivated(void delegate(Hyperlink) dlg)
105 if ( !("link-activated" in connectedSignals) )
107 Signals.connectData(
108 getStruct(),
109 "link-activated",
110 cast(GCallback)&callBackLinkActivated,
111 this,
112 null,
113 cast(ConnectFlags)0);
114 connectedSignals["link-activated"] = 1;
116 onLinkActivatedListeners ~= dlg;
118 extern(C) static void callBackLinkActivated(AtkHyperlink* atkhyperlinkStruct, Hyperlink hyperlink)
120 bit consumed = false;
122 foreach ( void delegate(Hyperlink) dlg ; hyperlink.onLinkActivatedListeners )
124 dlg(hyperlink);
127 return consumed;
134 * Get a the URI associated with the anchor specified
135 * by i of link_.
136 * Multiple anchors are primarily used by client-side image maps.
137 * link_:
138 * an AtkHyperlink
139 * i:
140 * a (zero-index) integer specifying the desired anchor
141 * Returns:
142 * a string specifying the URI
144 public char[] _GetUri(int i)
146 // gchar* atk_hyperlink_get_uri (AtkHyperlink *link_, gint i);
147 return Str.toString(atk_hyperlink_get_uri(atkHyperlink, i) );
151 * Returns the item associated with this hyperlinks nth anchor.
152 * For instance, the returned AtkObject will implement AtkText
153 * if link_ is a text hyperlink, AtkImage if link_ is an image
154 * hyperlink etc.
155 * Multiple anchors are primarily used by client-side image maps.
156 * link_:
157 * an AtkHyperlink
158 * i:
159 * a (zero-index) integer specifying the desired anchor
160 * Returns:
161 * an AtkObject associated with this hyperlinks i-th anchor
163 public AtkObject* _GetObject(int i)
165 // AtkObject* atk_hyperlink_get_object (AtkHyperlink *link_, gint i);
166 return atk_hyperlink_get_object(atkHyperlink, i);
170 * Gets the index with the hypertext document at which this link ends.
171 * link_:
172 * an AtkHyperlink
173 * Returns:
174 * the index with the hypertext document at which this link ends
176 public int _GetEndIndex()
178 // gint atk_hyperlink_get_end_index (AtkHyperlink *link_);
179 return atk_hyperlink_get_end_index(atkHyperlink);
183 * Gets the index with the hypertext document at which this link begins.
184 * link_:
185 * an AtkHyperlink
186 * Returns:
187 * the index with the hypertext document at which this link begins
189 public int _GetStartIndex()
191 // gint atk_hyperlink_get_start_index (AtkHyperlink *link_);
192 return atk_hyperlink_get_start_index(atkHyperlink);
196 * Since the document that a link is associated with may have changed
197 * this method returns TRUE if the link is still valid (with
198 * respect to the document it references) and FALSE otherwise.
199 * link_:
200 * an AtkHyperlink
201 * Returns:
202 * whether or not this link is still valid
204 public int _IsValid()
206 // gboolean atk_hyperlink_is_valid (AtkHyperlink *link_);
207 return atk_hyperlink_is_valid(atkHyperlink);
211 * Indicates whether the link currently displays some or all of its
212 * content inline. Ordinary HTML links will usually return
213 * FALSE, but an inline lt;srcgt; HTML element will return
214 * TRUE.
215 * a *
216 * link_:
217 * an AtkHyperlink
218 * Returns:
219 * whether or not this link displays its content inline.
221 public int _IsInline()
223 // gboolean atk_hyperlink_is_inline (AtkHyperlink *link_);
224 return atk_hyperlink_is_inline(atkHyperlink);
228 * Gets the number of anchors associated with this hyperlink.
229 * link_:
230 * an AtkHyperlink
231 * Returns:
232 * the number of anchors associated with this hyperlink
234 public int _GetNAnchors()
236 // gint atk_hyperlink_get_n_anchors (AtkHyperlink *link_);
237 return atk_hyperlink_get_n_anchors(atkHyperlink);
241 * Determines whether this AtkHyperlink is selected
242 * Returns:
243 * link_:
244 * an AtkHyperlink
245 * Returns:
246 * True is the AtkHyperlink is selected, False otherwise
247 * Since ATK 1.4
248 * @Deprecated: This method is deprecated since ATK version 1.8.
249 * Please use ATK_STATE_SELECTED to indicate when a hyperlink within a
250 * Hypertext container is selected.
251 * Property Details
252 * The "end-index" property
253 * "end-index" gint : Read
254 * The end index of the AtkHyperlink object.
255 * Allowed values: >= 0
256 * Default value: 0
258 public int _IsSelectedLink()
260 // gboolean atk_hyperlink_is_selected_link (AtkHyperlink *link_);
261 return atk_hyperlink_is_selected_link(atkHyperlink);