gtk3-0.15.10: Binding to the Gtk+ 3 graphical user interface library

Maintainer | gtk2hs-users@lists.sourceforge.net
Stability | provisional
Portability | portable (depends on GHC)
Safe Haskell | None
Language | Haskell98

Graphics.UI.Gtk.Printing.PaperSize

Contents

- Detail
- Types
- Enums
- Constructors
- Methods

Description

Support for named paper sizes

Synopsis

- newtype PaperSize = PaperSize (ForeignPtr PaperSize)
- mkPaperSize :: Ptr PaperSize -> IO PaperSize
- data Unit
  - = UnitNone
  - | UnitPoints
  - | UnitInch
  - | UnitMm
- paperSizeNew :: GlibString string => Maybe string -> IO PaperSize
- paperSizeNewFromPpd :: GlibString string => string -> string -> Double -> Double -> IO PaperSize
- paperSizeNewCustom :: GlibString string => string -> string -> Double -> Double -> Unit -> IO PaperSize
- paperSizeCopy :: PaperSize -> IO PaperSize
- paperSizeIsEqual :: PaperSize -> PaperSize -> IO Bool
- paperSizeGetName :: GlibString string => PaperSize -> IO string
- paperSizeGetDisplayName :: GlibString string => PaperSize -> IO string
- paperSizeGetPpdName :: GlibString string => PaperSize -> IO (Maybe string)
- paperSizeGetWidth :: PaperSize -> Unit -> IO Double
- paperSizeGetHeight :: PaperSize -> Unit -> IO Double
- paperSizeIsCustom :: PaperSize -> IO Bool
- paperSizeSetSize :: PaperSize -> Double -> Double -> Unit -> IO ()
- paperSizeGetDefaultTopMargin :: PaperSize -> Unit -> IO Double
- paperSizeGetDefaultBottomMargin :: PaperSize -> Unit -> IO Double
- paperSizeGetDefaultLeftMargin :: PaperSize -> Unit -> IO Double
- paperSizeGetDefaultRightMargin :: PaperSize -> Unit -> IO Double
- paperSizeGetDefault :: GlibString string => IO string
- paperSizeGetPaperSizes :: Bool -> IO [PaperSize]

# Detail

`PaperSize` handles paper sizes. It uses the standard called "PWG 5101.1-2002 PWG: Standard for Media Standardized Names" to name the paper sizes (and to get the data for the page sizes). In addition to standard paper sizes, `PaperSize` allows to construct custom paper sizes with arbitrary dimensions.

The `PaperSize` object stores not only the dimensions (width and height) of a paper size and its name, it also provides default print margins.

Printing support has been added in Gtk+ 2.10.

# Types

newtype PaperSize Source #

Constructors

PaperSize (ForeignPtr PaperSize) |

mkPaperSize :: Ptr PaperSize -> IO PaperSize Source #

# Enums

data Unit Source #

Constructors

UnitNone |
UnitPoints |
UnitInch |
UnitMm |

#### Instances

Instances details

Bounded Unit Source # |
Instance details Defined in Graphics.UI.Gtk.Printing.PaperSize Methods minBound :: Unit Source # maxBound :: Unit Source #
Enum Unit Source # |
Instance details Defined in Graphics.UI.Gtk.Printing.PaperSize Methods succ :: Unit -> Unit Source # pred :: Unit -> Unit Source # toEnum :: Int -> Unit Source # fromEnum :: Unit -> Int Source # enumFrom :: Unit -> [Unit] Source # enumFromThen :: Unit -> Unit -> [Unit] Source # enumFromTo :: Unit -> Unit -> [Unit] Source # enumFromThenTo :: Unit -> Unit -> Unit -> [Unit] Source #
Show Unit Source # |
Instance details Defined in Graphics.UI.Gtk.Printing.PaperSize Methods showsPrec :: Int -> Unit -> ShowS Source # show :: Unit -> String Source # showList :: [Unit] -> ShowS Source #
Eq Unit Source # |
Instance details Defined in Graphics.UI.Gtk.Printing.PaperSize Methods (==) :: Unit -> Unit -> Bool Source # (/=) :: Unit -> Unit -> Bool Source #

# Constructors

paperSizeNew Source #

Arguments

:: GlibString string |
=> Maybe string | `name` - a paper size name, or `Nothing`
-> IO PaperSize |

Creates a new `PaperSize` object by parsing a PWG 5101.1-2002 paper name.

If `name` is Nothing, the default paper size is returned, see `paperSizeGetDefault`.

- Available since Gtk+ version 2.10

paperSizeNewFromPpd Source #

Arguments

:: GlibString string |
=> string | `ppdName` - a PPD paper name
-> string | `ppdDisplayName` - the corresponding human-readable name
-> Double | `width` - the paper width, in points
-> Double | `height` - the paper height in points
-> IO PaperSize |

Creates a new `PaperSize` object by using PPD information.

If `ppdName` is not a recognized PPD paper name, `ppdDisplayName`, `width` and `height` are used to construct a custom `PaperSize` object.

- Available since Gtk+ version 2.10

paperSizeNewCustom Source #

Arguments

:: GlibString string |
=> string | `name` - the paper name
-> string | `displayName` - the human-readable name
-> Double | `width` - the paper width, in units of `unit`
-> Double | `height` - the paper height, in units of `unit`
-> Unit | `unit` - the unit for `width` and `height`
-> IO PaperSize |

Creates a new `PaperSize` object with the given parameters.

- Available since Gtk+ version 2.10

# Methods

paperSizeCopy Source #

Arguments

:: PaperSize |
-> IO PaperSize | returns a copy of `other`

Copies an existing `PaperSize`.

- Available since Gtk+ version 2.10

paperSizeIsEqual Source #

Arguments

:: PaperSize |
-> PaperSize | `size2` - another `PaperSize` object
-> IO Bool | returns `True`, if `size1` and `size2` represent the same paper size

Compares two `PaperSize` objects.

- Available since Gtk+ version 2.10

paperSizeGetName Source #

Arguments

:: GlibString string |
=> PaperSize |
-> IO string | returns the name of `size`

Gets the name of the `PaperSize`.

- Available since Gtk+ version 2.10

paperSizeGetDisplayName Source #

Arguments

:: GlibString string |
=> PaperSize |
-> IO string | returns the human-readable name of `size`

Gets the human-readable name of the `PaperSize`.

- Available since Gtk+ version 2.10

paperSizeGetPpdName Source #

Arguments

:: GlibString string |
=> PaperSize |
-> IO (Maybe string) | returns the PPD name of `size`, or `Nothing`

Gets the PPD name of the `PaperSize`, which may be

- Available since Gtk+ version 2.10

paperSizeGetWidth Source #

Arguments

:: PaperSize |
-> Unit | `unit` - the unit for the return value
-> IO Double | returns the paper width

Gets the paper width of the `PaperSize`, in units of `unit`.

- Available since Gtk+ version 2.10

paperSizeGetHeight Source #

Arguments

:: PaperSize |
-> Unit | `unit` - the unit for the return value
-> IO Double | returns the paper height

Gets the paper height of the `PaperSize`, in units of `unit`.

- Available since Gtk+ version 2.10

paperSizeIsCustom Source #

Arguments

:: PaperSize |
-> IO Bool | returns whether `size` is a custom paper size.

Returns `True` if `size` is not a standard paper size.

paperSizeSetSize Source #

Arguments

:: PaperSize |
-> Double | `width` - the new width in units of `unit`
-> Double | `height` - the new height in units of `unit`
-> Unit | `unit` - the unit for `width` and `height`
-> IO () |

Changes the dimensions of a `size` to `width` x `height`.

- Available since Gtk+ version 2.10

paperSizeGetDefaultTopMargin Source #

Arguments

:: PaperSize |
-> Unit | `unit` - the unit for the return value
-> IO Double | returns the default top margin

Gets the default top margin for the `PaperSize`.

- Available since Gtk+ version 2.10

paperSizeGetDefaultBottomMargin Source #

Arguments

:: PaperSize |
-> Unit | `unit` - the unit for the return value
-> IO Double | returns the default bottom margin

Gets the default bottom margin for the `PaperSize`.

- Available since Gtk+ version 2.10

paperSizeGetDefaultLeftMargin Source #

Arguments

:: PaperSize |
-> Unit | `unit` - the unit for the return value
-> IO Double | returns the default left margin

Gets the default left margin for the `PaperSize`.

- Available since Gtk+ version 2.10

paperSizeGetDefaultRightMargin Source #

Arguments

:: PaperSize |
-> Unit | `unit` - the unit for the return value
-> IO Double | returns the default right margin

Gets the default right margin for the `PaperSize`.

- Available since Gtk+ version 2.10

paperSizeGetDefault Source #

Arguments

:: GlibString string |
=> IO string | returns the name of the default paper size.

Returns the name of the default paper size, which depends on the current locale.

- Available since Gtk+ version 2.10

paperSizeGetPaperSizes Source #

Arguments

:: Bool | `includeCustom` - whether to include custom paper sizes as defined in the page setup dialog
-> IO [PaperSize] |

Creates a list of known paper sizes.

- Available since Gtk+ version 2.12