<?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-gtktreedragsource">
  <refnamediv>
    <refname>gtk.TreeDragSource</refname>
    <refpurpose>an interface that manages the source data transfer for a
<link linkend="class-gtktreeview"><classname>gtk.TreeView</classname></link>
drag and drop operation</refpurpose>
  </refnamediv>

  <refsect1>
    <title>Synopsis</title>

    <classsynopsis language="python">
      <ooclass><classname>gtk.TreeDragSource</classname></ooclass>
      <ooclass><classname>gobject.GInterface</classname></ooclass>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktreedragsource--row-draggable">row_draggable</link></methodname>
	<methodparam><parameter
		       role="keyword">path</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktreedragsource--drag-data-delete">drag_data_delete</link></methodname>
	<methodparam><parameter
		       role="keyword">path</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
	<methodname><link
linkend="method-gtktreedragsource--drag-data-get">drag_data_get</link></methodname>
	<methodparam><parameter
		       role="keyword">path</parameter></methodparam>
	<methodparam><parameter
		       role="keyword">selection_data</parameter></methodparam>
      </methodsynopsis>
    </classsynopsis>

  </refsect1>

  <refsect1>
    <title>Description</title>

    <para>A <link linkend="class-gtktreedragsource"><classname>gtk.TreeDragSource</classname></link> is an interface that provides for the management of the source data for a <link linkend="class-gtktreeview"><classname>gtk.TreeView</classname></link> drag and drop operation.</para>

  </refsect1>

  <refsect1>
    <title>Methods</title>

    <refsect2 id="method-gtktreedragsource--row-draggable">
      <title>gtk.TreeDragSource.row_draggable</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>row_draggable</methodname>
	  <methodparam><parameter
			 role="keyword">path</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">path</parameter>&nbsp;:</term>
	  <listitem><simpara>the row from which the user is initiating a
drag</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the row can be
dragged</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>row_draggable</methodname>() method asks the
<link
linkend="class-gtktreedragsource"><classname>gtk.TreeDragSource</classname></link> 
if the row specified by <parameter>path</parameter> can be used as the
source of a DND operation. If the <link
linkend="class-gtktreedragsource"><classname>gtk.TreeDragSource</classname></link> 
doesn't implement this interface, the row is assumed draggable.</para>

    </refsect2>

    <refsect2 id="method-gtktreedragsource--drag-data-delete">
      <title>gtk.TreeDragSource.drag_data_delete</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>drag_data_delete</methodname>
	  <methodparam><parameter
			 role="keyword">path</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">path</parameter>&nbsp;:</term>
	  <listitem><simpara>the row that was being
dragged</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if the row was
successfully deleted</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>drag_data_delete</methodname>() method asks the
<link
linkend="class-gtktreedragsource"><classname>gtk.TreeDragSource</classname></link> 
to delete the row specified by <parameter>path</parameter>, because it was
moved somewhere else via drag-and-drop. This method returns
<literal>False</literal> if the deletion fails because
<parameter>path</parameter> no longer exists, or for some other
model-specific reason.</para>

    </refsect2>

    <refsect2 id="method-gtktreedragsource--drag-data-get">
      <title>gtk.TreeDragSource.drag_data_get</title>

      <programlisting><methodsynopsis language="python">
	  <methodname>drag_data_get</methodname>
	  <methodparam><parameter
			 role="keyword">path</parameter></methodparam>
	  <methodparam><parameter
			 role="keyword">selection_data</parameter></methodparam>
	</methodsynopsis></programlisting>
      <variablelist>
	<varlistentry>
	  <term><parameter role="keyword">path</parameter>&nbsp;:</term>
	  <listitem><simpara>the row that was dragged</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><parameter
role="keyword">selection_data</parameter>&nbsp;:</term>
	  <listitem><simpara>a <link
linkend="class-gtkselectiondata"><classname>gtk.SelectionData</classname></link> 
to fill with data from the dragged row</simpara></listitem>
	</varlistentry>
	<varlistentry>
	  <term><emphasis>Returns</emphasis>&nbsp;:</term>
	  <listitem><simpara><literal>True</literal> if data of the required
type was provided</simpara></listitem>
	</varlistentry>
      </variablelist>

      <para>The <methodname>drag_data_get</methodname>() method asks the
<link
linkend="class-gtktreedragsource"><classname>gtk.TreeDragSource</classname></link> 
to fill in the selection data object specified by
<parameter>selection_data</parameter> with a representation of the row
specified by <parameter>path</parameter>. The
<parameter>selection_data</parameter> target attribute gives the required
type of the data. </para>

    </refsect2>

  </refsect1>

</refentry>
