Index

Package: Print_Settings

Description

package Gtk.Print_Settings is

A Gtk_Print_Settings object represents the settings of a print dialog in a system-independent way. The main use for this object is that once you've printed you can get a settings object that represents the settings the user chose, and the next time you print you can pass that object in so that the user doesn't have to re-set all his settings.

It's also possible to enumerate the settings so that you can easily save the settings for the next time your app runs, or even store them in a document. The predefined keys try to use shared values as much as possible so that moving such a document between systems still works.

Binding from C File version 2.16.6

Classes

Gtk_Print_Settings_Record

type Gtk_Print_Settings_Record is
      new Glib.Object.GObject_Record with private;

Ancestors:

Primitive operations:

Get_Default_Source
Get_Finishings
Get_Media_Type
Get_N_Copies
Get_Number_Up
Get_Number_Up_Layout
Get_Orientation
Get_Output_Bin
Get_Page_Ranges
Get_Page_Set
Get_Paper_Height
Get_Paper_Size
Get_Paper_Width
Get_Print_Pages
Get_Printer_Lpi
Get_Resolution
Get_Resolution_X
Get_Resolution_Y
Get_Use_Color
Glib.Object.Deallocate (Inherited)
Glib.Object.Get_Type (Inherited)
Glib.Object.Notify (Inherited)
Glib.Object.Ref (Inherited)
Glib.Object.Ref_Sink (Inherited)
Glib.Object.Unref (Inherited)
Load_Key_File
Set_Default_Source
Set_Finishings
Set_Media_Type
Set_N_Copies
Set_Number_Up
Set_Number_Up_Layout
Set_Orientation
Set_Output_Bin
Set_Page_Ranges
Set_Page_Set
Set_Paper_Height
Set_Paper_Size
Set_Paper_Width
Set_Print_Pages
Set_Printer_Lpi
Set_Resolution
Set_Resolution_XY
Set_Use_Color

Types

Gtk_Print_Settings

type Gtk_Print_Settings is access all Gtk_Print_Settings_Record'Class;

Gtk_Page_Range_Record

type Gtk_Page_Range_Record is record
      Range_Start : Gint;
      Range_End   : Gint;
   end record;

Gtk_Page_Range_Array

type Gtk_Page_Range_Array is
     array (Integer range <>) of Gtk_Page_Range_Record;

Subprograms & Entries

Get_Type

function Get_Type return GType;

Gtk_New

procedure Gtk_New 
(Widget: out Gtk_Print_Settings);

Initialize

procedure Initialize 
(Widget: access Gtk_Print_Settings_Record'Class);
Creates a new Gtk_Print_Settings object.

Gtk_New_From_File

procedure Gtk_New_From_File 
(Widget: out Gtk_Print_Settings;
File_Name: String;
Error: Glib.Error.GError := null);

Initialize_From_File

procedure Initialize_From_File 
(Widget: access Gtk_Print_Settings_Record'Class;
File_Name: String;
Error: Glib.Error.GError := null);
Reads the print settings from File_Name. Returns a new Gtk_Print_Settings object with the restored settings, or null if an error occurred. See To_File.

Gtk_New_From_Key_File

procedure Gtk_New_From_Key_File 
(Widget: out Gtk_Print_Settings;
Key_File: Glib.Key_File.G_Key_File;
Group_Name: String := "";
Error: Glib.Error.GError := null);

Initialize_From_Key_File

procedure Initialize_From_Key_File 
(Widget: access Gtk_Print_Settings_Record'Class;
Key_File: Glib.Key_File.G_Key_File;
Group_Name: String := "";
Error: Glib.Error.GError := null);
Reads the print settings from the group Group_Name in Key_File. Returns a new Gtk_Print_Settings object with the restored settings, or null if an error occurred.

Copy

function Copy 
(Other: access Gtk_Print_Settings_Record) return Gtk_Print_Settings;
Copies a Gtk_Print_Settings object.

Has_Key

function Has_Key 
(Settings: access Gtk_Print_Settings_Record;
Key: String) return Boolean;
Returns True, if a value is associated with Key.

Get

function Get 
(Settings: access Gtk_Print_Settings_Record;
Key: String) return String;

Set

procedure Set 
(Settings: access Gtk_Print_Settings_Record;
Key: String;
Value: String := "");
Manipulate string value associated with Key.

Unset

procedure Unset 
(Settings: access Gtk_Print_Settings_Record;
Key: String);
Removes any value associated with Key. This has the same effect as setting the value to null.

Get_Bool

function Get_Bool 
(Settings: access Gtk_Print_Settings_Record;
Key: String) return Boolean;

Set_Bool

procedure Set_Bool 
(Settings: access Gtk_Print_Settings_Record;
Key: String;
Value: Boolean);
Gets/Sets the boolean represented by the value that is associated with Key.

Get_Double

function Get_Double 
(Settings: access Gtk_Print_Settings_Record;
Key: String;
Def: Gdouble := 0.0) return Gdouble;

Set_Double

procedure Set_Double 
(Settings: access Gtk_Print_Settings_Record;
Key: String;
Value: Gdouble);
Gets/Sets the floating point number represented by the value that is associated with Key, or Def if the value does not represent a floating point number. Floating point numbers are parsed with g_ascii_strtod().

Get_Int

function Get_Int 
(Settings: access Gtk_Print_Settings_Record;
Key: String;
Def: Gint := 0) return Gint;

Set_Int

procedure Set_Int 
(Settings: access Gtk_Print_Settings_Record;
Key: String;
Value: Gint);
Gets/Sets the value of Key. Get_Int interprets the value as an integer, or else returns the default value.

Get_Length

function Get_Length 
(Settings: access Gtk_Print_Settings_Record;
Key: String;
Unit: Gtk.Enums.Gtk_Unit) return Gdouble;

Set_Length

procedure Set_Length 
(Settings: access Gtk_Print_Settings_Record;
Key: String;
Value: Gdouble;
Unit: Gtk.Enums.Gtk_Unit);
Gets/Sets the value associated with Key, interpreted as a length. The returned value is converted to Units.

Get_Collate

function Get_Collate 
(Settings: access Gtk_Print_Settings_Record) return Boolean;

Set_Collate

procedure Set_Collate 
(Settings: access Gtk_Print_Settings_Record;
Collate: Boolean);
Whether to collate the printed pages

Get_Default_Source

function Get_Default_Source 
(Settings: access Gtk_Print_Settings_Record) return String;

Set_Default_Source

procedure Set_Default_Source 
(Settings: access Gtk_Print_Settings_Record;
Default_Source: String);
The default source

Get_Dither

function Get_Dither 
(Settings: access Gtk_Print_Settings_Record) return String;

Set_Dither

procedure Set_Dither 
(Settings: access Gtk_Print_Settings_Record;
Dither: String);
Gets/Sets the dithering that is used

Get_Duplex

function Get_Duplex 
(Settings: access Gtk_Print_Settings_Record) return Gtk.Enums.Gtk_Print_Duplex;

Set_Duplex

procedure Set_Duplex 
(Settings: access Gtk_Print_Settings_Record;
Duplex: Gtk.Enums.Gtk_Print_Duplex);
Whether to print the output in duplex.

Get_Finishings

function Get_Finishings 
(Settings: access Gtk_Print_Settings_Record) return String;

Set_Finishings

procedure Set_Finishings 
(Settings: access Gtk_Print_Settings_Record;
Finishings: String);
The finishings

Get_Media_Type

function Get_Media_Type 
(Settings: access Gtk_Print_Settings_Record) return String;

Set_Media_Type

procedure Set_Media_Type 
(Settings: access Gtk_Print_Settings_Record;
Media_Type: String);
Gets/Sets the media type. The set of media types is defined in PWG 5101.1-2002 PWG.

Get_N_Copies

function Get_N_Copies 
(Settings: access Gtk_Print_Settings_Record) return Gint;

Set_N_Copies

procedure Set_N_Copies 
(Settings: access Gtk_Print_Settings_Record;
Num_Copies: Gint);
Gets/Sets the number of copies to print

Get_Number_Up

function Get_Number_Up 
(Settings: access Gtk_Print_Settings_Record) return Gint;

Set_Number_Up

procedure Set_Number_Up 
(Settings: access Gtk_Print_Settings_Record;
Number_Up: Gint);
Gets/Sets the number of pages per sheet

Get_Number_Up_Layout

function Get_Number_Up_Layout 
(Settings: access Gtk_Print_Settings_Record) return Gtk.Enums.Gtk_Number_Up_Layout;

Set_Number_Up_Layout

procedure Set_Number_Up_Layout 
(Settings: access Gtk_Print_Settings_Record;
Number_Up_Layout: Gtk.Enums.Gtk_Number_Up_Layout);
Gets/Sets layout of page in number-up mode

Get_Orientation

function Get_Orientation 
(Settings: access Gtk_Print_Settings_Record) return Gtk.Enums.Gtk_Page_Orientation;

Set_Orientation

procedure Set_Orientation 
(Settings: access Gtk_Print_Settings_Record;
Orientation: Gtk.Enums.Gtk_Page_Orientation);
Get the orientation.

Get_Output_Bin

function Get_Output_Bin 
(Settings: access Gtk_Print_Settings_Record) return String;

Set_Output_Bin

procedure Set_Output_Bin 
(Settings: access Gtk_Print_Settings_Record;
Output_Bin: String);
Gets/Sets the output bin.

Get_Page_Ranges

function Get_Page_Ranges 
(Settings: access Gtk_Print_Settings_Record) return Gtk_Page_Range_Array;

Set_Page_Ranges

procedure Set_Page_Ranges 
(Settings: access Gtk_Print_Settings_Record;
Page_Ranges: access Gtk_Page_Range_Array);
Gets/Sets an array of Gtk_Page_Range_Records.

Get_Page_Set

function Get_Page_Set 
(Settings: access Gtk_Print_Settings_Record) return Gtk.Enums.Gtk_Page_Set;

Set_Page_Set

procedure Set_Page_Set 
(Settings: access Gtk_Print_Settings_Record;
Page_Set: Gtk.Enums.Gtk_Page_Set);
Gets/Sets the set of pages to print

Get_Paper_Height

function Get_Paper_Height 
(Settings: access Gtk_Print_Settings_Record;
Unit: Gtk.Enums.Gtk_Unit) return Gdouble;

Get_Paper_Width

function Get_Paper_Width 
(Settings: access Gtk_Print_Settings_Record;
Unit: Gtk.Enums.Gtk_Unit) return Gdouble;

Set_Paper_Height

procedure Set_Paper_Height 
(Settings: access Gtk_Print_Settings_Record;
Height: Gdouble;
Unit: Gtk.Enums.Gtk_Unit);

Set_Paper_Width

procedure Set_Paper_Width 
(Settings: access Gtk_Print_Settings_Record;
Width: Gdouble;
Unit: Gtk.Enums.Gtk_Unit);
Get/Set the paper height/width, in units of Unit

Get_Paper_Size

function Get_Paper_Size 
(Settings: access Gtk_Print_Settings_Record) return Gtk.Paper_Size.Gtk_Paper_Size;

Set_Paper_Size

procedure Set_Paper_Size 
(Settings: access Gtk_Print_Settings_Record;
Paper_Size: Gtk.Paper_Size.Gtk_Paper_Size);
Sets/Gets the paper size.

Get_Print_Pages

function Get_Print_Pages 
(Settings: access Gtk_Print_Settings_Record) return Gtk.Enums.Gtk_Print_Pages;

Set_Print_Pages

procedure Set_Print_Pages 
(Settings: access Gtk_Print_Settings_Record;
Pages: Gtk.Enums.Gtk_Print_Pages);
Gets/Sets which pages to print

Get_Printer

function Get_Printer 
(Settings: access Gtk_Print_Settings_Record) return String;

Set_Printer

procedure Set_Printer 
(Settings: access Gtk_Print_Settings_Record;
Printer: String);
Gets/Sets the printer name

Get_Printer_Lpi

function Get_Printer_Lpi 
(Settings: access Gtk_Print_Settings_Record) return Gdouble;

Set_Printer_Lpi

procedure Set_Printer_Lpi 
(Settings: access Gtk_Print_Settings_Record;
Lpi: Gdouble);
Gets/Sets the resolution in lpi (lines per inch)

Get_Quality

function Get_Quality 
(Settings: access Gtk_Print_Settings_Record) return Gtk.Enums.Gtk_Print_Quality;

Set_Quality

procedure Set_Quality 
(Settings: access Gtk_Print_Settings_Record;
Quality: Gtk.Enums.Gtk_Print_Quality);
Gets/Sets the print quality

Get_Resolution

function Get_Resolution 
(Settings: access Gtk_Print_Settings_Record) return Gint;

Set_Resolution

procedure Set_Resolution 
(Settings: access Gtk_Print_Settings_Record;
Resolution: Gint);
Gets/Sets the resolution in dpi.

Get_Resolution_X

function Get_Resolution_X 
(Settings: access Gtk_Print_Settings_Record) return Gint;

Get_Resolution_Y

function Get_Resolution_Y 
(Settings: access Gtk_Print_Settings_Record) return Gint;

Set_Resolution_XY

procedure Set_Resolution_XY 
(Settings: access Gtk_Print_Settings_Record;
Resolution_X: Gint;
Resolution_Y: Gint);
Gets/Sets the horizontal/vertical resolution, in dpi.

Get_Reverse

function Get_Reverse 
(Settings: access Gtk_Print_Settings_Record) return Boolean;

Set_Reverse

procedure Set_Reverse 
(Settings: access Gtk_Print_Settings_Record;
Rev: Boolean);
Returns whether to reverse the order of the printed pages

Get_Scale

function Get_Scale 
(Settings: access Gtk_Print_Settings_Record) return Gdouble;

Set_Scale

procedure Set_Scale 
(Settings: access Gtk_Print_Settings_Record;
Scale: Gdouble);
Returns the scale in percent

Get_Use_Color

function Get_Use_Color 
(Settings: access Gtk_Print_Settings_Record) return Boolean;

Set_Use_Color

procedure Set_Use_Color 
(Settings: access Gtk_Print_Settings_Record;
Use_Color: Boolean);
Returns whether to use color

Load_File

function Load_File 
(Settings: access Gtk_Print_Settings_Record;
File_Name: String;
Error: Glib.Error.GError := null) return Boolean;
Reads the print settings from File_Name. See To_File. Returns True on success.

Load_Key_File

function Load_Key_File 
(Settings: access Gtk_Print_Settings_Record;
Key_File: Glib.Key_File.G_Key_File;
Group_Name: String := "";
Error: Glib.Error.GError := null) return Boolean;
Reads the print settings from the group Group_Name ("Print Settings" by default) in Key_File. Returns True on success

To_File

function To_File 
(Settings: access Gtk_Print_Settings_Record;
File_Name: String;
Error: Glib.Error.GError := null) return Boolean;
This function saves the print settings from Settings to File_Name. Returns True on success

To_Key_File

procedure To_Key_File 
(Settings: access Gtk_Print_Settings_Record;
Key_File: Glib.Key_File.G_Key_File;
Group_Name: String := "");
This function adds the print settings from Settings to Key_File. if Group_Name is not specified, it defaults to "Print Settings".