gi-gtk-3.0.24: Gtk bindings

CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (garetxe@gmail.com)
Safe HaskellNone
LanguageHaskell2010

GI.Gtk.Structs.PaperSize

Contents

Description

GtkPaperSize 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, GtkPaperSize 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][print-margins].

Printing support has been added in GTK+ 2.10.

Synopsis

Exported types

newtype PaperSize Source #

Memory-managed wrapper type.

Instances
BoxedObject PaperSize Source # 
Instance details

Defined in GI.Gtk.Structs.PaperSize

noPaperSize :: Maybe PaperSize Source #

A convenience alias for Nothing :: Maybe PaperSize.

Methods

copy

paperSizeCopy Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> PaperSize

other: a PaperSize

-> m PaperSize

Returns: a copy of other

Copies an existing PaperSize.

Since: 2.10

free

paperSizeFree Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> PaperSize

size: a PaperSize

-> m () 

Free the given PaperSize object.

Since: 2.10

getDefault

paperSizeGetDefault Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m Text

Returns: the name of the default paper size. The string is owned by GTK+ and should not be modified.

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

Since: 2.10

getDefaultBottomMargin

paperSizeGetDefaultBottomMargin Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> PaperSize

size: a PaperSize object

-> Unit

unit: the unit for the return value, not UnitNone

-> m Double

Returns: the default bottom margin

Gets the default bottom margin for the PaperSize.

Since: 2.10

getDefaultLeftMargin

paperSizeGetDefaultLeftMargin Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> PaperSize

size: a PaperSize object

-> Unit

unit: the unit for the return value, not UnitNone

-> m Double

Returns: the default left margin

Gets the default left margin for the PaperSize.

Since: 2.10

getDefaultRightMargin

paperSizeGetDefaultRightMargin Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> PaperSize

size: a PaperSize object

-> Unit

unit: the unit for the return value, not UnitNone

-> m Double

Returns: the default right margin

Gets the default right margin for the PaperSize.

Since: 2.10

getDefaultTopMargin

paperSizeGetDefaultTopMargin Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> PaperSize

size: a PaperSize object

-> Unit

unit: the unit for the return value, not UnitNone

-> m Double

Returns: the default top margin

Gets the default top margin for the PaperSize.

Since: 2.10

getDisplayName

paperSizeGetDisplayName Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> PaperSize

size: a PaperSize object

-> m Text

Returns: the human-readable name of size

Gets the human-readable name of the PaperSize.

Since: 2.10

getHeight

paperSizeGetHeight Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> PaperSize

size: a PaperSize object

-> Unit

unit: the unit for the return value, not UnitNone

-> m Double

Returns: the paper height

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

Since: 2.10

getName

paperSizeGetName Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> PaperSize

size: a PaperSize object

-> m Text

Returns: the name of size

Gets the name of the PaperSize.

Since: 2.10

getPaperSizes

paperSizeGetPaperSizes Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Bool

includeCustom: whether to include custom paper sizes as defined in the page setup dialog

-> m [PaperSize]

Returns: a newly allocated list of newly allocated PaperSize objects

Creates a list of known paper sizes.

Since: 2.12

getPpdName

paperSizeGetPpdName Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> PaperSize

size: a PaperSize object

-> m Text

Returns: the PPD name of size

Gets the PPD name of the PaperSize, which may be Nothing.

Since: 2.10

getWidth

paperSizeGetWidth Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> PaperSize

size: a PaperSize object

-> Unit

unit: the unit for the return value, not UnitNone

-> m Double

Returns: the paper width

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

Since: 2.10

isCustom

paperSizeIsCustom Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> PaperSize

size: a PaperSize object

-> m Bool

Returns: whether size is a custom paper size.

Returns True if size is not a standard paper size.

isEqual

paperSizeIsEqual Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> PaperSize

size1: a PaperSize object

-> PaperSize

size2: another PaperSize object

-> m Bool

Returns: True, if size1 and size2 represent the same paper size

Compares two PaperSize objects.

Since: 2.10

isIpp

paperSizeIsIpp Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> PaperSize

size: a PaperSize object

-> m Bool

Returns: whether size is not an IPP custom paper size.

Returns True if size is an IPP standard paper size.

new

paperSizeNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Maybe Text

name: a paper size name, or Nothing

-> m PaperSize

Returns: a new PaperSize, use paperSizeFree to free it

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.

Since: 2.10

newCustom

paperSizeNewCustom Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

name: the paper name

-> Text

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. not UnitNone.

-> m PaperSize

Returns: a new PaperSize object, use paperSizeFree to free it

Creates a new PaperSize object with the given parameters.

Since: 2.10

newFromGvariant

paperSizeNewFromGvariant Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> GVariant

variant: an a{sv} GVariant

-> m PaperSize

Returns: a new PaperSize object

Deserialize a paper size from an a{sv} variant in the format produced by paperSizeToGvariant.

Since: 3.22

newFromIpp

paperSizeNewFromIpp Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

ippName: an IPP paper name

-> Double

width: the paper width, in points

-> Double

height: the paper height in points

-> m PaperSize

Returns: a new PaperSize, use paperSizeFree to free it

Creates a new PaperSize object by using IPP information.

If ippName is not a recognized paper name, width and height are used to construct a custom PaperSize object.

Since: 3.16

newFromKeyFile

paperSizeNewFromKeyFile Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> KeyFile

keyFile: the KeyFile to retrieve the papersize from

-> Text

groupName: the name ofthe group in the key file to read, or Nothing to read the first group

-> m PaperSize

Returns: a new PaperSize object with the restored paper size, or Nothing if an error occurred (Can throw GError)

Reads a paper size from the group groupName in the key file keyFile.

Since: 2.12

newFromPpd

paperSizeNewFromPpd Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

ppdName: a PPD paper name

-> Text

ppdDisplayName: the corresponding human-readable name

-> Double

width: the paper width, in points

-> Double

height: the paper height in points

-> m PaperSize

Returns: a new PaperSize, use paperSizeFree to free it

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.

Since: 2.10

setSize

paperSizeSetSize Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> PaperSize

size: a custom PaperSize object

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

-> m () 

Changes the dimensions of a size to width x height.

Since: 2.10

toGvariant

paperSizeToGvariant Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> PaperSize

paperSize: a PaperSize

-> m GVariant

Returns: a new, floating, GVariant

Serialize a paper size to an a{sv} variant.

Since: 3.22

toKeyFile

paperSizeToKeyFile Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> PaperSize

size: a PaperSize

-> KeyFile

keyFile: the KeyFile to save the paper size to

-> Text

groupName: the group to add the settings to in keyFile

-> m () 

This function adds the paper size from size to keyFile.

Since: 2.12