gtk-0.12.0: Binding to the Gtk+ graphical user interface library.

Portability | portable (depends on GHC)
Stability | provisional
Maintainer | gtk2hs-users@lists.sourceforge.net

Graphics.UI.Gtk.Printing.PrintSettings

Contents

- Detail
- Class Hierarchy
- Types
- Enums
- Constructors
- Methods
- Attributes

Description

Stores print settings

- Module available since Gtk+ version 2.10

Synopsis

- data PrintSettings
- class GObjectClass o => PrintSettingsClass o
- castToPrintSettings :: GObjectClass obj => obj -> PrintSettings
- toPrintSettings :: PrintSettingsClass o => o -> PrintSettings
- data PageOrientation
  - = PageOrientationPortrait
  - | PageOrientationLandscape
  - | PageOrientationReversePortrait
  - | PageOrientationReverseLandscape
- data NumberUpLayout
  - = NumberUpLayoutLeftToRightTopToBottom
  - | NumberUpLayoutLeftToRightBottomToTop
  - | NumberUpLayoutRightToLeftTopToBottom
  - | NumberUpLayoutRightToLeftBottomToTop
  - | NumberUpLayoutTopToBottomLeftToRight
  - | NumberUpLayoutTopToBottomRightToLeft
  - | NumberUpLayoutBottomToTopLeftToRight
  - | NumberUpLayoutBottomToTopRightToLeft
- data PrintQuality
  - = PrintQualityLow
  - | PrintQualityNormal
  - | PrintQualityHigh
  - | PrintQualityDraft
- data PrintDuplex
  - = PrintDuplexSimplex
  - | PrintDuplexHorizontal
  - | PrintDuplexVertical
- data PrintPages
  - = PrintPagesAll
  - | PrintPagesCurrent
  - | PrintPagesRanges
  - | PrintPagesSelection
- data PageSet
  - = PageSetAll
  - | PageSetEven
  - | PageSetOdd
- printSettingsNew :: IO PrintSettings
- printSettingsNewFromFile :: String -> IO PrintSettings
- printSettingsCopy :: PrintSettingsClass self => self -> IO PrintSettings
- printSettingsHasKey :: PrintSettingsClass self => self -> String -> IO Bool
- printSettingsGet :: PrintSettingsClass self => self -> String -> IO String
- printSettingsSet :: PrintSettingsClass self => self -> String -> String -> IO ()
- printSettingsUnset :: PrintSettingsClass self => self -> String -> IO ()
- printSettingsForeach :: PrintSettingsClass self => self -> (String -> IO ()) -> IO ()
- printSettingsGetBool :: PrintSettingsClass self => self -> String -> IO Bool
- printSettingsSetBool :: PrintSettingsClass self => self -> String -> Bool -> IO ()
- printSettingsGetDouble :: PrintSettingsClass self => self -> String -> IO Double
- printSettingsGetDoubleWithDefault :: PrintSettingsClass self => self -> String -> Double -> IO Double
- printSettingsSetDouble :: PrintSettingsClass self => self -> String -> Double -> IO ()
- printSettingsGetLength :: PrintSettingsClass self => self -> String -> Unit -> IO Double
- printSettingsSetLength :: PrintSettingsClass self => self -> String -> Double -> Unit -> IO ()
- printSettingsGetInt :: PrintSettingsClass self => self -> String -> IO Int
- printSettingsGetIntWithDefault :: PrintSettingsClass self => self -> String -> Int -> IO Int
- printSettingsSetInt :: PrintSettingsClass self => self -> String -> Int -> IO ()
- printSettingsGetPaperWidth :: PrintSettingsClass self => self -> Unit -> IO Double
- printSettingsSetPaperWidth :: PrintSettingsClass self => self -> Double -> Unit -> IO ()
- printSettingsGetPaperHeight :: PrintSettingsClass self => self -> Unit -> IO Double
- printSettingsSetPaperHeight :: PrintSettingsClass self => self -> Double -> Unit -> IO ()
- printSettingsSetResolutionXy :: PrintSettingsClass self => self -> Int -> Int -> IO ()
- printSettingsGetResolutionX :: PrintSettingsClass self => self -> IO Int
- printSettingsGetResolutionY :: PrintSettingsClass self => self -> IO Int
- printSettingsLoadFile :: PrintSettingsClass self => self -> String -> IO Bool
- printSettingsToFile :: PrintSettingsClass self => self -> String -> IO Bool
- printSettingsPrinter :: PrintSettingsClass self => Attr self String
- printSettingsOrientation :: PrintSettingsClass self => Attr self PageOrientation
- printSettingsPaperSize :: PrintSettingsClass self => Attr self PaperSize
- printSettingsUseColor :: PrintSettingsClass self => Attr self Bool
- printSettingsCollate :: PrintSettingsClass self => Attr self Bool
- printSettingsReverse :: PrintSettingsClass self => Attr self Bool
- printSettingsDuplex :: PrintSettingsClass self => Attr self PrintDuplex
- printSettingsQuality :: PrintSettingsClass self => Attr self PrintQuality
- printSettingsNCopies :: PrintSettingsClass self => Attr self Int
- printSettingsNumberUp :: PrintSettingsClass self => Attr self Int
- printSettingsResolution :: PrintSettingsClass self => Attr self Int
- printSettingsScale :: PrintSettingsClass self => Attr self Double
- printSettingsPrintPages :: PrintSettingsClass self => Attr self PrintPages
- printSettingsPageSet :: PrintSettingsClass self => Attr self PageSet
- printSettingsDefaultSource :: PrintSettingsClass self => Attr self String
- printSettingsMediaType :: PrintSettingsClass self => Attr self String
- printSettingsDither :: PrintSettingsClass self => Attr self String
- printSettingsFinishings :: PrintSettingsClass self => Attr self String
- printSettingsOutputBin :: PrintSettingsClass self => Attr self String
- printSettingsNumberUpLayout :: PrintSettingsClass self => Attr self NumberUpLayout
- printSettingsPrinterLpi :: PrintSettingsClass self => Attr self Double

# Detail

A `PrintSettings` 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.

Its 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.

Printing support was added in Gtk+ 2.10.

# Class Hierarchy

     | GObject
     | +----PrintSettings

# Types

data PrintSettings

Instances

Eq PrintSettings |
Ord PrintSettings |
GObjectClass PrintSettings |
PrintSettingsClass PrintSettings |

class GObjectClass o => PrintSettingsClass o

Instances

PrintSettingsClass PrintSettings |

castToPrintSettings :: GObjectClass obj => obj -> PrintSettings

toPrintSettings :: PrintSettingsClass o => o -> PrintSettings

# Enums

data PageOrientation

Constructors

PageOrientationPortrait |
PageOrientationLandscape |
PageOrientationReversePortrait |
PageOrientationReverseLandscape |

Instances

Bounded PageOrientation |
Enum PageOrientation |
Eq PageOrientation |
Show PageOrientation |

data NumberUpLayout

Used to determine the layout of pages on a sheet when printing multiple pages per sheet.

Constructors

NumberUpLayoutLeftToRightTopToBottom |
NumberUpLayoutLeftToRightBottomToTop |
NumberUpLayoutRightToLeftTopToBottom |
NumberUpLayoutRightToLeftBottomToTop |
NumberUpLayoutTopToBottomLeftToRight |
NumberUpLayoutTopToBottomRightToLeft |
NumberUpLayoutBottomToTopLeftToRight |
NumberUpLayoutBottomToTopRightToLeft |

Instances

Bounded NumberUpLayout |
Enum NumberUpLayout |
Eq NumberUpLayout |
Show NumberUpLayout |

data PrintQuality

Constructors

PrintQualityLow |
PrintQualityNormal |
PrintQualityHigh |
PrintQualityDraft |

Instances

Bounded PrintQuality |
Enum PrintQuality |
Eq PrintQuality |
Show PrintQuality |

data PrintDuplex

Constructors

PrintDuplexSimplex |
PrintDuplexHorizontal |
PrintDuplexVertical |

Instances

Bounded PrintDuplex |
Enum PrintDuplex |
Eq PrintDuplex |
Show PrintDuplex |

data PrintPages

Constructors

PrintPagesAll |
PrintPagesCurrent |
PrintPagesRanges |
PrintPagesSelection |

Instances

Bounded PrintPages |
Enum PrintPages |
Eq PrintPages |
Show PrintPages |

data PageSet

Constructors

PageSetAll |
PageSetEven |
PageSetOdd |

Instances

Bounded PageSet |
Enum PageSet |
Eq PageSet |
Show PageSet |

# Constructors

printSettingsNew :: IO PrintSettings

Creates a new `PrintSettings` object.

printSettingsNewFromFile

Arguments

:: String | `fileName` - the filename to read the settings from
-> IO PrintSettings |

Reads the print settings from `fileName`. Returns a new `PrintSettings` object with the restored settings.

- Available since Gtk+ version 2.12

# Methods

printSettingsCopy

Arguments

:: PrintSettingsClass self |
=> self |
-> IO PrintSettings | returns a newly allocated copy of `other`

Copies a `PrintSettings` object.

printSettingsHasKey

Arguments

:: PrintSettingsClass self |
=> self |
-> String | `key` - a key
-> IO Bool | returns `True`, if `key` has a value

Returns `True`, if a value is associated with `key`.

printSettingsGet

Arguments

:: PrintSettingsClass self |
=> self |
-> String | `key` - a key
-> IO String | returns the string value for `key`

Looks up the string value associated with `key`.

printSettingsSet

Arguments

:: PrintSettingsClass self |
=> self |
-> String | `key` - a key
-> String | `value` - a string value
-> IO () |

Associates `value` with `key`.

printSettingsUnset

Arguments

:: PrintSettingsClass self |
=> self |
-> String | `key` - a key
-> IO () |

Removes any value associated with `key`

printSettingsForeach

Arguments

:: PrintSettingsClass self |
=> self |
-> (String -> IO ()) | `func` - the function to call
-> IO () |

Calls `func` for each key-value pair of `settings`.

printSettingsGetBool

Arguments

:: PrintSettingsClass self |
=> self |
-> String | `key` - a key
-> IO Bool | returns `True`, if `key` maps to a true value.

Returns the boolean represented by the value that is associated with `key`.

The string "true" represents `True`, any other string `False`.

printSettingsSetBool

Arguments

:: PrintSettingsClass self |
=> self |
-> String | `key` - a key
-> Bool | `value` - a boolean
-> IO () |

Sets `key` to a boolean value.

printSettingsGetDouble

Arguments

:: PrintSettingsClass self |
=> self |
-> String | `key` - a key
-> IO Double | returns the double value of `key`

Returns the double value associated with `key`, or 0.

printSettingsGetDoubleWithDefault

Arguments

:: PrintSettingsClass self |
=> self |
-> String | `key` - a key
-> Double | `def` - the default value
-> IO Double | returns the floating point number associated with `key`

Returns the floating point number represented by the value that is associated with `key`, or `defaultVal` if the value does not represent a floating point number.

Floating point numbers are parsed with `gAsciiStrtod`.

printSettingsSetDouble

Arguments

:: PrintSettingsClass self |
=> self |
-> String | `key` - a key
-> Double | `value` - a double value
-> IO () |

Sets `key` to a double value.

printSettingsGetLength

Arguments

:: PrintSettingsClass self |
=> self |
-> String | `key` - a key
-> Unit | `unit` - the unit of the return value
-> IO Double | returns the length value of `key`, converted to `unit`

Returns the value associated with `key`, interpreted as a length. The returned value is converted to `units`.

printSettingsSetLength

Arguments

:: PrintSettingsClass self |
=> self |
-> String | `key` - a key
-> Double | `value` - a length
-> Unit | `unit` - the unit of `length`
-> IO () |

Associates a length in units of `unit` with `key`.

printSettingsGetInt

Arguments

:: PrintSettingsClass self |
=> self |
-> String | `key` - a key
-> IO Int | returns the integer value of `key`

Returns the integer value of `key`, or 0.

printSettingsGetIntWithDefault

Arguments

:: PrintSettingsClass self |
=> self |
-> String | `key` - a key
-> Int | `def` - the default value
-> IO Int | returns the integer value of `key`

Returns the value of `key`, interpreted as an integer, or the default value.

printSettingsSetInt

Arguments

:: PrintSettingsClass self |
=> self |
-> String | `key` - a key
-> Int | `value` - an integer
-> IO () |

Sets `key` to an integer value.

printSettingsGetPaperWidth

Arguments

:: PrintSettingsClass self |
=> self |
-> Unit | `unit` - the unit for the return value
-> IO Double | returns the paper width, in units of `unit`

Gets the value of `PrintSettingsPaperWidth`, converted to unit.

printSettingsSetPaperWidth

Arguments

:: PrintSettingsClass self |
=> self |
-> Double | `width` - the paper width
-> Unit | `unit` - the units of `width`
-> IO () |

Sets the value of `PrintSettingsPaperWidth`.

printSettingsGetPaperHeight

Arguments

:: PrintSettingsClass self |
=> self |
-> Unit | `unit` - the unit for the return value
-> IO Double | returns the paper height, in units of `unit`

Gets the value of `PrintSettingsPaperHeight`, converted to unit.

printSettingsSetPaperHeight

Arguments

:: PrintSettingsClass self |
=> self |
-> Double | `height` - the paper height
-> Unit | `unit` - the units of `height`
-> IO () |

Sets the value of `PrintSettingsPaperHeight`.

printSettingsSetResolutionXy

Arguments

:: PrintSettingsClass self |
=> self |
-> Int | `resolutionX` - the horizontal resolution in dpi
-> Int | `resolutionY` - the vertical resolution in dpi
-> IO () |

Sets the values of `PrintSettingsResolution`, `PrintSettingsResolutionX` and `PrintSettingsResolutionY`.

- Available since Gtk+ version 2.16

printSettingsGetResolutionX

Arguments

:: PrintSettingsClass self |
=> self |
-> IO Int | returns the horizontal resolution in dpi

Gets the value of `resolution-x`.

- Available since Gtk+ version 2.16

printSettingsGetResolutionY

Arguments

:: PrintSettingsClass self |
=> self |
-> IO Int | returns the vertical resolution in dpi

Gets the value of `resolution-y`.

- Available since Gtk+ version 2.16

printSettingsLoadFile

Arguments

:: PrintSettingsClass self |
=> self |
-> String | `fileName` - the filename to read the settings from
-> IO Bool | returns `True` on success

Reads the print settings from `fileName`. See `printSettingsToFile`.

- Available since Gtk+ version 2.14

printSettingsToFile

Arguments

:: PrintSettingsClass self |
=> self |
-> String | `fileName` - the file to save to
-> IO Bool | returns `True` on success

This function saves the print settings from `settings` to `fileName`.

- Available since Gtk+ version 2.12

# Attributes

printSettingsPrinter :: PrintSettingsClass self => Attr self String

Obtain the value of `PrintSettingsPrinter`.

printSettingsOrientation :: PrintSettingsClass self => Attr self PageOrientation

The value of ''PrintSettingsOrientation'', converted to a `PageOrientation`.

printSettingsPaperSize :: PrintSettingsClass self => Attr self PaperSize

The value of `PrintSettingsPaperFormat`, converted to a `PaperSize`.

printSettingsUseColor :: PrintSettingsClass self => Attr self Bool

The value of ''PrintSettingsUseColor''.

printSettingsCollate :: PrintSettingsClass self => Attr self Bool

The value of ''PrintSettingsCollate''.

printSettingsReverse :: PrintSettingsClass self => Attr self Bool

The value of ''PrintSettingsReverse''.

printSettingsDuplex :: PrintSettingsClass self => Attr self PrintDuplex

The value of ''PrintSettingsDuplex''.

printSettingsQuality :: PrintSettingsClass self => Attr self PrintQuality

The value of ''PrintSettingsQuality''.

printSettingsNCopies :: PrintSettingsClass self => Attr self Int

The value of `PrintSettingsNCopies`.

printSettingsNumberUp :: PrintSettingsClass self => Attr self Int

The value of `PrintSettingsNumberUp`.

printSettingsResolution :: PrintSettingsClass self => Attr self Int

The value of `PrintSettingsResolution`.

printSettingsScale :: PrintSettingsClass self => Attr self Double

The value of `PrintSettingsScale`.

printSettingsPrintPages :: PrintSettingsClass self => Attr self PrintPages

The value of `PrintSettingsPrintPages`.

printSettingsPageSet :: PrintSettingsClass self => Attr self PageSet

The value of `PrintSettingsPageSet`.

printSettingsDefaultSource :: PrintSettingsClass self => Attr self String

The value of `PrintSettingsDefaultSource`.

printSettingsMediaType :: PrintSettingsClass self => Attr self String

The value of `PrintSettingsMediaType`.

printSettingsDither :: PrintSettingsClass self => Attr self String

The value of `PrintSettingsDither`.

printSettingsFinishings :: PrintSettingsClass self => Attr self String

The value of `PrintSettingsFinishings`.

printSettingsOutputBin :: PrintSettingsClass self => Attr self String

The value of `PrintSettingsOutputBin`.

printSettingsNumberUpLayout :: PrintSettingsClass self => Attr self NumberUpLayout

The value of `PrintSettingsNumberUpLayout`.

printSettingsPrinterLpi :: PrintSettingsClass self => Attr self Double

The value of `PrintSettingsPrinterLpi`.