<?xml version="1.0" standalone="no"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
    "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd">

<refentry id="class-atkeditabletext">

  <refnamediv>
    <refname>atk.EditableText</refname>
      <refpurpose>the ATK interface implemented by components containing
      user-editable text content.  </refpurpose>
  </refnamediv>

  <refsect1>
    <title>Synopsis</title>

    <classsynopsis language="python">
      <ooclass><classname>atk.EditableText</classname></ooclass>
      <ooclass><classname>gobject.GInterface</classname></ooclass>
      <methodsynopsis language="python">
        <methodname><link linkend="method-atkeditabletext--set-run-attributes">set_run_attributes</link></methodname>
        <methodparam><parameter role="keyword">attrib_set</parameter></methodparam>
        <methodparam><parameter role="keyword">start_offset</parameter></methodparam>
        <methodparam><parameter role="keyword">end_offset</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-atkeditabletext--set-text-contents">set_text_contents</link></methodname>
        <methodparam><parameter role="keyword">string</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-atkeditabletext--insert-text">insert_text</link></methodname>
        <methodparam><parameter role="keyword">string</parameter></methodparam>
        <methodparam><parameter role="keyword">length</parameter></methodparam>
        <methodparam><parameter role="keyword">position</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-atkeditabletext--copy-text">copy_text</link></methodname>
        <methodparam><parameter role="keyword">start_pos</parameter></methodparam>
        <methodparam><parameter role="keyword">end_pos</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-atkeditabletext--cut-text">cut_text</link></methodname>
        <methodparam><parameter role="keyword">start_pos</parameter></methodparam>
        <methodparam><parameter role="keyword">end_pos</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-atkeditabletext--delete-text">delete_text</link></methodname>
        <methodparam><parameter role="keyword">start_pos</parameter></methodparam>
        <methodparam><parameter role="keyword">end_pos</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-atkeditabletext--paste-text">paste_text</link></methodname>
        <methodparam><parameter role="keyword">position</parameter></methodparam>
      </methodsynopsis>
</classsynopsis>

  </refsect1>

  <refsect1>
    <title>Description</title>

    <para><link
    linkend="class-atkeditabletext"><classname>atk.EditableText</classname></link>
    should be implemented by UI components which contain text which the user
    can edit, via the <link
    linkend="class-atkobject"><classname>atk.Object</classname></link>
    corresponding to that component (see <link
    linkend="class-atkobject"><classname>atk.Object</classname></link>).</para>

    <para><link
    linkend="class-atkeditabletext"><classname>atk.EditableText</classname></link>
    is a subclass of <link
    linkend="class-atktext"><classname>atk.Text</classname></link>, and as
    such, an object which implements <link
    linkend="class-atkeditabletext"><classname>atk.EditableText</classname></link>
    is by definition an <link
    linkend="class-atktext"><classname>atk.Text</classname></link>
    implementor as well.</para>

  </refsect1>

  <refsect1>
    <title>Methods</title>

    <refsect2 id="method-atkeditabletext--set-run-attributes">
      <title>atk.EditableText.set_run_attributes</title>

      <programlisting><methodsynopsis language="python">
        <methodname>set_run_attributes</methodname>
        <methodparam><parameter role="keyword">attrib_set</parameter></methodparam>
        <methodparam><parameter role="keyword">start_offset</parameter></methodparam>
        <methodparam><parameter role="keyword">end_offset</parameter></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">attrib_set</parameter>&nbsp;:</term>
          <listitem><simpara>a sequence of 2-tuples containing name-value
          string pairs.</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter role="keyword">start_offset</parameter>&nbsp;:</term>
          <listitem><simpara>start of range in which to set
          attributes</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter role="keyword">end_offset</parameter>&nbsp;:</term>
          <listitem><simpara>end of range in which to set
          attributes</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara><literal>True</literal> if attributes were
          successfully set for the specified range, otherwise
          <literal>False</literal></simpara></listitem>
        </varlistentry>
      </variablelist>

      <para>Sets the attributes for a specified range. See the <xref
      linkend="atk-text-attr-constants"
      endterm="atk-text-attr-constants-title"></xref> (such as
      <literal>atk.TEXT_ATTR_LEFT_MARGIN</literal>) for examples of
      attributes that can be set. Note that other attributes that do not
      have corresponding <xref linkend="atk-text-attr-constants"
      endterm="atk-text-attr-constants-title"></xref> may also be set for
      certain text widgets.</para>

    </refsect2>

    <refsect2 id="method-atkeditabletext--set-text-contents">
      <title>atk.EditableText.set_text_contents</title>

      <programlisting><methodsynopsis language="python">
        <methodname>set_text_contents</methodname>
        <methodparam><parameter role="keyword">string</parameter></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">string</parameter>&nbsp;:</term>
          <listitem><simpara>string to set for text contents of the
          text</simpara></listitem>
        </varlistentry>
      </variablelist>

      <para>Set text contents of the text.</para>

    </refsect2>

    <refsect2 id="method-atkeditabletext--insert-text">
      <title>atk.EditableText.insert_text</title>

      <programlisting><methodsynopsis language="python">
        <methodname>insert_text</methodname>
        <methodparam><parameter role="keyword">string</parameter></methodparam>
        <methodparam><parameter role="keyword">length</parameter></methodparam>
        <methodparam><parameter role="keyword">position</parameter></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">string</parameter>&nbsp;:</term>
          <listitem><simpara>the text to insert</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter role="keyword">length</parameter>&nbsp;:</term>
          <listitem><simpara>the length of text to insert, in bytes</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter role="keyword">position</parameter>&nbsp;:</term>
          <listitem><simpara>the position at which to insert the text</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara>the position after the newly inserted
          text.</simpara></listitem>
        </varlistentry>
      </variablelist>

      <para>Insert text at a given position.</para>

    </refsect2>

    <refsect2 id="method-atkeditabletext--copy-text">
      <title>atk.EditableText.copy_text</title>

      <programlisting><methodsynopsis language="python">
        <methodname>copy_text</methodname>
        <methodparam><parameter role="keyword">start_pos</parameter></methodparam>
        <methodparam><parameter role="keyword">end_pos</parameter></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">start_pos</parameter>&nbsp;:</term>
          <listitem><simpara>start position</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter role="keyword">end_pos</parameter>&nbsp;:</term>
          <listitem><simpara>end position</simpara></listitem>
        </varlistentry>
      </variablelist>

      <para>Copy text from <parameter>start_pos</parameter> up to, but not
      including <parameter>end_pos</parameter> to the clipboard.</para>

    </refsect2>

    <refsect2 id="method-atkeditabletext--cut-text">
      <title>atk.EditableText.cut_text</title>

      <programlisting><methodsynopsis language="python">
        <methodname>cut_text</methodname>
        <methodparam><parameter role="keyword">start_pos</parameter></methodparam>
        <methodparam><parameter role="keyword">end_pos</parameter></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">start_pos</parameter>&nbsp;:</term>
          <listitem><simpara>start position</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter role="keyword">end_pos</parameter>&nbsp;:</term>
          <listitem><simpara>end position</simpara></listitem>
        </varlistentry>
      </variablelist>

      <para>Copy text from <parameter>start_pos</parameter> up to, but not
      including <parameter>end_pos</parameter> to the clipboard and then
      delete from the widget.</para>

    </refsect2>

    <refsect2 id="method-atkeditabletext--delete-text">
      <title>atk.EditableText.delete_text</title>

      <programlisting><methodsynopsis language="python">
        <methodname>delete_text</methodname>
        <methodparam><parameter role="keyword">start_pos</parameter></methodparam>
        <methodparam><parameter role="keyword">end_pos</parameter></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">start_pos</parameter>&nbsp;:</term>
          <listitem><simpara>start position</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter role="keyword">end_pos</parameter>&nbsp;:</term>
          <listitem><simpara>end position</simpara></listitem>
        </varlistentry>
      </variablelist>

      <para>Delete text <parameter>start_pos</parameter> up to, but not
      including <parameter>end_pos</parameter>.</para>

    </refsect2>

    <refsect2 id="method-atkeditabletext--paste-text">
      <title>atk.EditableText.paste_text</title>

      <programlisting><methodsynopsis language="python">
        <methodname>paste_text</methodname>
        <methodparam><parameter role="keyword">position</parameter></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">position</parameter>&nbsp;:</term>
          <listitem><simpara>position to paste</simpara></listitem>
        </varlistentry>
      </variablelist>

      <para>Paste text from clipboard to the specified
      <parameter>position</parameter>.</para>

    </refsect2>

  </refsect1>

</refentry>
