Reference Manual
Inti Logo
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

sourceprintjob.h

Go to the documentation of this file.
00001 /*  Inti-SourceView: Integrated Foundation Classes
00002  *  Copyright (C) 2003 The Inti Development Team.
00003  *
00004  *  This program is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; either version 2 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  This program is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU Library General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU Library General Public License
00015  *  along with this program; if not, write to the Free Software
00016  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00017  */
00018 
00023 
00024 #ifndef INTI_GTK_SOURCE_PRINT_JOB_H
00025 #define INTI_GTK_SOURCE_PRINT_JOB_H
00026 
00027 #ifndef INTI_G_OBJECT_H
00028 #include <inti/glib/object.h>
00029 #endif
00030 
00031 #ifndef INTI_GTK_ENUMS_H
00032 #include <inti/gtk/enums.h>
00033 #endif
00034 
00035 #ifndef __GTK_SOURCE_PRINT_JOB_H__
00036 #include <gtksourceview/gtksourceprintjob.h>
00037 #endif
00038 
00039 namespace Inti {
00040 
00041 namespace Gtk {
00042 
00043 class SourceBuffer;
00044 class SourceView;
00045 class TextIter;
00046 
00118 
00119 class SourcePrintJob : public G::Object
00120 {
00121         friend class G::Object;
00122         friend class SourcePrintJobClass;
00123 
00124         SourcePrintJob(const SourcePrintJob&);
00125         SourcePrintJob& operator=(const SourcePrintJob&);
00126 
00127 protected:
00130 
00131         explicit SourcePrintJob(GtkSourcePrintJob *job, bool reference = false);
00138 
00142 
00143         virtual void on_begin_page();
00148 
00149         virtual void on_finished();
00156 //  Properties
00157 
00158         typedef G::Property<GnomePrintConfig*, void*> ConfigPropertyType;
00159         typedef G::PropertyProxy<G::Object, ConfigPropertyType> ConfigPropertyProxy;
00160         static const ConfigPropertyType config_property;
00161 
00162         typedef G::Property<SourceBuffer*, G::Object*> BufferPropertyType;
00163         typedef G::PropertyProxy<G::Object, BufferPropertyType> BufferPropertyProxy;
00164         static const BufferPropertyType buffer_property;
00165 
00166         typedef G::Property<unsigned int> TabsWidthPropertyType;
00167         typedef G::PropertyProxy<G::Object, TabsWidthPropertyType> TabsWidthPropertyProxy;
00168         static const TabsWidthPropertyType tabs_width_property;
00169 
00170         typedef G::Property<WrapMode, int> WrapModePropertyType;
00171         typedef G::PropertyProxy<G::Object, WrapModePropertyType> WrapModePropertyProxy;
00172         static const WrapModePropertyType wrap_mode_property;
00173 
00174         typedef G::Property<bool> HighlightPropertyType;
00175         typedef G::PropertyProxy<G::Object, HighlightPropertyType> HighlightPropertyProxy;
00176         static const HighlightPropertyType highlight_property;
00177 
00178         typedef G::Property<String> FontPropertyType;
00179         typedef G::PropertyProxy<G::Object, FontPropertyType> FontPropertyProxy;
00180         static const FontPropertyType font_property;
00181 
00182         typedef G::Property<String> NumbersFontPropertyType;
00183         typedef G::PropertyProxy<G::Object, NumbersFontPropertyType> NumbersFontPropertyProxy;
00184         static const NumbersFontPropertyType numbers_font_property;
00185 
00186         typedef G::Property<unsigned int> PrintNumbersPropertyType;
00187         typedef G::PropertyProxy<G::Object, PrintNumbersPropertyType> PrintNumbersPropertyProxy;
00188         static const PrintNumbersPropertyType print_numbers_property;
00189 
00190         typedef G::Property<bool> PrintHeaderPropertyType;
00191         typedef G::PropertyProxy<G::Object, PrintHeaderPropertyType> PrintHeaderPropertyProxy;
00192         static const PrintHeaderPropertyType print_header_property;
00193 
00194         typedef G::Property<bool> PrintFooterPropertyType;
00195         typedef G::PropertyProxy<G::Object, PrintFooterPropertyType> PrintFooterPropertyProxy;
00196         static const PrintFooterPropertyType print_footer_property;
00197 
00198         typedef G::Property<String> HeaderFooterFontPropertyType;
00199         typedef G::PropertyProxy<G::Object, HeaderFooterFontPropertyType> HeaderFooterFontPropertyProxy;
00200         static const HeaderFooterFontPropertyType header_footer_font_property;
00201 
00202 //  Signals
00203 
00204         typedef G::Signal0<void> BeginPageSignalType;
00205         typedef G::SignalProxy<TypeInstance, BeginPageSignalType> BeginPageSignalProxy;
00206         static const BeginPageSignalType begin_page_signal;
00207 
00208         typedef G::Signal0<void> FinishedSignalType;
00209         typedef G::SignalProxy<TypeInstance, FinishedSignalType> FinishedSignalProxy;
00210         static const FinishedSignalType finished_signal;
00211 
00212 public:
00215 
00216         explicit SourcePrintJob(SourceBuffer *buffer = 0);
00222 
00223         explicit SourcePrintJob(GnomePrintConfig& config, SourceBuffer *buffer = 0);
00227 
00228         explicit SourcePrintJob(SourceView& view);
00236 
00237         virtual ~SourcePrintJob();
00239 
00243 
00244         GtkSourcePrintJob* gtk_source_print_job() const { return (GtkSourcePrintJob*)instance; }
00246 
00247         GtkSourcePrintJobClass* gtk_source_print_job_class() const;
00249 
00250         operator GtkSourcePrintJob* () const;
00252 
00253         bool is_gtk_source_print_job() const;
00255 
00256         GnomePrintConfig* get_config() const;
00261 
00262         SourceBuffer* get_buffer() const;
00265 
00266         unsigned int get_tabs_width() const;
00269 
00270         WrapMode get_wrap_mode() const;
00275 
00276         bool get_highlight() const;
00282 
00283         String get_font() const;
00289 
00290         String get_numbers_font() const;
00297 
00298         unsigned int get_print_numbers() const;
00304 
00305         void get_text_margins(double *top, double *bottom, double *left, double *right) const;
00315 
00316         GnomePrintJob* get_print_job() const;
00325 
00326         unsigned int get_page() const;
00331 
00332         unsigned int get_page_count() const;
00339 
00340         GnomePrintContext* get_print_context() const;
00347 
00348         bool get_print_header() const;
00354 
00355         bool get_print_footer() const;
00361 
00362         String get_header_footer_font() const;
00369 
00373 
00374         void set_config(GnomePrintConfig& config);
00380 
00381         void set_buffer(SourceBuffer& buffer);
00387 
00388         void set_tabs_width(unsigned int tabs_width);
00395 
00396         void set_wrap_mode(WrapMode wrap);
00399 
00400         void set_highlight(bool highlight);
00405 
00406         void set_font(const String& font_name);
00412 
00413         void set_numbers_font(const String& font_name);
00419 
00420         void set_print_numbers(unsigned int interval);
00428 
00429         void set_text_margins(double top, double bottom, double left, double right);
00444 
00445         GnomePrintJob* print();
00454 
00455         GnomePrintJob* print(const TextIter& start, const TextIter& end);
00464 
00465         bool print_async(const TextIter& start, const TextIter& end);
00479 
00480         void cancel();
00489 
00490         void set_print_header(bool setting);
00498 
00499         void set_print_footer(bool setting);
00507 
00508         void set_header_footer_font(const String& font_name);
00515 
00516         void set_header_format(const char *left, const char *center, const char *right, bool separator);
00517         void set_header_format(const String& left, const String& center, const String& right, bool separator);
00534 
00535         void set_footer_format(const char *left, const char *center, const char *right, bool separator);
00536         void set_footer_format(const String& left, const String& center, const String& right, bool separator);
00543 
00547 
00548         const ConfigPropertyProxy prop_config()
00549         {
00550                 return ConfigPropertyProxy(this, &config_property);
00551         }
00553 
00554         const BufferPropertyProxy prop_buffer()
00555         {
00556                 return BufferPropertyProxy(this, &buffer_property);
00557         }
00559 
00560         const TabsWidthPropertyProxy prop_tabs_width()
00561         {
00562                 return TabsWidthPropertyProxy(this, &tabs_width_property);
00563         }
00565 
00566         const WrapModePropertyProxy prop_wrap_mode()
00567         {
00568                 return WrapModePropertyProxy(this, &wrap_mode_property);
00569         }
00571 
00572         const HighlightPropertyProxy prop_highlight()
00573         {
00574                 return HighlightPropertyProxy(this, &highlight_property);
00575         }
00577 
00578         const FontPropertyProxy prop_font()
00579         {
00580                 return FontPropertyProxy(this, &font_property);
00581         }
00583 
00584         const NumbersFontPropertyProxy prop_numbers_font()
00585         {
00586                 return NumbersFontPropertyProxy(this, &numbers_font_property);
00587         }
00589 
00590         const PrintNumbersPropertyProxy prop_print_numbers()
00591         {
00592                 return PrintNumbersPropertyProxy(this, &print_numbers_property);
00593         }
00595 
00596         const PrintHeaderPropertyProxy prop_print_header()
00597         {
00598                 return PrintHeaderPropertyProxy(this, &print_header_property);
00599         }
00601 
00602         const PrintFooterPropertyProxy prop_print_footer()
00603         {
00604                 return PrintFooterPropertyProxy(this, &print_footer_property);
00605         }
00607 
00608         const HeaderFooterFontPropertyProxy prop_header_footer_font()
00609         {
00610                 return HeaderFooterFontPropertyProxy(this, &header_footer_font_property);
00611         }
00613 
00617 
00618         const BeginPageSignalProxy sig_begin_page()
00619         {
00620                 return BeginPageSignalProxy(this, &begin_page_signal);
00621         }
00623 
00624         const FinishedSignalProxy sig_finished()
00625         {
00626                 return FinishedSignalProxy(this, &finished_signal);
00627         }
00629 
00631 };
00632 
00633 } // namespace Gtk
00634 
00635 } // namespace Inti
00636 
00637 #endif // INTI_GTK_SOURCE_PRINT_JOB_H
00638 
00639 
Main Page - Footer


Generated on Wed Aug 27 21:17:27 2003 for Inti-SourceView by doxygen 1.3.2 written by Dimitri van Heesch, © 1997-2002