<?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-gtkprintoperation">

  <refnamediv>
    <refname>gtk.PrintOperation</refname>
      <refpurpose>a high-level printing API (new in PyGTK 2.10)</refpurpose>
  </refnamediv>

  <refsect1>
    <title>Synopsis</title>

    <classsynopsis language="python">
      <ooclass><classname>gtk.PrintOperation</classname></ooclass>
      <ooclass><classname><link linkend="class-gobject">gobject.GObject</link></classname></ooclass>
      <ooclass><classname><link linkend="class-gtkprintoperationpreview">gtk.PrintOperationPreview</link></classname></ooclass>
      <constructorsynopsis language="python">
        <methodname><link linkend="constructor-gtkprintoperation">gtk.PrintOperation</link></methodname>
        <methodparam></methodparam>
      </constructorsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-gtkprintoperation--set-default-page-setup">set_default_page_setup</link></methodname>
        <methodparam><parameter role="keyword">default_page_setup</parameter><initializer>None</initializer></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-gtkprintoperation--get-default-page-setup">get_default_page_setup</link></methodname>
        <methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-gtkprintoperation--set-print-settings">set_print_settings</link></methodname>
        <methodparam><parameter role="keyword">print_settings</parameter><initializer>None</initializer></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-gtkprintoperation--get-print-settings">get_print_settings</link></methodname>
        <methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-gtkprintoperation--set-job-name">set_job_name</link></methodname>
        <methodparam><parameter role="keyword">job_name</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-gtkprintoperation--set-n-pages">set_n_pages</link></methodname>
        <methodparam><parameter role="keyword">n_pages</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-gtkprintoperation--set-current-page">set_current_page</link></methodname>
        <methodparam><parameter role="keyword">current_page</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-gtkprintoperation--set-use-full-page">set_use_full_page</link></methodname>
        <methodparam><parameter role="keyword">full_page</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-gtkprintoperation--set-unit">set_unit</link></methodname>
        <methodparam><parameter role="keyword">unit</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-gtkprintoperation--set-export-filename">set_export_filename</link></methodname>
        <methodparam><parameter role="keyword">filename</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-gtkprintoperation--set-track-print-status">set_track_print_status</link></methodname>
        <methodparam><parameter role="keyword">track_status</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-gtkprintoperation--set-show-progress">set_show_progress</link></methodname>
        <methodparam><parameter role="keyword">show_progress</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-gtkprintoperation--set-allow-async">set_allow_async</link></methodname>
        <methodparam><parameter role="keyword">allow_async</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-gtkprintoperation--set-custom-tab-label">set_custom_tab_label</link></methodname>
        <methodparam><parameter role="keyword">label</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-gtkprintoperation--run">run</link></methodname>
        <methodparam><parameter role="keyword">action</parameter></methodparam>
        <methodparam><parameter role="keyword">parent</parameter><initializer>None</initializer></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-gtkprintoperation--get-error">get_error</link></methodname>
        <methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-gtkprintoperation--get-status">get_status</link></methodname>
        <methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-gtkprintoperation--get-status-string">get_status_string</link></methodname>
        <methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-gtkprintoperation--is-finished">is_finished</link></methodname>
        <methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-gtkprintoperation--cancel">cancel</link></methodname>
        <methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-gtkprintoperation--set-support-selection">set_support_selection</link></methodname>
        <methodparam><parameter role="keyword">support_selection</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-gtkprintoperation--get-support-selection">get_support_selection</link></methodname>
        <methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-gtkprintoperation--set-has-selection">set_has_selection</link></methodname>
        <methodparam><parameter role="keyword">has_selection</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-gtkprintoperation--get-has-selection">get_has_selection</link></methodname>
        <methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-gtkprintoperation--set-embed-page-setup">set_embed_page_setup</link></methodname>
        <methodparam><parameter role="keyword">embed</parameter></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-gtkprintoperation--get-embed-page-setup">get_embed_page_setup</link></methodname>
        <methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-gtkprintoperation--get-n-pages-to-print">get_n_pages_to_print</link></methodname>
        <methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-gtkprintoperation--draw-page-finish">draw_page_finish</link></methodname>
        <methodparam></methodparam>
      </methodsynopsis>
      <methodsynopsis language="python">
        <methodname><link linkend="method-gtkprintoperation--set-defer-drawing">set_defer_drawing</link></methodname>
        <methodparam></methodparam>
      </methodsynopsis>
    </classsynopsis>

  </refsect1>

  <refsect1>
    <title>Ancestry</title>

<synopsis>+-- <link linkend="class-gobject">gobject.GObject</link>
  +-- <link linkend="class-gtkprintoperation">gtk.PrintOperation</link> (implements <link linkend="class-gtkprintoperationpreview">gtk.PrintOperationPreview</link>)
</synopsis>

  </refsect1>

  <refsect1 id="properties-gtkprintoperation">
    <title>gtk.PrintOperation Properties</title>

    <blockquote role="properties">
      <informaltable pgwide="1" frame="none">
        <tgroup cols="3">
          <colspec column="1" colwidth="1in"/>
          <colspec column="2" colwidth="1in"/>
          <colspec column="3" colwidth="3.5in"/>
        <tbody>

        <row valign="top">
          <entry>"allow-async"</entry>
          <entry>Read-Write</entry>
          <entry>If <literal>True</literal> the print operation may run
          asynchronously or not.  Some systems don't support asynchronous
          printing, but those that do will return
          <literal>gtk.PRINT_OPERATION_RESULT_IN_PROGRESS</literal> as the
          status, and emit the done signal when the operation is actually
          done.  This property is available in GTK+ 2.10 and above.</entry>
        </row>

        <row valign="top">
          <entry>"current-page"</entry>
          <entry>Read-Write</entry>
          <entry>The current page in the document.  If this is set before
          <link
          linkend="method-gtkprintoperation--run"><methodname>gtk.PrintOperation.run()</methodname></link>,
          the user will be able to select to print only the current page.
          Note that this only makes sense for pre-paginated documents.  This
          property is available in GTK+ 2.10 and above.</entry>
        </row>

        <row valign="top">
          <entry>"custom-tab-label"</entry>
          <entry>Read-Write</entry>
          <entry>Used as the label of the tab containing custom widgets.
          Note that this property may be ignored on some platforms.  If this
          is <literal>None</literal>, GTK+ uses a default label.  This
          property is available in GTK+ 2.10 and above.</entry>
        </row>

        <row valign="top">
          <entry>"default-page-setup"</entry>
          <entry>Read-Write</entry>
          <entry>The <link
          linkend="class-gtkpagesetup"><classname>gtk.PageSetup</classname></link>
          used by default. This page setup will be used by <link
          linkend="method-gtkprintoperation--run"><methodname>gtk.PrintOperation.run()</methodname></link>,
          but it can be overridden on a per-page basis by connecting to the
          "request-page-setup" signal. This property is available in GTK+
          2.10 and above.</entry>
        </row>

        <row valign="top">
          <entry>"export-filename"</entry>
          <entry>Read-Write</entry>
          <entry>The name of a file file to generate instead of showing the
          print dialog. Currently, PDF is the only supported format.  The
          intended use of this property is for implementing "Export to PDF"
          actions.  "Print to PDF" support is independent of this and is
          done by letting the user pick the "Print to PDF" item from the
          list of printers in the print dialog.  This property is available
          in GTK+ 2.10 and above.</entry>
        </row>

        <row valign="top">
          <entry>"has-selection"</entry>
          <entry>Read-Write</entry>
          <entry>Determines whether there is a selection in your application.
          This can allow your application to print the selection. This is
          typically used to make a "Selection" button sensitive.
          Default value: <literal>False</literal>
          This property is available in GTK+ 2.18 and above.</entry>
        </row>

        <row valign="top">
          <entry>"job-name"</entry>
          <entry>Read-Write</entry>
          <entry>A string used to identify the job (e.g. in monitoring
          applications like eggcups).  If you don't set a job name, GTK+
          picks a default one by numbering successive print jobs.  This
          property is available in GTK+ 2.10 and above.</entry>
        </row>

        <row valign="top">
          <entry>"n-pages"</entry>
          <entry>Read-Write</entry>
          <entry>The number of pages in the document.  This
          <emphasis>must</emphasis> be set to a positive number before the
          rendering starts. It may be set in a "begin-print" signal hander.
          Note that the page numbers passed to the "request-page-setup" and
          "draw-page" signals are 0-based, i.e. if the user chooses to print
          all pages, the last "draw-page" signal will be for page
          <parameter>n_pages</parameter> - 1. This property is available in
          GTK+ 2.10 and above.</entry>
        </row>

        <row valign="top">
          <entry>"n-pages-to-print"</entry>
          <entry>Read</entry>
          <entry>The number of pages that will be printed.
          Note that this value is set during print preparation phase
          (<literal>gtk.PRINT_STATUS_PREPARING</literal>), so this value
          should never be get before the data generation phase
          (<literal>gtk.PRINT_STATUS_GENERATING_DATA</literal>).
          You can connect to the "status-changed" signal and call
          gtk_print_operation_get_n_pages_to_print() when print status is
          <literal>gtk.PRINT_STATUS_GENERATING_DATA</literal>. This is
          typically used to track the progress of print operation.
          Default value: -1
          This property is available in GTK+ 2.18 and above.</entry>
        </row>

        <row valign="top">
          <entry>"print-settings"</entry>
          <entry>Read-Write</entry>
          <entry>The <link
          linkend="class-gtkprintsettings"><classname>gtk.PrintSettings</classname></link>
          used for initializing the dialog. Setting this property is
          typically used to re-establish print settings from a previous
          print operation, see the <link
          linkend="method-gtkprintoperation--run"><methodname>gtk.PrintOperation.run()</methodname></link>
          method. This property is available in GTK+ 2.10 and above.</entry>
        </row>

        <row valign="top">
          <entry>"show-progress"</entry>
          <entry>Read-Write</entry>
          <entry>If <literal>True</literal> show a progress dialog during
          the print operation. This property is available in GTK+ 2.10 and
          above.</entry>
        </row>

        <row valign="top">
          <entry>"status"</entry>
          <entry>Read</entry>
          <entry>The status of the print operation. This property is
          available in GTK+ 2.10 and above.</entry>
        </row>

        <row valign="top">
          <entry>"status-string"</entry>
          <entry>Read</entry>
          <entry>A string representation of the status of the print
          operation.  The string is translated and suitable for displaying
          the print status e.g. in a <link
          linkend="class-gtkstatusbar"><classname>gtk.Statusbar</classname></link>.
          See the "status" property for a status value that is suitable for
          programmatic use. This property is available in GTK+ 2.10 and
          above.</entry>
        </row>

        <row valign="top">
          <entry>"support-selection"</entry>
          <entry>Read-Write</entry>
          <entry>If <literal>True</literal>, the print operation will support print
          of selection. This allows the print dialog to show a "Selection" button.
          Default value: <literal>False</literal>
          This property is available in GTK+ 2.18 and above.</entry>
        </row>

        <row valign="top">
          <entry>"track-print-status"</entry>
          <entry>Read-Write</entry>
          <entry>If <literal>True</literal>, the print operation will try to
          continue report on the status of the print job in the printer
          queues and printer.  This can allow your application to show
          things like "out of paper" issues, and when the print job actually
          reaches the printer.  However, this is often implemented using
          polling, and should not be enabled unless needed. This property
          is available in GTK+ 2.10 and above.</entry>
        </row>

        <row valign="top">
          <entry>"unit"</entry>
          <entry>Read-Write</entry>
          <entry>The transformation for the cairo context obtained from
          <link
          linkend="class-gtkprintcontext"><classname>gtk.PrintContext</classname></link>
          is set up in such a way that distances are measured in units of
          <parameter>unit</parameter>. This property is available in GTK+
          2.10 and above.</entry>
        </row>

        <row valign="top">
          <entry>"use-full-page"</entry>
          <entry>Read-Write</entry>
          <entry>If <literal>True</literal>, the transformation for the
          cairo context obtained from <link
          linkend="class-gtkprintcontext"><classname>gtk.PrintContext</classname></link>
          puts the origin at the top left corner of the page (which may not
          be the top left corner of the sheet, depending on page orientation
          and the number of pages per sheet).  Otherwise, the origin is at
          the top left corner of the imageable area (i.e. inside the
          margins). This property is available in GTK+ 2.10 and
          above.</entry>
        </row>

        </tbody>
      </tgroup>
      </informaltable>
    </blockquote>

  </refsect1>

  <refsect1 id="signal-prototypes-gtkprintoperation">
    <title>gtk.PrintOperation Signal Prototypes</title>

    <para><link linkend="signal-prototypes-gobject">gobject.GObject Signal Prototypes</link></para>
    <para><link linkend="signal-prototypes-gtkprintoperationpreview">gtk.PrintOperationPreview Signal Prototypes</link></para>

      <variablelist>
      <varlistentry>
        <term>"<link linkend="signal-gtkprintoperation--begin-print">begin-print</link>"</term>
        <listitem>
          <methodsynopsis language="python"><methodname>callback</methodname>
            <methodparam><parameter>operation</parameter></methodparam>
            <methodparam><parameter>context</parameter></methodparam>
            <methodparam><parameter>user_param1</parameter></methodparam>
            <methodparam><parameter>...</parameter></methodparam>
          </methodsynopsis>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>"<link linkend="signal-gtkprintoperation--create-custom-widget">create-custom-widget</link>"</term>
        <listitem>
          <methodsynopsis language="python"><methodname>callback</methodname>
            <methodparam><parameter>operation</parameter></methodparam>
            <methodparam><parameter>user_param1</parameter></methodparam>
            <methodparam><parameter>...</parameter></methodparam>
          </methodsynopsis>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>"<link linkend="signal-gtkprintoperation--custom-widget-apply">custom-widget-apply</link>"</term>
        <listitem>
          <methodsynopsis language="python"><methodname>callback</methodname>
            <methodparam><parameter>operation</parameter></methodparam>
            <methodparam><parameter>widget</parameter></methodparam>
            <methodparam><parameter>user_param1</parameter></methodparam>
            <methodparam><parameter>...</parameter></methodparam>
          </methodsynopsis>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>"<link linkend="signal-gtkprintoperation--done">done</link>"</term>
        <listitem>
          <methodsynopsis language="python"><methodname>callback</methodname>
            <methodparam><parameter>operation</parameter></methodparam>
            <methodparam><parameter>result</parameter></methodparam>
            <methodparam><parameter>user_param1</parameter></methodparam>
            <methodparam><parameter>...</parameter></methodparam>
          </methodsynopsis>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>"<link linkend="signal-gtkprintoperation--draw-page">draw-page</link>"</term>
        <listitem>
          <methodsynopsis language="python"><methodname>callback</methodname>
            <methodparam><parameter>operation</parameter></methodparam>
            <methodparam><parameter>context</parameter></methodparam>
            <methodparam><parameter>page_nr</parameter></methodparam>
            <methodparam><parameter>user_param1</parameter></methodparam>
            <methodparam><parameter>...</parameter></methodparam>
          </methodsynopsis>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>"<link linkend="signal-gtkprintoperation--end-print">end-print</link>"</term>
        <listitem>
          <methodsynopsis language="python"><methodname>callback</methodname>
            <methodparam><parameter>operation</parameter></methodparam>
            <methodparam><parameter>context</parameter></methodparam>
            <methodparam><parameter>user_param1</parameter></methodparam>
            <methodparam><parameter>...</parameter></methodparam>
          </methodsynopsis>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>"<link linkend="signal-gtkprintoperation--paginate">paginate</link>"</term>
        <listitem>
          <methodsynopsis language="python"><methodname>callback</methodname>
            <methodparam><parameter>printoperation</parameter></methodparam>
            <methodparam><parameter>context</parameter></methodparam>
            <methodparam><parameter>user_param1</parameter></methodparam>
            <methodparam><parameter>...</parameter></methodparam>
          </methodsynopsis>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>"<link linkend="signal-gtkprintoperation--preview">preview</link>"</term>
        <listitem>
          <methodsynopsis language="python"><methodname>callback</methodname>
            <methodparam><parameter>operation</parameter></methodparam>
            <methodparam><parameter>preview</parameter></methodparam>
            <methodparam><parameter>context</parameter></methodparam>
            <methodparam><parameter>parent</parameter></methodparam>
            <methodparam><parameter>user_param1</parameter></methodparam>
            <methodparam><parameter>...</parameter></methodparam>
          </methodsynopsis>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>"<link linkend="signal-gtkprintoperation--request-page-setup">request-page-setup</link>"</term>
        <listitem>
          <methodsynopsis language="python"><methodname>callback</methodname>
            <methodparam><parameter>operation</parameter></methodparam>
            <methodparam><parameter>context</parameter></methodparam>
            <methodparam><parameter>page_nr</parameter></methodparam>
            <methodparam><parameter>setup</parameter></methodparam>
            <methodparam><parameter>user_param1</parameter></methodparam>
            <methodparam><parameter>...</parameter></methodparam>
          </methodsynopsis>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>"<link linkend="signal-gtkprintoperation--status-changed">status-changed</link>"</term>
        <listitem>
          <methodsynopsis language="python"><methodname>callback</methodname>
            <methodparam><parameter>operation</parameter></methodparam>
            <methodparam><parameter>printoperation</parameter></methodparam>
            <methodparam><parameter>user_param1</parameter></methodparam>
            <methodparam><parameter>...</parameter></methodparam>
          </methodsynopsis>
        </listitem>
      </varlistentry>
    </variablelist>

  </refsect1>

  <refsect1>
    <title>Description</title>

    <para><link
    linkend="class-gtkprintoperation"><classname>gtk.PrintOperation</classname></link>
    is the high-level, portable printing API. It looks a bit different than
    other GTK+ dialogs such as the <link
    linkend="class-gtkfilechooser"><classname>gtk.FileChooser</classname></link>,
    since some platforms don't expose enough infrastructure to implement a
    good print dialog. On such platforms, <link
    linkend="class-gtkprintoperation"><classname>gtk.PrintOperation</classname></link>
    uses the native print dialog. On platforms which do not provide a native
    print dialog, GTK+ uses its own, see <link
    linkend="class-gtkprintunixdialog"><classname>gtkunixprint.PrintUnixDialog</classname></link>.</para>

    <para>The typical way to use the high-level printing API is to create a
    <link
    linkend="class-gtkprintoperation"><classname>gtk.PrintOperation</classname></link>
    object with the <link
    linkend="constructor-gtkprintoperation"><methodname>gtk.PrintOperation</methodname></link>
    constructor when the user selects to print. Then you set some properties
    on it, e.g. the page size, any <link
    linkend="class-gtkprintsettings"><classname>gtk.PrintSettings</classname></link>
    from previous print operations, the number of pages, the current page,
    etc.</para>

    <para>Then you start the print operation by calling the <link
    linkend="method-gtkprintoperation--run"><methodname>gtk.PrintOperation.run()</methodname></link>
    method.  It will then show a dialog, let the user select a printer and
    options.  When the user finished the dialog various signals will be
    emitted on the <link
    linkend="class-gtkprintoperation"><classname>gtk.PrintOperation</classname></link>,
    the main one being "draw-page", which you are supposed to catch and
    render the page on the provided <link
    linkend="class-gtkprintcontext"><classname>gtk.PrintContext</classname></link>
    using Cairo.</para>

<example>
<title>The high-level printing API</title>
<programlisting>
settings = None

def do_print():
  print_op = gtk.PrintOperation()

  if settings != None: 
    print_op.set_print_settings(settings)

  print_op.connect("begin_print", begin_print)
  print_op.connect("draw_page", draw_page)

  res = print_op.run(gtk.PRINT_OPERATION_ACTION_PRINT_DIALOG, main_window)

  if res == gtk.PRINT_OPERATION_RESULT_APPLY:
      settings = print_op.get_print_settings()
</programlisting>
</example>

<para>Printing support was added in GTK+ 2.10.</para>

  </refsect1>

  <refsect1>
    <title>Constructor</title>

    <refsect2 id="constructor-gtkprintoperation">
      <title>gtk.PrintOperation</title>

      <programlisting><constructorsynopsis language="python">
        <methodname>gtk.PrintOperation</methodname>
        <methodparam></methodparam>
      </constructorsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara>a new <link
          linkend="class-gtkprintoperation"><classname>gtk.PrintOperation</classname></link></simpara></listitem>
        </varlistentry>
      </variablelist>

      <note>
        <para>This constructor is available in PyGTK 2.10 and above.</para>
      </note>

      <para>Creates a new <link
      linkend="class-gtkprintoperation"><classname>gtk.PrintOperation</classname></link>.</para>

    </refsect2>

  </refsect1>

  <refsect1>
    <title>Methods</title>

    <refsect2 id="method-gtkprintoperation--set-default-page-setup">
      <title>gtk.PrintOperation.set_default_page_setup</title>

      <programlisting><methodsynopsis language="python">
        <methodname>set_default_page_setup</methodname>
        <methodparam><parameter role="keyword">default_page_setup</parameter><initializer>None</initializer></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">default_page_setup</parameter>&nbsp;:</term>
          <listitem><simpara>a <link
          linkend="class-gtkpagesetup"><classname>gtk.PageSetup</classname></link>,
          or <literal>None</literal></simpara></listitem>
        </varlistentry>
      </variablelist>

      <note>
        <para>This method is available in PyGTK 2.10 and above.</para>
      </note>

      <para>The <methodname>set_default_page_setup</methodname>() method
      makes <parameter>default_page_setup</parameter> the default page
      setup.</para>
      
      <para>This page setup will be used by the <link
      linkend="method-gtkprintoperation--run"><methodname>gtk.PrintOperation.run()</methodname></link>
      method, but it can be overridden on a per-page basis by connecting to
      the "request-page-setup" signal.</para>

    </refsect2>

    <refsect2 id="method-gtkprintoperation--get-default-page-setup">
      <title>gtk.PrintOperation.get_default_page_setup</title>

      <programlisting><methodsynopsis language="python">
        <methodname>get_default_page_setup</methodname>
        <methodparam></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara>the default page setup</simpara></listitem>
        </varlistentry>
      </variablelist>

      <note>
        <para>This method is available in PyGTK 2.10 and above.</para>
      </note>

      <para>The <methodname>get_default_page_setup</methodname>() method
      returns the default page setup, see the <link
      linkend="method-gtkprintoperation--set-default-page-setup"><methodname>gtk.PrintOperation.set_default_page_setup()</methodname></link>
      method.</para>

    </refsect2>

    <refsect2 id="method-gtkprintoperation--set-print-settings">
      <title>gtk.PrintOperation.set_print_settings</title>

      <programlisting><methodsynopsis language="python">
        <methodname>set_print_settings</methodname>
        <methodparam><parameter role="keyword">print_settings</parameter><initializer>None</initializer></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">print_settings</parameter>&nbsp;:</term>
          <listitem><simpara><link
          linkend="class-gtkprintsettings"><classname>gtk.PrintSettings</classname></link>,
          or <literal>None</literal></simpara></listitem>
        </varlistentry>
      </variablelist>

      <note>
        <para>This method is available in PyGTK 2.10 and above.</para>
      </note>

      <para>The <methodname>set_print_settings</methodname>() method sets
      the print settings. This is typically used to re-establish print
      settings from a previous print operation, see the <link
      linkend="method-gtkprintoperation--run"><methodname>gtk.PrintOperation.run()</methodname></link>
      method.</para>

    </refsect2>

    <refsect2 id="method-gtkprintoperation--get-print-settings">
      <title>gtk.PrintOperation.get_print_settings</title>

      <programlisting><methodsynopsis language="python">
        <methodname>get_print_settings</methodname>
        <methodparam></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara>the current print settings.</simpara></listitem>
        </varlistentry>
      </variablelist>

      <note>
        <para>This method is available in PyGTK 2.10 and above.</para>
      </note>

      <para>The <methodname>get_print_settings</methodname>() method returns
      the current print settings.</para>
      
      <para>Note that the return value is <literal>None</literal> until
      either the <link
      linkend="method-gtkprintoperation--set-print-settings"><methodname>gtk.PrintOperation.set_print_settings()</methodname></link>
      or <link
      linkend="method-gtkprintoperation--run"><methodname>gtk.PrintOperation.run()</methodname></link>
      methods have been called.</para>

    </refsect2>

    <refsect2 id="method-gtkprintoperation--set-job-name">
      <title>gtk.PrintOperation.set_job_name</title>

      <programlisting><methodsynopsis language="python">
        <methodname>set_job_name</methodname>
        <methodparam><parameter role="keyword">job_name</parameter></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">job_name</parameter>&nbsp;:</term>
          <listitem><simpara>a string that identifies the print
          job</simpara></listitem>
        </varlistentry>
      </variablelist>

      <note>
        <para>This method is available in PyGTK 2.10 and above.</para>
      </note>

      <para>The <methodname>set_job_name</methodname>() method sets the name
      of the print job. The name is used to identify the job (e.g. in
      monitoring applications like eggcups).</para>
      
      <para>If you don't set a job name, GTK+ picks a default one by
      numbering successive print jobs.</para>

    </refsect2>

    <refsect2 id="method-gtkprintoperation--set-n-pages">
      <title>gtk.PrintOperation.set_n_pages</title>

      <programlisting><methodsynopsis language="python">
        <methodname>set_n_pages</methodname>
        <methodparam><parameter role="keyword">n_pages</parameter></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">n_pages</parameter>&nbsp;:</term>
          <listitem><simpara>the number of pages</simpara></listitem>
        </varlistentry>
      </variablelist>

      <note>
        <para>This method is available in PyGTK 2.10 and above.</para>
      </note>

      <para>The <methodname>set_n_pages</methodname>() >method sets the
      number of pages in the document. </para>
      
      <para>This <emphasis>must</emphasis> be set to a positive number
      before the rendering starts. It may be set in a "begin-print" signal
      hander.</para>
      
      <para>Note that the page numbers passed to the "request-page-setup"
      and "draw-page" signals are 0-based, i.e. if the user chooses to print
      all pages, the last "draw-page" signal will be for page
      <parameter>n_pages</parameter> - 1.</para>

    </refsect2>

    <refsect2 id="method-gtkprintoperation--set-current-page">
      <title>gtk.PrintOperation.set_current_page</title>

      <programlisting><methodsynopsis language="python">
        <methodname>set_current_page</methodname>
        <methodparam><parameter role="keyword">current_page</parameter></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">current_page</parameter>&nbsp;:</term>
          <listitem><simpara>the current page, 0-based</simpara></listitem>
        </varlistentry>
      </variablelist>

      <note>
        <para>This method is available in PyGTK 2.10 and above.</para>
      </note>

      <para>The <methodname>set_current_page</methodname>() method sets the
      current page.</para>
      
      <para>If this is called before <link
      linkend="method-gtkprintoperation--run"><methodname>gtk.PrintOperation.run()</methodname></link>,
      the user will be able to select to print only the current page.</para>
      
      <para>Note that this only makes sense for pre-paginated
      documents.</para>

    </refsect2>

    <refsect2 id="method-gtkprintoperation--set-use-full-page">
      <title>gtk.PrintOperation.set_use_full_page</title>

      <programlisting><methodsynopsis language="python">
        <methodname>set_use_full_page</methodname>
        <methodparam><parameter role="keyword">full_page</parameter></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">full_page</parameter>&nbsp;:</term>
          <listitem><simpara><literal>True</literal> to set up the <link
          linkend="class-gtkprintcontext"><classname>gtk.PrintContext</classname></link>
          for the full page</simpara></listitem>
        </varlistentry>
      </variablelist>

      <note>
        <para>This method is available in PyGTK 2.10  and above.</para>
      </note>

      <para>The <methodname>set_use_full_page</methodname>() method sets the
      "full-page" property to the value of
      <parameter>full_page</parameter>. If <parameter>full_page</parameter>
      is <literal>True</literal>, the transformation for the cairo context
      obtained from <link
      linkend="class-gtkprintcontext"><classname>gtk.PrintContext</classname></link>
      puts the origin at the top left corner of the page (which may not be
      the top left corner of the sheet, depending on page orientation and
      the number of pages per sheet). Otherwise, the origin is at the top
      left corner of the imageable area (i.e. inside the margins).</para>

    </refsect2>

    <refsect2 id="method-gtkprintoperation--set-unit">
      <title>gtk.PrintOperation.set_unit</title>

      <programlisting><methodsynopsis language="python">
        <methodname>set_unit</methodname>
        <methodparam><parameter role="keyword">unit</parameter></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">unit</parameter>&nbsp;:</term>
          <listitem><simpara>the unit to use</simpara></listitem>
        </varlistentry>
      </variablelist>

      <note>
        <para>This method is available in PyGTK 2.10 and above.</para>
      </note>

      <para>The <methodname>set_unit</methodname>() method sets up the
      transformation for the cairo context such distances are measured in
      units of <parameter>unit</parameter>.</para>

    </refsect2>

    <refsect2 id="method-gtkprintoperation--set-export-filename">
      <title>gtk.PrintOperation.set_export_filename</title>

      <programlisting><methodsynopsis language="python">
        <methodname>set_export_filename</methodname>
        <methodparam><parameter role="keyword">filename</parameter></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">filename</parameter>&nbsp;:</term>
          <listitem><simpara>the filename for the exported file</simpara></listitem>
        </varlistentry>
      </variablelist>

      <note>
        <para>This method is available in PyGTK 2.10 and above.</para>
      </note>

      <para>The <methodname>set_export_filename</methodname>() method sets
      up the <link
      linkend="class-gtkprintoperation"><classname>gtk.PrintOperation</classname></link>
      to generate a file instead of showing the print dialog. The intended
      use of this method is for implementing "Export to PDF"
      actions. Currently, PDF is the only supported format.</para>
      
      <para>"Print to PDF" support is independent of this and is done by
      letting the user pick the "Print to PDF" item from the list of
      printers in the print dialog.</para>

    </refsect2>

    <refsect2 id="method-gtkprintoperation--set-track-print-status">
      <title>gtk.PrintOperation.set_track_print_status</title>

      <programlisting><methodsynopsis language="python">
        <methodname>set_track_print_status</methodname>
        <methodparam><parameter role="keyword">track_status</parameter></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">track_status</parameter>&nbsp;:</term>
          <listitem><simpara>if <literal>True</literal> track status after
          printing</simpara></listitem>
        </varlistentry>
      </variablelist>

      <note>
        <para>This method is available in PyGTK 2.10 and above.</para>
      </note>

      <para>The <methodname>set_track_print_status</methodname>() method
      sets the "track-print-status" to the value of
      <parameter>track_status</parameter>. If
      <parameter>track_status</parameter> is <literal>True</literal>, the
      print operation will try to continue report on the status of the print
      job in the printer queues and printer. This can allow your application
      to show things like "out of paper" issues, and when the print job
      actually reaches the printer.</para>
      
      <para>This method is often implemented using some form of polling, so
      it should not be enabled unless needed.</para>

    </refsect2>

    <refsect2 id="method-gtkprintoperation--set-show-progress">
      <title>gtk.PrintOperation.set_show_progress</title>

      <programlisting><methodsynopsis language="python">
        <methodname>set_show_progress</methodname>
        <methodparam><parameter role="keyword">show_progress</parameter></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">show_progress</parameter>&nbsp;:</term>
          <listitem><simpara>if <literal>True</literal> show a progress
          dialog</simpara></listitem>
        </varlistentry>
      </variablelist>

      <note>
        <para>This method is available in PyGTK 2.10 and above.</para>
      </note>

      <para>The <methodname>set_show_progress</methodname>() method sets the
      "show-progress" property to the value of
      <parameter>show_progress</parameter>. If
      <parameter>show_progress</parameter> is <literal>True</literal>, the
      print operation will show a progress dialog during the print
      operation.</para>

    </refsect2>

    <refsect2 id="method-gtkprintoperation--set-allow-async">
      <title>gtk.PrintOperation.set_allow_async</title>

      <programlisting><methodsynopsis language="python">
        <methodname>set_allow_async</methodname>
        <methodparam><parameter role="keyword">allow_async</parameter></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">allow_async</parameter>&nbsp;:</term>
          <listitem><simpara>if <literal>True</literal> allow asynchronous
          operation</simpara></listitem>
        </varlistentry>
      </variablelist>

      <note>
        <para>This method is available in PyGTK 2.10 and above.</para>
      </note>

      <para>The <methodname>set_allow_async</methodname>() method sets the
      "allow-async" to the value of <parameter>allow_async</parameter>. If
      <parameter>allow_async</parameter> is <literal>True</literal> the
      <link
      linkend="method-gtkprintoperation--run"><methodname>gtk.PrintOperation.run()</methodname></link>
      may return before the print operation is completed. Note that some
      platforms may not allow asynchronous operation.</para>

    </refsect2>

    <refsect2 id="method-gtkprintoperation--set-custom-tab-label">
      <title>gtk.PrintOperation.set_custom_tab_label</title>

      <programlisting><methodsynopsis language="python">
        <methodname>set_custom_tab_label</methodname>
        <methodparam><parameter role="keyword">label</parameter></methodparam>
      </methodsynopsis></programlisting>

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

      <note>
        <para>This method is available in PyGTK 2.10 and above.</para>
      </note>

      <para>The <methodname>set_custom_tab_label</methodname>() method sets
      the label for the tab holding custom widgets.</para>

    </refsect2>

    <refsect2 id="method-gtkprintoperation--run">
      <title>gtk.PrintOperation.run</title>

      <programlisting><methodsynopsis language="python">
        <methodname>run</methodname>
        <methodparam><parameter role="keyword">action</parameter></methodparam>
        <methodparam><parameter role="keyword">parent</parameter><initializer>None</initializer></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">action</parameter>&nbsp;:</term>
          <listitem><simpara>the action to start - one of the <xref
          linkend="gtk-print-operation-action-constants"
          endterm="gtk-print-operation-action-constants-title"></xref></simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter role="keyword">parent</parameter>&nbsp;:</term>
          <listitem><simpara>Transient parent of the dialog, or <literal>None</literal></simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara>the result of the print operation - one of the
          <xref linkend="gtk-print-operation-result-constants"
          endterm="gtk-print-operation-result-constants-title"></xref>. A
          return value of
          <literal>gtk.PRINT_OPERATION_RESULT_APPLY</literal> indicates that
          the printing was completed successfully. In this case, it is a
          good idea to obtain the used print settings with the <link
          linkend="method-gtkprintoperation--get-print-settings"><methodname>gtk.PrintOperation.get_print_settings()</methodname></link>
          method and store them for reuse with the next print operation. A
          value of <literal>gtk.PRINT_OPERATION_RESULT_IN_PROGRESS</literal>
          means the operation is running asynchronously, and will emit the
          "done" signal when done.</simpara></listitem>
        </varlistentry>
      </variablelist>

      <note>
        <para>This method is available in PyGTK 2.10 and above.</para>
      </note>

      <para>The <methodname>run</methodname>() method runs the print
      operation, by first letting the user modify print settings in the
      print dialog, and then print the document.</para>
      
      <para>Normally that this method does not return until the rendering of
      all pages is complete. You can connect to the "status-changed" signal
      to obtain some information about the progress of the print operation.
      Furthermore, it may use a recursive mainloop to show the print
      dialog.</para>
      
      <para>If you call the <link
      linkend="method-gtkprintoperation--set-allow-async"><methodname>gtk.PrintOperation.set_allow_async()</methodname></link>
      method or set the "allow-async" property the operation will run
      asyncronously if this is supported on the platform. The "done" signal
      will be emitted with the operation results when the operation is done
      (i.e. when the dialog is canceled, or when the print succeeds or
      fails).</para>
      
            <para><informalexample><programlisting>
      if settings != None:
        print.set_print_settings( settings)
        
      if page_setup != None:
        print.set_default_page_setup(page_setup)
        
      print.connect( "begin-print", begin_print, data)
      print.connect("draw-page", draw_page, data)
       
      res = print.run(gtk.PRINT_OPERATION_ACTION_PRINT_DIALOG, parent)
       
      if res == gtkprint_OPERATION_RESULT_ERROR:
         error_dialog = gtk.MessageDialog(parent,
                                          gtk.DIALOG_DESTROY_WITH_PARENT,
                                          gtk.MESSAGE_ERROR,
      					  gtk.BUTTONS_CLOSE,
      					  "Error printing file:\n")
         error_dialog.connect("response", lambda w,id: w.destroy())
         error_dialog.show()
      elif res == gtk.PRINT_OPERATION_RESULT_APPLY:
         settings = print.get_print_settings()
      </programlisting></informalexample></para>

    </refsect2>

    <refsect2 id="method-gtkprintoperation--get-error">
      <title>gtk.PrintOperation.get_error</title>

      <programlisting><methodsynopsis language="python">
        <methodname>get_error</methodname>
        <methodparam></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara>the error message or
          <literal>None</literal></simpara></listitem>
        </varlistentry>
      </variablelist>

      <note>
        <para>This method is available in PyGTK 2.10 and above.</para>
      </note>

      <para>The <methodname>get_error</methodname>() method returns the
      error message or <literal>None</literal>. Call this when the result of
      a print operation is
      <literal>gtk.PRINT_OPERATION_RESULT_ERROR</literal>, either as
      returned by the <link
      linkend="method-gtkprintoperation--run"><methodname>gtk.PrintOperation.run()</methodname></link>
      method, or in the "done" signal handler.</para>

    </refsect2>

    <refsect2 id="method-gtkprintoperation--get-status">
      <title>gtk.PrintOperation.get_status</title>

      <programlisting><methodsynopsis language="python">
        <methodname>get_status</methodname>
        <methodparam></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara>the status of the print
          operation</simpara></listitem>
        </varlistentry>
      </variablelist>

      <note>
        <para>This method is available in PyGTK 2.10 and above.</para>
      </note>

      <para>The <methodname>get_status</methodname>() method returns the
      status of the print operation as one of the <xref
      linkend="gtk-print-status-constants"
      endterm="gtk-print-status-constants-title"></xref>. Also see the <link
      linkend="method-gtkprintoperation--get-status-string"><methodname>gtk.PrintOperation.get_status_string()</methodname></link>
      method.</para>

    </refsect2>

    <refsect2 id="method-gtkprintoperation--get-status-string">
      <title>gtk.PrintOperation.get_status_string</title>

      <programlisting><methodsynopsis language="python">
        <methodname>get_status_string</methodname>
        <methodparam></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara>a string representation of the status of the
          print operation</simpara></listitem>
        </varlistentry>
      </variablelist>

      <note>
        <para>This method is available in PyGTK 2.10 and above.</para>
      </note>

      <para>The <methodname>get_status_string</methodname>() method returns
      a string representation of the status of the print operation. The
      string is translated and suitable for displaying the print status
      e.g. in a <link
      linkend="class-gtkstatusbar"><classname>gtk.Statusbar</classname></link>.</para>
      
            <para>Use the <link
            linkend="method-gtkprintoperation--get-status"><methodname>gtk.PrintOperation.get_status()</methodname></link>
            method to obtain a status value that is suitable for
            programmatic use.</para>

    </refsect2>

    <refsect2 id="method-gtkprintoperation--is-finished">
      <title>gtk.PrintOperation.is_finished</title>

      <programlisting><methodsynopsis language="python">
        <methodname>is_finished</methodname>
        <methodparam></methodparam>
      </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara><literal>True</literal>, if the print operation
          is finished.</simpara></listitem>
        </varlistentry>
      </variablelist>

      <note>
        <para>This method is available in PyGTK 2.10 and above.</para>
      </note>

      <para>The method returns True if the print operation is
      completed. This is a convenience method to find out if the print
      operation is finished, either successfully
      (<literal>gtk.PRINT_STATUS_FINISHED</literal>) or unsuccessfully
      (<literal>gtk.PRINT_STATUS_FINISHED_ABORTED</literal>).</para>

      <note>
        <para>When you enable print status tracking, the print operation can
        be in a non-finished state even after done has been called, as the
        operation status then tracks the print job status on the
        printer.</para>
      </note>

    </refsect2>

    <refsect2 id="method-gtkprintoperation--cancel">
      <title>gtk.PrintOperation.cancel</title>

      <programlisting><methodsynopsis language="python">
        <methodname>cancel</methodname>
        <methodparam></methodparam>
      </methodsynopsis></programlisting>

      <note>
        <para>This method is available in PyGTK 2.10 and above.</para>
      </note>

      <para>The <methodname>cancel</methodname>() method cancels a running
      print operation. This method may be called from a "begin-print",
      "paginate" or "draw-page" signal handler to stop the currently running
      print operation.</para>

    </refsect2>

    <refsect2 id="method-gtkprintoperation--set-support-selection">
      <title>gtk.PrintOperation.set_support_selection</title>

      <programlisting><methodsynopsis language="python">
        <methodname>set_support_selection</methodname>
        <methodparam><parameter role="keyword">support_selection</parameter></methodparam>
      </methodsynopsis></programlisting>
      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">support_selection</parameter>&nbsp;:</term>
          <listitem><simpara><literal>True</literal> to support selection.</simpara></listitem>
        </varlistentry>
      </variablelist>

      <note>
        <para>This method is available in PyGTK 2.22 and above.</para>
      </note>

      <para>The <methodname>set_support_selection</methodname>() method sets whether "print selection" is supported by the print operation.</para>

    </refsect2>

    <refsect2 id="method-gtkprintoperation--get-support-selection">
      <title>gtk.PrintOperation.get_support_selection</title>

      <programlisting><methodsynopsis language="python">
        <methodname>get_support_selection</methodname>
        <methodparam></methodparam>
      </methodsynopsis></programlisting>
      <variablelist>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara>whether the application supports print of selection.</simpara></listitem>
        </varlistentry>
      </variablelist>

      <note>
        <para>This method is available in PyGTK 2.22 and above.</para>
      </note>

      <para>The <methodname>get_support_selection</methodname>() method gets whether "print selection" is supported by the print operation.</para>

    </refsect2>

    <refsect2 id="method-gtkprintoperation--set-has-selection">
      <title>gtk.PrintOperation.set_has_selection</title>

      <programlisting><methodsynopsis language="python">
        <methodname>set_has_selection</methodname>
        <methodparam><parameter role="keyword">has_selection</parameter></methodparam>
      </methodsynopsis></programlisting>
      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">has_selection</parameter>&nbsp;:</term>
          <listitem><simpara><literal>True</literal> indicates that a selection exists.</simpara></listitem>
        </varlistentry>
      </variablelist>

      <note>
        <para>This method is available in PyGTK 2.22 and above.</para>
      </note>

      <para>The <methodname>set_has_selection</methodname>() method sets whether there is a selection to print.</para>

    </refsect2>

    <refsect2 id="method-gtkprintoperation--get-has-selection">
      <title>gtk.PrintOperation.get_has_selection</title>

      <programlisting><methodsynopsis language="python">
        <methodname>get_has_selection</methodname>
        <methodparam></methodparam>
      </methodsynopsis></programlisting>
      <variablelist>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara><literal>True</literal> when a selection exists.</simpara></listitem>
        </varlistentry>
      </variablelist>

      <note>
        <para>This method is available in PyGTK 2.22 and above.</para>
      </note>

      <para>The <methodname>get_has_selection</methodname>() method gets whether there is a selection to print.</para>

    </refsect2>

    <refsect2 id="method-gtkprintoperation--set-embed-page-setup">
      <title>gtk.PrintOperation.set_embed_page_setup</title>

      <programlisting><methodsynopsis language="python">
        <methodname>set_embed_page_setup</methodname>
        <methodparam><parameter role="keyword">embed</parameter></methodparam>
      </methodsynopsis></programlisting>
      <variablelist>
        <varlistentry>
          <term><parameter role="keyword">embed</parameter>&nbsp;:</term>
          <listitem><simpara><literal>True</literal> to embed page setup selection in the GtkPrintDialog.</simpara></listitem>
        </varlistentry>
      </variablelist>

      <note>
        <para>This method is available in PyGTK 2.22 and above.</para>
      </note>

      <para>The <methodname>set_embed_page_setup</methodname>() method embeds the page size combo box and orientation combo box
      into the page setup page. Selected page setup is stored as default page setup in the print operation.</para>

    </refsect2>

    <refsect2 id="method-gtkprintoperation--get-embed-page-setup">
      <title>gtk.PrintOperation.get_embed_page_setup</title>

      <programlisting><methodsynopsis language="python">
        <methodname>get_embed_page_setup</methodname>
        <methodparam></methodparam>
      </methodsynopsis></programlisting>
      <variablelist>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara><literal>True</literal> when page setup selection combos are embedded.</simpara></listitem>
        </varlistentry>
      </variablelist>

      <note>
        <para>This method is available in PyGTK 2.22 and above.</para>
      </note>

      <para>The <methodname>get_embed_page_setup</methodname>() method XXX.</para>

    </refsect2>

    <refsect2 id="method-gtkprintoperation--get-n-pages-to-print">
      <title>gtk.PrintOperation.get_n_pages_to_print</title>

      <programlisting><methodsynopsis language="python">
        <methodname>get_n_pages_to_print</methodname>
        <methodparam></methodparam>
      </methodsynopsis></programlisting>
      <variablelist>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara>the number of pages that will be printed.</simpara></listitem>
        </varlistentry>
      </variablelist>

      <note>
        <para>This method is available in PyGTK 2.22 and above.</para>
      </note>

      <para>The <methodname>get_n_pages_to_print</methodname>() method returns the number of pages that will be printed.</para>

      <para>Note that this value is set during print preparation phase (<literal>gtk.PRINT_STATUS_PREPARING)</literal>, so this
      function should never be called before the data generation phase (<literal>gtk.PRINT_STATUS_GENERATING_DATA</literal>). You
      can connect to the "status-changed" signal and call <methodname>get_n_pages_to_print</methodname>() when print status is
      <literal>gtk.PRINT_STATUS_GENERATING_DATA</literal>. This is typically used to track the progress of print operation.</para>

    </refsect2>

    <refsect2 id="method-gtkprintoperation--draw-page-finish">
      <title>gtk.PrintOperation.draw_page_finish</title>

      <programlisting><methodsynopsis language="python">
        <methodname>draw_page_finish</methodname>
        <methodparam></methodparam>
      </methodsynopsis></programlisting>

      <note>
        <para>This method is available in PyGTK 2.16 and above.</para>
      </note>

      <para>The <methodname>draw_page_finish</methodname>() method signals that the drawing of a particular page is complete.</para>

      <para>It is called after completion of page drawing (e.g. drawing in another thread). If
      <methodname><link linkend="method-gtkprintoperation--set-defer-drawing">set_defer_drawing</link></methodname>()
      was called before, then this function has to be called by application. In another case it is called by the library itself.</para>

    </refsect2>

    <refsect2 id="method-gtkprintoperation--set-defer-drawing">
      <title>gtk.PrintOperation.set_defer_drawing</title>

      <programlisting><methodsynopsis language="python">
        <methodname>set_defer_drawing</methodname>
        <methodparam></methodparam>
      </methodsynopsis></programlisting>

      <note>
        <para>This method is available in PyGTK 2.16 and above.</para>
      </note>

      <para>The <methodname>set_defer_drawing</methodname>() method sets up the print operation to wait for calling of
      <methodname><link linkend="method-gtkprintoperation--draw-page-finish">draw_page_finish</link></methodname>()
      from application. It can be used for drawing page in another thread.</para>

      <para>This function must be called in the callback of "draw-page" signal. .</para>

    </refsect2>

  </refsect1>

  <refsect1>
    <title>Signals</title>

    <refsect2 id="signal-gtkprintoperation--begin-print">
      <title>The "begin-print" gtk.PrintOperation Signal</title>

      <programlisting><methodsynopsis language="python"><methodname>callback</methodname>
            <methodparam><parameter>operation</parameter></methodparam>
            <methodparam><parameter>context</parameter></methodparam>
            <methodparam><parameter>user_param1</parameter></methodparam>
            <methodparam><parameter>...</parameter></methodparam>
          </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter>operation</parameter>&nbsp;:</term>
          <listitem><simpara>the <link
          linkend="class-gtkprintoperation"><classname>gtk.PrintOperation</classname></link>
          on which the signal was emitted</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter>context</parameter>&nbsp;:</term>
          <listitem><simpara>the <link
          linkend="class-gtkprintcontext"><classname>gtk.PrintContext</classname></link>
          for the current operation</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter>user_param1</parameter>&nbsp;:</term>
          <listitem><simpara>the first user parameter (if any) specified
          with the <link
          linkend="method-gobject--connect"><methodname>connect</methodname>()</link>
          method</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter>...</parameter>&nbsp;:</term>
          <listitem><simpara>additional user parameters (if any)</simpara></listitem>
        </varlistentry>
      </variablelist>

      <note>
        <para>This signal is available in GTK+ 2.10 and above.</para>
      </note>

      <para>The "begin-print" signal is emitted after the user has finished
      changing print settings in the dialog, before the actual rendering
      starts.</para>
      
      <para>A typical use for this signal is to use the parameters from the
      <link
      linkend="class-gtkprintcontext"><classname>gtk.PrintContext</classname></link>
      and paginate the document accordingly, and then set the number of
      pages with <link
      linkend="method-gtkprintoperation--set-n-pages"><methodname>gtk.PrintOperation.set_n_pages()</methodname></link>.</para>

    </refsect2>

    <refsect2 id="signal-gtkprintoperation--create-custom-widget">
      <title>The "create-custom-widget" gtk.PrintOperation Signal</title>

      <programlisting><methodsynopsis language="python"><methodname>callback</methodname>
            <methodparam><parameter>operation</parameter></methodparam>
            <methodparam><parameter>user_param1</parameter></methodparam>
            <methodparam><parameter>...</parameter></methodparam>
          </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter>operation</parameter>&nbsp;:</term>
          <listitem><simpara>the <link linkend="class-gtkprintoperation"><classname>gtk.PrintOperation</classname></link> on which the signal was emitted</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter>user_param1</parameter>&nbsp;:</term>
          <listitem><simpara>the first user parameter (if any) specified
          with the <link
          linkend="method-gobject--connect"><methodname>connect</methodname>()</link>
          method</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter>...</parameter>&nbsp;:</term>
          <listitem><simpara>additional user parameters (if any)</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara>A custom widget that gets embedded in the print
          dialog, or <literal>None</literal></simpara></listitem>
        </varlistentry>
      </variablelist>

      <note>
        <para>This signal is available in GTK+ 2.10 and above.</para>
      </note>

      <para>The "create-custom-widget" signal is emitted when displaying the
      print dialog. If you return a widget in a handler for this signal it
      will be added to a custom tab in the print dialog. You typically
      return a container widget with multiple widgets in it.</para>
      
      <para>The print dialog owns the returned widget, and its lifetime
      isn't controlled by the app. However, the widget is guaranteed to stay
      around until the "custom-widget-apply" signal is emitted on the
      operation. Then you can read out any information you need from the
      widgets.</para>

    </refsect2>

    <refsect2 id="signal-gtkprintoperation--custom-widget-apply">
      <title>The "custom-widget-apply" gtk.PrintOperation Signal</title>

      <programlisting><methodsynopsis language="python"><methodname>callback</methodname>
            <methodparam><parameter>operation</parameter></methodparam>
            <methodparam><parameter>widget</parameter></methodparam>
            <methodparam><parameter>user_param1</parameter></methodparam>
            <methodparam><parameter>...</parameter></methodparam>
          </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter>operation</parameter>&nbsp;:</term>
          <listitem><simpara>the <link linkend="class-gtkprintoperation"><classname>gtk.PrintOperation</classname></link> on which the signal was emitted</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter>widget</parameter>&nbsp;:</term>
          <listitem><simpara>the custom widget added in create-custom-widget</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter>user_param1</parameter>&nbsp;:</term>
          <listitem><simpara>the first user parameter (if any) specified
          with the <link
          linkend="method-gobject--connect"><methodname>connect</methodname>()</link>
          method</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter>...</parameter>&nbsp;:</term>
          <listitem><simpara>additional user parameters (if any)</simpara></listitem>
        </varlistentry>
      </variablelist>

      <note>
        <para>This signal is available in GTK+ 2.10 and above.</para>
      </note>

      <para>The "custom-widget-apply" signal is emitted right before
      "begin-print" if you added a custom widget in the
      "create-custom-widget" handler. When you get this signal you should
      read the information from the custom widgets, as the widgets are not
      guaraneed to be around at a later time.</para>

    </refsect2>

    <refsect2 id="signal-gtkprintoperation--done">
      <title>The "done" gtk.PrintOperation Signal</title>

      <programlisting><methodsynopsis language="python"><methodname>callback</methodname>
            <methodparam><parameter>operation</parameter></methodparam>
            <methodparam><parameter>result</parameter></methodparam>
            <methodparam><parameter>user_param1</parameter></methodparam>
            <methodparam><parameter>...</parameter></methodparam>
          </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter>operation</parameter>&nbsp;:</term>
          <listitem><simpara>the <link linkend="class-gtkprintoperation"><classname>gtk.PrintOperation</classname></link> on which the signal was emitted</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter>result</parameter>&nbsp;:</term>
          <listitem><simpara>the result of the print operation</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter>user_param1</parameter>&nbsp;:</term>
          <listitem><simpara>the first user parameter (if any) specified
          with the <link
          linkend="method-gobject--connect"><methodname>connect</methodname>()</link>
          method</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter>...</parameter>&nbsp;:</term>
          <listitem><simpara>additional user parameters (if any)</simpara></listitem>
        </varlistentry>
      </variablelist>

      <note>
        <para>This signal is available in GTK+ 2.10 and above.</para>
      </note>

      <para>The "done" signal is emitted when the print operation run has
      finished doing everything required for
      printing. <parameter>result</parameter> (one of the <xref
      linkend="gtk-print-operation-result-constants"
      endterm="gtk-print-operation-result-constants-title"></xref>) gives
      you information about what happened during the run. If
      <parameter>result</parameter> is
      <literal>gtk.PRINT_OPERATION_RESULT_ERROR</literal> then you can call
      the <link
      linkend="method-gtkprintoperation--get-error"><methodname>gtk.PrintOperation.get_error()</methodname></link>
      method for more information.</para>
      
      <para>If you enabled print status tracking then the <link
      linkend="method-gtkprintoperation--is-finished"><methodname>gtk.PrintOperation.is_finished()</methodname></link>
      method may still return <literal>False</literal> after this was
      emitted.</para>

    </refsect2>

    <refsect2 id="signal-gtkprintoperation--draw-page">
      <title>The "draw-page" gtk.PrintOperation Signal</title>

      <programlisting><methodsynopsis language="python"><methodname>callback</methodname>
            <methodparam><parameter>operation</parameter></methodparam>
            <methodparam><parameter>context</parameter></methodparam>
            <methodparam><parameter>page_nr</parameter></methodparam>
            <methodparam><parameter>user_param1</parameter></methodparam>
            <methodparam><parameter>...</parameter></methodparam>
          </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter>operation</parameter>&nbsp;:</term>
          <listitem><simpara>the <link linkend="class-gtkprintoperation"><classname>gtk.PrintOperation</classname></link> on which the signal was emitted</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter>context</parameter>&nbsp;:</term>
          <listitem><simpara>the <link linkend="class-gtkprintcontext"><classname>gtk.PrintContext</classname></link> for the current operation</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter>page_nr</parameter>&nbsp;:</term>
          <listitem><simpara>the number of the currently printed page</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter>user_param1</parameter>&nbsp;:</term>
          <listitem><simpara>the first user parameter (if any) specified
          with the <link
          linkend="method-gobject--connect"><methodname>connect</methodname>()</link>
          method</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter>...</parameter>&nbsp;:</term>
          <listitem><simpara>additional user parameters (if any)</simpara></listitem>
        </varlistentry>
      </variablelist>

      <note>
        <para>This signal is available in GTK+ 2.10 and above.</para>
      </note>

      <para>The "draw-page" signal is emitted for every page that is
      printed. The signal handler must render the
      <parameter>page_nr</parameter>'s page onto the cairo context obtained
      from <parameter>context</parameter> using <link
      linkend="method-gtkprintcontext--get-cairo-context"><methodname>gtk.PrintContext.get_cairo_context()</methodname></link>.</para>
      
            <para><informalexample><programlisting>
def draw_page(operation, context, page_nr, user_data):
        cr = context.get_cairo_context()
        width = context.get_width()
        
        cr.rectangle(0, 0, width, HEADER_HEIGHT)
        
        cr.set_source_rgb(0.8, 0.8, 0.8);
        cr.fill()
        
        layout = context.create_pango_layout()
        
        desc = pango.FontDescription("sans 14")
        layout.set_font_description(desc)
        
        layout.set_text("some text")
        layout.set_width(width)
        layout.set_alignment(pango.ALIGN_CENTER)
           		      
        x,layout_height = layout.get_size()
        text_height = layout_height / pango.SCALE
        
        cr.move_to(width / 2,  (HEADER_HEIGHT - text_height) / 2)
        cr.show_layout(layout)
      </programlisting></informalexample></para>
      
            <para>Use the <link
            linkend="method-gtkprintoperation--set-use-full-page"><methodname>gtk.PrintOperation.set_use_full_page()</methodname></link>
            and <link
            linkend="method-gtkprintoperation--set-unit"><methodname>gtk.PrintOperation.set_unit()</methodname></link>
            methods before starting the print operation to set up the
            transformation of the cairo context according to your
            needs.</para>

    </refsect2>

    <refsect2 id="signal-gtkprintoperation--end-print">
      <title>The "end-print" gtk.PrintOperation Signal</title>

      <programlisting><methodsynopsis language="python"><methodname>callback</methodname>
            <methodparam><parameter>operation</parameter></methodparam>
            <methodparam><parameter>context</parameter></methodparam>
            <methodparam><parameter>user_param1</parameter></methodparam>
            <methodparam><parameter>...</parameter></methodparam>
          </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter>operation</parameter>&nbsp;:</term>
          <listitem><simpara>the <link linkend="class-gtkprintoperation"><classname>gtk.PrintOperation</classname></link> on which the signal was emitted</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter>context</parameter>&nbsp;:</term>
          <listitem><simpara>the <link linkend="class-gtkprintcontext"><classname>gtk.PrintContext</classname></link> for the current operation</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter>user_param1</parameter>&nbsp;:</term>
          <listitem><simpara>the first user parameter (if any) specified
          with the <link
          linkend="method-gobject--connect"><methodname>connect</methodname>()</link>
          method</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter>...</parameter>&nbsp;:</term>
          <listitem><simpara>additional user parameters (if any)</simpara></listitem>
        </varlistentry>
      </variablelist>

      <note>
        <para>This signal is available in GTK+ 2.10 and above.</para>
      </note>

      <para>The "end-print" signal is emitted after all pages have been
      rendered.  A handler for this signal can clean up any resources that
      have been allocated in the "begin-print" handler.</para>

    </refsect2>

    <refsect2 id="signal-gtkprintoperation--paginate">
      <title>The "paginate" gtk.PrintOperation Signal</title>

      <programlisting><methodsynopsis language="python"><methodname>callback</methodname>
            <methodparam><parameter>printoperation</parameter></methodparam>
            <methodparam><parameter>context</parameter></methodparam>
            <methodparam><parameter>user_param1</parameter></methodparam>
            <methodparam><parameter>...</parameter></methodparam>
          </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter>printoperation</parameter>&nbsp;:</term>
          <listitem><simpara>the object which received the signal.</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter>context</parameter>&nbsp;:</term>
          <listitem><simpara>the <link
          linkend="class-gtkprintcontext"><classname>gtk.PrintContext</classname></link>
          for the current operation</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter>user_param1</parameter>&nbsp;:</term>
          <listitem><simpara>the first user parameter (if any) specified
          with the <link
          linkend="method-gobject--connect"><methodname>connect</methodname>()</link>
          method</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter>...</parameter>&nbsp;:</term>
          <listitem><simpara>additional user parameters (if any)</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara></simpara></listitem>
        </varlistentry>
      </variablelist>

      <note>
        <para>This signal is available in GTK+ 2.10 and above.</para>
      </note>

      <para>The "paginate" signal is emitted after the "begin-print" signal,
      but before the actual rendering starts. It keeps getting emitted until
      it returns <literal>False</literal>.</para>

      <para>This signal is intended to be used for paginating the document
      in small chunks, to avoid blocking the user interface for a long
      time. The signal handler should update the number of pages using the
      <link
      linkend="method-gtkprintoperation--set-n-pages"><methodname>gtk.PrintOperation.set_n_pages</methodname>()</link>
      method, and return <literal>True</literal> if the document has been
      completely paginated.</para>

      <para>If you don't need to do pagination in chunks, you can simply do
      it all in the "begin-print" handler, and set the number of pages from
      there.</para>

    </refsect2>

    <refsect2 id="signal-gtkprintoperation--preview">
      <title>The "preview" gtk.PrintOperation Signal</title>

      <programlisting><methodsynopsis language="python"><methodname>callback</methodname>
            <methodparam><parameter>operation</parameter></methodparam>
            <methodparam><parameter>preview</parameter></methodparam>
            <methodparam><parameter>context</parameter></methodparam>
            <methodparam><parameter>parent</parameter></methodparam>
            <methodparam><parameter>user_param1</parameter></methodparam>
            <methodparam><parameter>...</parameter></methodparam>
          </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter>operation</parameter>&nbsp;:</term>
          <listitem><simpara>the <link linkend="class-gtkprintoperation"><classname>gtk.PrintOperation</classname></link> on which the signal was emitted</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter>preview</parameter>&nbsp;:</term>
          <listitem><simpara>the <literal>GtkPrintPreviewOperation</literal> for the current operation</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter>context</parameter>&nbsp;:</term>
          <listitem><simpara>the <link linkend="class-gtkprintcontext"><classname>gtk.PrintContext</classname></link> that will be used</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter>parent</parameter>&nbsp;:</term>
          <listitem><simpara>the <link linkend="class-gtkwindow"><classname>gtk.Window</classname></link> to use as window parent, or <literal>None</literal></simpara></listitem>
        </varlistentry>
       <varlistentry>
          <term><parameter>user_param1</parameter>&nbsp;:</term>
          <listitem><simpara>the first user parameter (if any) specified
          with the <link
          linkend="method-gobject--connect"><methodname>connect</methodname>()</link>
          method</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter>...</parameter>&nbsp;:</term>
          <listitem><simpara>additional user parameters (if any)</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><emphasis>Returns</emphasis>&nbsp;:</term>
          <listitem><simpara><literal>True</literal> if the listener wants to take over control of the preview</simpara></listitem>
        </varlistentry>
      </variablelist>

      <note>
        <para>This signal is available in GTK+ 2.10 and above.</para>
      </note>

      <para>The "preview" signal is emitted when a preview is requested from
      the native dialog.  If you handle this you must set the cairo context
      on the printing context.</para>
      
      <para>If you don't override this, a default implementation using an
      external viewer will be used.</para>

    </refsect2>

    <refsect2 id="signal-gtkprintoperation--request-page-setup">
      <title>The "request-page-setup" gtk.PrintOperation Signal</title>

      <programlisting><methodsynopsis language="python"><methodname>callback</methodname>
            <methodparam><parameter>operation</parameter></methodparam>
            <methodparam><parameter>context</parameter></methodparam>
            <methodparam><parameter>page_nr</parameter></methodparam>
            <methodparam><parameter>setup</parameter></methodparam>
            <methodparam><parameter>user_param1</parameter></methodparam>
            <methodparam><parameter>...</parameter></methodparam>
          </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter>operation</parameter>&nbsp;:</term>
          <listitem><simpara>the <link linkend="class-gtkprintoperation"><classname>gtk.PrintOperation</classname></link> on which the signal was emitted</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter>context</parameter>&nbsp;:</term>
          <listitem><simpara>the <link linkend="class-gtkprintcontext"><classname>gtk.PrintContext</classname></link> for the current operation</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter>page_nr</parameter>&nbsp;:</term>
          <listitem><simpara>the number of the currently printed page</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter>setup</parameter>&nbsp;:</term>
          <listitem><simpara>the <link linkend="class-gtkpagesetup"><classname>gtk.PageSetup</classname></link></simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter>user_param1</parameter>&nbsp;:</term>
          <listitem><simpara>the first user parameter (if any) specified
          with the <link
          linkend="method-gobject--connect"><methodname>connect</methodname>()</link>
          method</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter>...</parameter>&nbsp;:</term>
          <listitem><simpara>additional user parameters (if any)</simpara></listitem>
        </varlistentry>
      </variablelist>

      <note>
        <para>This signal is available in GTK+ 2.10 and above.</para>
      </note>

      <para>The "request-page-setup" signal is emitted once for every page
      that is printed, to give the application a chance to modify the page
      setup. Any changes done to <parameter>setup</parameter> will be in
      force only for printing this page.</para>

    </refsect2>

    <refsect2 id="signal-gtkprintoperation--status-changed">
      <title>The "status-changed" gtk.PrintOperation Signal</title>

      <programlisting><methodsynopsis language="python"><methodname>callback</methodname>
            <methodparam><parameter>operation</parameter></methodparam>
            <methodparam><parameter>printoperation</parameter></methodparam>
            <methodparam><parameter>user_param1</parameter></methodparam>
            <methodparam><parameter>...</parameter></methodparam>
          </methodsynopsis></programlisting>

      <variablelist>
        <varlistentry>
          <term><parameter>operation</parameter>&nbsp;:</term>
          <listitem><simpara>the <link linkend="class-gtkprintoperation"><classname>gtk.PrintOperation</classname></link> on which the signal was emitted</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter>printoperation</parameter>&nbsp;:</term>
          <listitem><simpara>the object which received the signal.</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter>user_param1</parameter>&nbsp;:</term>
          <listitem><simpara>the first user parameter (if any) specified
          with the <link
          linkend="method-gobject--connect"><methodname>connect</methodname>()</link>
          method</simpara></listitem>
        </varlistentry>
        <varlistentry>
          <term><parameter>...</parameter>&nbsp;:</term>
          <listitem><simpara>additional user parameters (if any)</simpara></listitem>
        </varlistentry>
      </variablelist>

      <note>
        <para>This signal is available in GTK+ 2.10 and above.</para>
      </note>

      <para>The "status-changed" signal is emitted at between the various
      phases of the print operation.  See the <xref
      linkend="gtk-print-status-constants"
      endterm="gtk-print-status-constants-title"></xref> for the phases that
      are being discriminated.  Use the <link
      linkend="method-gtkprintoperation--get-status"><methodname>gtk.PrintOperation.get_status</methodname>()</link>
      method to find out the current status.</para>

    </refsect2>

</refsect1>

</refentry>
