622
623
// that an error occurred, and in that case it is up to him to handle it.
626
* @par Slot Prototype:
626
627
* <tt>void on_my_%done(PrintOperationResult result)</tt>
629
* Emitted when the print operation run has finished doing
630
* everything required for printing.
632
* @a result gives you information about what happened during the run.
633
* If @a result is Gtk::PRINT_OPERATION_RESULT_ERROR then you can call
634
* Gtk::PrintOperation::get_error() for more information.
636
* If you enabled print status tracking then
637
* Gtk::PrintOperation::is_finished() may still return <tt>false</tt>
638
* after Gtk::PrintOperation::signal_done() was emitted.
641
* @param result The result of the print operation.
629
645
Glib::SignalProxy1< void,PrintOperationResult > signal_done();
649
* @par Slot Prototype:
634
650
* <tt>void on_my_%begin_print(const Glib::RefPtr<PrintContext>& context)</tt>
652
* Emitted after the user has finished changing print settings
653
* in the dialog, before the actual rendering starts.
655
* A typical use for signal_begin_print() is to use the parameters from the
656
* Gtk::PrintContext and paginate the document accordingly, and then
657
* set the number of pages with Gtk::PrintOperation::set_n_pages().
660
* @param context The Gtk::PrintContext for the current operation.
637
664
Glib::SignalProxy1< void,const Glib::RefPtr<PrintContext>& > signal_begin_print();
668
* @par Slot Prototype:
642
669
* <tt>bool on_my_%paginate(const Glib::RefPtr<PrintContext>& context)</tt>
671
* Emitted after the Gtk::PrintOperation::signal_begin_print() signal, but before
672
* the actual rendering starts. It keeps getting emitted until a connected
673
* signal handler returns <tt>true</tt>.
675
* The signal_paginate() signal is intended to be used for paginating a document
676
* in small chunks, to avoid blocking the user interface for a long
677
* time. The signal handler should update the number of pages using
678
* Gtk::PrintOperation::set_n_pages(), and return <tt>true</tt> if the document
679
* has been completely paginated.
681
* If you don't need to do pagination in chunks, you can simply do
682
* it all in the signal_begin_print() handler, and set the number of pages
686
* @param context The Gtk::PrintContext for the current operation.
687
* @return <tt>true</tt> if pagination is complete.
645
691
Glib::SignalProxy1< bool,const Glib::RefPtr<PrintContext>& > signal_paginate();
695
* @par Slot Prototype:
650
696
* <tt>void on_my_%request_page_setup(const Glib::RefPtr<PrintContext>& context, int page_no, const Glib::RefPtr<PageSetup>& setup)</tt>
698
* Emitted once for every page that is printed, to give
699
* the application a chance to modify the page setup. Any changes
700
* done to @a setup will be in force only for printing this page.
703
* @param context The Gtk::PrintContext for the current operation.
704
* @param page_nr The number of the currently printed page (0-based).
705
* @param setup The Gtk::PageSetup.
653
709
Glib::SignalProxy3< void,const Glib::RefPtr<PrintContext>&,int,const Glib::RefPtr<PageSetup>& > signal_request_page_setup();
713
* @par Slot Prototype:
658
714
* <tt>void on_my_%draw_page(const Glib::RefPtr<PrintContext>& context, int page_nr)</tt>
716
* Emitted for every page that is printed. The signal handler
717
* must render the @a page_nr's page onto the cairo context obtained
718
* from @a context using gtk_print_context_get_cairo_context().
720
* [C example ellipted]
722
* Use Gtk::PrintOperation::set_use_full_page() and
723
* Gtk::PrintOperation::set_unit() before starting the print operation
724
* to set up the transformation of the cairo context according to your
728
* @param context The Gtk::PrintContext for the current operation.
729
* @param page_nr The number of the currently printed page (0-based).
661
733
Glib::SignalProxy2< void,const Glib::RefPtr<PrintContext>&,int > signal_draw_page();
737
* @par Slot Prototype:
666
738
* <tt>void on_my_%end_print(const Glib::RefPtr<PrintContext>& context)</tt>
740
* Emitted after all pages have been rendered.
741
* A handler for this signal can clean up any resources that have
742
* been allocated in the Gtk::PrintOperation::signal_begin_print() handler.
745
* @param context The Gtk::PrintContext for the current operation.
669
749
Glib::SignalProxy1< void,const Glib::RefPtr<PrintContext>& > signal_end_print();
753
* @par Slot Prototype:
674
754
* <tt>void on_my_%status_changed()</tt>
756
* Emitted at between the various phases of the print operation.
757
* See Gtk::PrintStatus for the phases that are being discriminated.
758
* Use Gtk::PrintOperation::get_status() to find out the current
677
765
Glib::SignalProxy0< void > signal_status_changed();
769
* @par Slot Prototype:
682
770
* <tt>Widget* on_my_%create_custom_widget()</tt>
772
* Emitted when displaying the print dialog. If you return a
773
* widget in a handler for this signal it will be added to a custom
774
* tab in the print dialog. You typically return a container widget
775
* with multiple widgets in it.
777
* The print dialog owns the returned widget, and its lifetime is not
778
* controlled by the application. However, the widget is guaranteed
779
* to stay around until the Gtk::PrintOperation::signal_custom_widget_apply()
780
* signal is emitted on the operation. Then you can read out any
781
* information you need from the widgets.
784
* @return A custom widget that gets embedded in
785
* the print dialog, or <tt>0</tt>.
685
789
Glib::SignalProxy0< Widget* > signal_create_custom_widget();
793
* @par Slot Prototype:
690
794
* <tt>void on_my_%custom_widget_apply(Widget* widget)</tt>
796
* Emitted right before Gtk::PrintOperation::signal_begin_print() if you added
797
* a custom widget in the Gtk::PrintOperation::signal_create_custom_widget() handler.
798
* When you get this signal you should read the information from the
799
* custom widgets, as the widgets are not guaraneed to be around at a
803
* @param widget The custom widget added in create-custom-widget.
693
807
Glib::SignalProxy1< void,Widget* > signal_custom_widget_apply();
696
810
//TODO: This is causing crashes. Is it still causing crashes? murrayc.
813
* @par Slot Prototype:
700
814
* <tt>bool on_my_%preview(const Glib::RefPtr<PrintOperationPreview>& preview, const Glib::RefPtr<PrintContext>& context, Window* parent)</tt>
816
* Gets emitted when a preview is requested from the native dialog.
818
* The default handler for this signal uses an external viewer
819
* application to preview.
821
* To implement a custom print preview, an application must return
822
* <tt>true</tt> from its handler for this signal. In order to use the
823
* provided @a context for the preview implementation, it must be
824
* given a suitable cairo context with gtk_print_context_set_cairo_context().
826
* The custom preview implementation can use
827
* Gtk::PrintOperationPreview::is_selected() and
828
* Gtk::PrintOperationPreview::render_page() to find pages which
829
* are selected for print and render them. The preview must be
830
* finished by calling Gtk::PrintOperationPreview::end_preview()
831
* (typically in response to the user clicking a close button).
834
* @param preview The Gtk::PrintPreviewOperation for the current operation.
835
* @param context The Gtk::PrintContext that will be used.
836
* @param parent The Gtk::Window to use as window parent, or <tt>0</tt>.
837
* @return <tt>true</tt> if the listener wants to take over control of the preview.
703
841
Glib::SignalProxy3< bool,const Glib::RefPtr<PrintOperationPreview>&,const Glib::RefPtr<PrintContext>&,Window* > signal_preview();
1056
1204
//GTK+ Virtual Functions (override these to change behaviour):
1058
1206
//Default Signal Handlers::
1207
/// This is a default handler for the signal signal_done().
1059
1208
virtual void on_done(PrintOperationResult result);
1209
/// This is a default handler for the signal signal_begin_print().
1060
1210
virtual void on_begin_print(const Glib::RefPtr<PrintContext>& context);
1211
/// This is a default handler for the signal signal_paginate().
1061
1212
virtual bool on_paginate(const Glib::RefPtr<PrintContext>& context);
1213
/// This is a default handler for the signal signal_request_page_setup().
1062
1214
virtual void on_request_page_setup(const Glib::RefPtr<PrintContext>& context, int page_no, const Glib::RefPtr<PageSetup>& setup);
1215
/// This is a default handler for the signal signal_draw_page().
1063
1216
virtual void on_draw_page(const Glib::RefPtr<PrintContext>& context, int page_nr);
1217
/// This is a default handler for the signal signal_end_print().
1064
1218
virtual void on_end_print(const Glib::RefPtr<PrintContext>& context);
1219
/// This is a default handler for the signal signal_status_changed().
1065
1220
virtual void on_status_changed();
1221
/// This is a default handler for the signal signal_create_custom_widget().
1066
1222
virtual Widget* on_create_custom_widget();
1223
/// This is a default handler for the signal signal_custom_widget_apply().
1067
1224
virtual void on_custom_widget_apply(Widget* widget);
1225
/// This is a default handler for the signal signal_preview().
1068
1226
virtual bool on_preview(const Glib::RefPtr<PrintOperationPreview>& preview, const Glib::RefPtr<PrintContext>& context, Window* parent);