2 * This file is part of gtkD.
4 * gtkD 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 * gtkD 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 gtkD; 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 = AtkHypertext.html
28 * strct = AtkHypertext
55 import tango
.io
.Stdout
; // use the tango loging?
59 private import gtkc
.atktypes
;
61 private import gtkc
.atk
;
70 * An interface used for objects which implement linking between multiple
71 * resource or content locations, or multiple 'markers' within a single
72 * document. A Hypertext instance is associated with one or more Hyperlinks,
73 * which are associated with particular offsets within the Hypertext's included
74 * content. While this interface is derived from Text, there is no requirement that Hypertext instances have textual content; they may implement Image as well, and Hyperlinks need not have non-zero text offsets.
76 public class Hypertext
79 /** the main Gtk struct */
80 protected AtkHypertext
* atkHypertext
;
83 public AtkHypertext
* getHypertextStruct()
89 /** the main Gtk struct as a void* */
90 protected void* getStruct()
92 return cast(void*)atkHypertext
;
96 * Sets our main struct and passes it to the parent class
98 public this (AtkHypertext
* atkHypertext
)
102 if ( atkHypertext
is null )
107 Stdout("struct atkHypertext is null on constructor").newline
;
111 printf("struct atkHypertext is null on constructor");
118 assert(atkHypertext
!is null, "struct atkHypertext is null on constructor");
120 this.atkHypertext
= atkHypertext
;
126 // imports for the signal processing
127 private import gobject
.Signals
;
128 private import gtkc
.gdktypes
;
129 int[char[]] connectedSignals
;
131 void delegate(gint
, Hypertext
)[] onLinkSelectedListeners
;
132 void addOnLinkSelected(void delegate(gint
, Hypertext
) dlg
, ConnectFlags connectFlags
=cast(ConnectFlags
)0)
134 if ( !("link-selected" in connectedSignals
) )
139 cast(GCallback
)&callBackLinkSelected
,
143 connectedSignals
["link-selected"] = 1;
145 onLinkSelectedListeners
~= dlg
;
147 extern(C
) static void callBackLinkSelected(AtkHypertext
* atkhypertextStruct
, gint arg1
, Hypertext hypertext
)
149 bool consumed
= false;
151 foreach ( void delegate(gint
, Hypertext
) dlg
; hypertext
.onLinkSelectedListeners
)
153 dlg(arg1
, hypertext
);
162 * Gets the link in this hypertext document at index
167 * an integer specifying the desired link
169 * the link in this hypertext document at
172 public AtkHyperlink
* _GetLink(int linkIndex
)
174 // AtkHyperlink* atk_hypertext_get_link (AtkHypertext *hypertext, gint link_index);
175 return atk_hypertext_get_link(atkHypertext
, linkIndex
);
179 * Gets the number of links within this hypertext document.
183 * the number of links within this hypertext document
185 public int _GetNLinks()
187 // gint atk_hypertext_get_n_links (AtkHypertext *hypertext);
188 return atk_hypertext_get_n_links(atkHypertext
);
192 * Gets the index into the array of hyperlinks that is associated with
193 * the character specified by char_index.
199 * an index into the array of hyperlinks in hypertext,
200 * or -1 if there is no hyperlink associated with this character.
202 * The "link-selected" signal
203 * void user_function (AtkHypertext *atkhypertext,
205 * gpointer user_data) : Run Last
206 * The "link-selected" signal is emitted by an AtkHyperText object when one of
207 * the hyperlinks associated with the object is selected.
209 * the object which received the signal.
211 * the index of the hyperlink which is selected
213 * user data set when the signal handler was connected.
217 public int _GetLinkIndex(int charIndex
)
219 // gint atk_hypertext_get_link_index (AtkHypertext *hypertext, gint char_index);
220 return atk_hypertext_get_link_index(atkHypertext
, charIndex
);