<?xml version="1.0"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
               "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
<!ENTITY % local.common.attrib "xmlns:xi  CDATA  #FIXED 'http://www.w3.org/2003/XInclude'">
]>
<refentry id="gail-libgail-util-GailTextUtil">
<refmeta>
<refentrytitle role="top_of_page" id="gail-libgail-util-GailTextUtil.top_of_page">GailTextUtil</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>GAIL-LIBGAIL-UTIL Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>GailTextUtil</refname>
<refpurpose>GailTextUtil is a utility class which can be used to implement some of
the AtkText functions for accessible objects which implement AtkText.</refpurpose>
</refnamediv>

<refsynopsisdiv id="gail-libgail-util-GailTextUtil.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>
                    <link linkend="GailTextUtil">GailTextUtil</link>;
enum                <link linkend="GailOffsetType">GailOffsetType</link>;
<link linkend="GailTextUtil">GailTextUtil</link>*       <link linkend="gail-text-util-new">gail_text_util_new</link>                  (void);
<link linkend="void">void</link>                <link linkend="gail-text-util-text-setup">gail_text_util_text_setup</link>           (<link linkend="GailTextUtil">GailTextUtil</link> *textutil,
                                                         const <link linkend="gchar">gchar</link> *text);
<link linkend="void">void</link>                <link linkend="gail-text-util-buffer-setup">gail_text_util_buffer_setup</link>         (<link linkend="GailTextUtil">GailTextUtil</link> *textutil,
                                                         <link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer);
<link linkend="gchar">gchar</link>*              <link linkend="gail-text-util-get-text">gail_text_util_get_text</link>             (<link linkend="GailTextUtil">GailTextUtil</link> *textutil,
                                                         <link linkend="gpointer">gpointer</link> layout,
                                                         <link linkend="GailOffsetType">GailOffsetType</link> function,
                                                         <link linkend="AtkTextBoundary">AtkTextBoundary</link> boundary_type,
                                                         <link linkend="gint">gint</link> offset,
                                                         <link linkend="gint">gint</link> *start_offset,
                                                         <link linkend="gint">gint</link> *end_offset);
<link linkend="gchar">gchar</link>*              <link linkend="gail-text-util-get-substring">gail_text_util_get_substring</link>        (<link linkend="GailTextUtil">GailTextUtil</link> *textutil,
                                                         <link linkend="gint">gint</link> start_pos,
                                                         <link linkend="gint">gint</link> end_pos);
</synopsis>
</refsynopsisdiv>









<refsect1 id="gail-libgail-util-GailTextUtil.description" role="desc">
<title role="desc.title">Description</title>
<para>
GailTextUtil is a utility class which can be used to implement the
AtkText functions which get text for accessible objects which implement
AtkText.
In GAIL it is used by the accsesible objects for GnomeCanvasText, GtkEntry,
GtkLabel, GtkCellRendererText and GtkTextview.
</para>
</refsect1>

<refsect1 id="gail-libgail-util-GailTextUtil.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="GailTextUtil" role="struct">
<title>GailTextUtil</title>
<indexterm zone="GailTextUtil"><primary sortas="GailTextUtil">GailTextUtil</primary></indexterm><programlisting>typedef struct {
  GObject parent;

  GtkTextBuffer *buffer;
} GailTextUtil;
</programlisting>
<para>
The GailTextCell structure should not be accessed directly.
</para></refsect2>
<refsect2 id="GailOffsetType" role="enum">
<title>enum GailOffsetType</title>
<indexterm zone="GailOffsetType"><primary sortas="GailOffsetType">GailOffsetType</primary></indexterm><programlisting>typedef enum
{
  GAIL_BEFORE_OFFSET,
  GAIL_AT_OFFSET,
  GAIL_AFTER_OFFSET
}GailOffsetType;
</programlisting>
<para>
Specifies which of the functions <link linkend="atk-text-get-text-before-offset"><function>atk_text_get_text_before_offset()</function></link>,
<link linkend="atk-text-get-text-at-offset"><function>atk_text_get_text_at_offset()</function></link>, <link linkend="atk-text-get-text-after-offset"><function>atk_text_get_text_after_offset()</function></link> the
function <link linkend="gail-text-util-get-text"><function>gail_text_util_get_text()</function></link> is being called for.</para>
<para>
</para><variablelist role="enum">
<varlistentry id="GAIL-BEFORE-OFFSET--CAPS" role="constant">
<term><literal>GAIL_BEFORE_OFFSET</literal></term>
<listitem><simpara> Text before offset is required.
</simpara></listitem>
</varlistentry>
<varlistentry id="GAIL-AT-OFFSET--CAPS" role="constant">
<term><literal>GAIL_AT_OFFSET</literal></term>
<listitem><simpara> Text at offset is required,
</simpara></listitem>
</varlistentry>
<varlistentry id="GAIL-AFTER-OFFSET--CAPS" role="constant">
<term><literal>GAIL_AFTER_OFFSET</literal></term>
<listitem><simpara> Text after offset is required.
</simpara></listitem>
</varlistentry>
</variablelist></refsect2>
<refsect2 id="gail-text-util-new" role="function">
<title>gail_text_util_new ()</title>
<indexterm zone="gail-text-util-new"><primary sortas="gail_text_util_new">gail_text_util_new</primary></indexterm><programlisting><link linkend="GailTextUtil">GailTextUtil</link>*       gail_text_util_new                  (void);</programlisting>
<para>
This function creates a new GailTextUtil object.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the GailTextUtil object
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gail-text-util-text-setup" role="function">
<title>gail_text_util_text_setup ()</title>
<indexterm zone="gail-text-util-text-setup"><primary sortas="gail_text_util_text_setup">gail_text_util_text_setup</primary></indexterm><programlisting><link linkend="void">void</link>                gail_text_util_text_setup           (<link linkend="GailTextUtil">GailTextUtil</link> *textutil,
                                                         const <link linkend="gchar">gchar</link> *text);</programlisting>
<para>
This function initializes the GailTextUtil with the specified character string,</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>textutil</parameter>&#160;:</term>
<listitem><simpara> The <link linkend="GailTextUtil"><type>GailTextUtil</type></link> to be initialized.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>text</parameter>&#160;:</term>
<listitem><simpara> A gchar* which points to the text to be stored in the GailTextUtil
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gail-text-util-buffer-setup" role="function">
<title>gail_text_util_buffer_setup ()</title>
<indexterm zone="gail-text-util-buffer-setup"><primary sortas="gail_text_util_buffer_setup">gail_text_util_buffer_setup</primary></indexterm><programlisting><link linkend="void">void</link>                gail_text_util_buffer_setup         (<link linkend="GailTextUtil">GailTextUtil</link> *textutil,
                                                         <link linkend="GtkTextBuffer">GtkTextBuffer</link> *buffer);</programlisting>
<para>
This function initializes the GailTextUtil with the specified GtkTextBuffer</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>textutil</parameter>&#160;:</term>
<listitem><simpara> A <link linkend="GailTextUtil"><type>GailTextUtil</type></link> to be initialized
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>buffer</parameter>&#160;:</term>
<listitem><simpara> The <link linkend="GtkTextBuffer"><type>GtkTextBuffer</type></link> which identifies the text to be stored in the GailUtil.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gail-text-util-get-text" role="function">
<title>gail_text_util_get_text ()</title>
<indexterm zone="gail-text-util-get-text"><primary sortas="gail_text_util_get_text">gail_text_util_get_text</primary></indexterm><programlisting><link linkend="gchar">gchar</link>*              gail_text_util_get_text             (<link linkend="GailTextUtil">GailTextUtil</link> *textutil,
                                                         <link linkend="gpointer">gpointer</link> layout,
                                                         <link linkend="GailOffsetType">GailOffsetType</link> function,
                                                         <link linkend="AtkTextBoundary">AtkTextBoundary</link> boundary_type,
                                                         <link linkend="gint">gint</link> offset,
                                                         <link linkend="gint">gint</link> *start_offset,
                                                         <link linkend="gint">gint</link> *end_offset);</programlisting>
<para>
This function gets the requested substring from the text in the GtkTextUtil.
The layout is used only for getting the text on a line. The value is NULL 
for a GtkTextView which is not wrapped, is a GtkTextView for a GtkTextView 
which is wrapped and is a PangoLayout otherwise.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>textutil</parameter>&#160;:</term>
<listitem><simpara> A <link linkend="GailTextUtil"><type>GailTextUtil</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>layout</parameter>&#160;:</term>
<listitem><simpara> A gpointer which is a PangoLayout, a GtkTreeView of NULL
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>function</parameter>&#160;:</term>
<listitem><simpara> An enumeration specifying whether to return the text before, at, or
  after the offset.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>boundary_type</parameter>&#160;:</term>
<listitem><simpara> The boundary type.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>offset</parameter>&#160;:</term>
<listitem><simpara> The offset of the text in the GailTextUtil 
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>start_offset</parameter>&#160;:</term>
<listitem><simpara> Address of location in which the start offset is returned
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>end_offset</parameter>&#160;:</term>
<listitem><simpara> Address of location in which the end offset is returned
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the substring requested
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="gail-text-util-get-substring" role="function">
<title>gail_text_util_get_substring ()</title>
<indexterm zone="gail-text-util-get-substring"><primary sortas="gail_text_util_get_substring">gail_text_util_get_substring</primary></indexterm><programlisting><link linkend="gchar">gchar</link>*              gail_text_util_get_substring        (<link linkend="GailTextUtil">GailTextUtil</link> *textutil,
                                                         <link linkend="gint">gint</link> start_pos,
                                                         <link linkend="gint">gint</link> end_pos);</programlisting>
<para>
Gets the substring indicated by <parameter>start_pos</parameter> and <parameter>end_pos</parameter></para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>textutil</parameter>&#160;:</term>
<listitem><simpara> A <link linkend="GailTextUtil"><type>GailTextUtil</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>start_pos</parameter>&#160;:</term>
<listitem><simpara> The start position of the substring
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>end_pos</parameter>&#160;:</term>
<listitem><simpara> The end position of the substring.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the substring indicated by <parameter>start_pos</parameter> and <parameter>end_pos</parameter>
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>




</refentry>
