Portability | portable (depends on GHC) |
---|---|
Stability | provisional |
Maintainer | gtk2hs-users@lists.sourceforge.net |
Stores print settings
- Module available since Gtk+ version 2.10
- data PrintSettings
- class GObjectClass o => PrintSettingsClass o
- castToPrintSettings :: GObjectClass obj => obj -> PrintSettings
- toPrintSettings :: PrintSettingsClass o => o -> PrintSettings
- data PageOrientation
- data NumberUpLayout
- = NumberUpLayoutLeftToRightTopToBottom
- | NumberUpLayoutLeftToRightBottomToTop
- | NumberUpLayoutRightToLeftTopToBottom
- | NumberUpLayoutRightToLeftBottomToTop
- | NumberUpLayoutTopToBottomLeftToRight
- | NumberUpLayoutTopToBottomRightToLeft
- | NumberUpLayoutBottomToTopLeftToRight
- | NumberUpLayoutBottomToTopRightToLeft
- data PrintQuality
- data PrintDuplex
- data PrintPages
- 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 Source
castToPrintSettings :: GObjectClass obj => obj -> PrintSettingsSource
toPrintSettings :: PrintSettingsClass o => o -> PrintSettingsSource
Enums
data PageOrientation Source
data NumberUpLayout Source
Used to determine the layout of pages on a sheet when printing multiple pages per sheet.
data PrintQuality Source
data PrintDuplex Source
data PrintPages Source
Constructors
printSettingsNew :: IO PrintSettingsSource
Creates a new PrintSettings
object.
printSettingsNewFromFileSource
:: String |
|
-> IO PrintSettings |
Reads the print settings from fileName
. Returns a new PrintSettings
object with the restored settings.
- Available since Gtk+ version 2.12
Methods
:: PrintSettingsClass self | |
=> self | |
-> IO PrintSettings | returns a newly allocated copy of |
Copies a PrintSettings
object.
:: PrintSettingsClass self | |
=> self | |
-> String |
|
-> IO Bool | returns |
Returns True
, if a value is associated with key
.
:: PrintSettingsClass self | |
=> self | |
-> String |
|
-> IO String | returns the string value for |
Looks up the string value associated with key
.
:: PrintSettingsClass self | |
=> self | |
-> String |
|
-> String |
|
-> IO () |
Associates value
with key
.
:: PrintSettingsClass self | |
=> self | |
-> String |
|
-> IO () |
Removes any value associated with key
Calls func
for each key-value pair of settings
.
:: PrintSettingsClass self | |
=> self | |
-> String |
|
-> IO Bool | returns |
Returns the boolean represented by the value that is associated with
key
.
The string "true" represents True
, any other string False
.
:: PrintSettingsClass self | |
=> self | |
-> String |
|
-> Bool |
|
-> IO () |
Sets key
to a boolean value.
:: PrintSettingsClass self | |
=> self | |
-> String |
|
-> IO Double | returns the double value of |
Returns the double value associated with key
, or 0.
printSettingsGetDoubleWithDefaultSource
:: PrintSettingsClass self | |
=> self | |
-> String |
|
-> Double |
|
-> IO Double | returns the floating point number associated with |
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
.
:: PrintSettingsClass self | |
=> self | |
-> String |
|
-> Double |
|
-> IO () |
Sets key
to a double value.
:: PrintSettingsClass self | |
=> self | |
-> String |
|
-> Unit |
|
-> IO Double | returns the length value of |
Returns the value associated with key
, interpreted as a length. The
returned value is converted to units
.
:: PrintSettingsClass self | |
=> self | |
-> String |
|
-> Double |
|
-> Unit |
|
-> IO () |
Associates a length in units of unit
with key
.
:: PrintSettingsClass self | |
=> self | |
-> String |
|
-> IO Int | returns the integer value of |
Returns the integer value of key
, or 0.
printSettingsGetIntWithDefaultSource
:: PrintSettingsClass self | |
=> self | |
-> String |
|
-> Int |
|
-> IO Int | returns the integer value of |
Returns the value of key
, interpreted as an integer, or the default
value.
:: PrintSettingsClass self | |
=> self | |
-> String |
|
-> Int |
|
-> IO () |
Sets key
to an integer value.
printSettingsGetPaperWidthSource
:: PrintSettingsClass self | |
=> self | |
-> Unit |
|
-> IO Double | returns the paper width, in units of |
Gets the value of PrintSettingsPaperWidth
, converted to unit.
printSettingsSetPaperWidthSource
:: PrintSettingsClass self | |
=> self | |
-> Double |
|
-> Unit |
|
-> IO () |
Sets the value of PrintSettingsPaperWidth
.
printSettingsGetPaperHeightSource
:: PrintSettingsClass self | |
=> self | |
-> Unit |
|
-> IO Double | returns the paper height, in units of |
Gets the value of PrintSettingsPaperHeight
, converted to unit.
printSettingsSetPaperHeightSource
:: PrintSettingsClass self | |
=> self | |
-> Double |
|
-> Unit |
|
-> IO () |
Sets the value of PrintSettingsPaperHeight
.
printSettingsSetResolutionXySource
:: PrintSettingsClass self | |
=> self | |
-> Int |
|
-> Int |
|
-> IO () |
Sets the values of PrintSettingsResolution
, PrintSettingsResolutionX
and
PrintSettingsResolutionY
.
- Available since Gtk+ version 2.16
printSettingsGetResolutionXSource
:: PrintSettingsClass self | |
=> self | |
-> IO Int | returns the horizontal resolution in dpi |
Gets the value of resolution-x
.
- Available since Gtk+ version 2.16
printSettingsGetResolutionYSource
:: PrintSettingsClass self | |
=> self | |
-> IO Int | returns the vertical resolution in dpi |
Gets the value of resolution-y
.
- Available since Gtk+ version 2.16
:: PrintSettingsClass self | |
=> self | |
-> String |
|
-> IO Bool | returns |
Reads the print settings from fileName
. See printSettingsToFile
.
- Available since Gtk+ version 2.14
:: PrintSettingsClass self | |
=> self | |
-> String |
|
-> IO Bool | returns |
This function saves the print settings from settings
to fileName
.
- Available since Gtk+ version 2.12
Attributes
printSettingsPrinter :: PrintSettingsClass self => Attr self StringSource
Obtain the value of PrintSettingsPrinter
.
printSettingsOrientation :: PrintSettingsClass self => Attr self PageOrientationSource
The value of ''PrintSettingsOrientation'', converted to a PageOrientation
.
printSettingsPaperSize :: PrintSettingsClass self => Attr self PaperSizeSource
The value of PrintSettingsPaperFormat
, converted to a PaperSize
.
printSettingsUseColor :: PrintSettingsClass self => Attr self BoolSource
The value of ''PrintSettingsUseColor''.
printSettingsCollate :: PrintSettingsClass self => Attr self BoolSource
The value of ''PrintSettingsCollate''.
printSettingsReverse :: PrintSettingsClass self => Attr self BoolSource
The value of ''PrintSettingsReverse''.
printSettingsDuplex :: PrintSettingsClass self => Attr self PrintDuplexSource
The value of ''PrintSettingsDuplex''.
printSettingsQuality :: PrintSettingsClass self => Attr self PrintQualitySource
The value of ''PrintSettingsQuality''.
printSettingsNCopies :: PrintSettingsClass self => Attr self IntSource
The value of PrintSettingsNCopies
.
printSettingsNumberUp :: PrintSettingsClass self => Attr self IntSource
The value of PrintSettingsNumberUp
.
printSettingsResolution :: PrintSettingsClass self => Attr self IntSource
The value of PrintSettingsResolution
.
printSettingsScale :: PrintSettingsClass self => Attr self DoubleSource
The value of PrintSettingsScale
.
printSettingsPrintPages :: PrintSettingsClass self => Attr self PrintPagesSource
The value of PrintSettingsPrintPages
.
printSettingsPageSet :: PrintSettingsClass self => Attr self PageSetSource
The value of PrintSettingsPageSet
.
printSettingsDefaultSource :: PrintSettingsClass self => Attr self StringSource
The value of PrintSettingsDefaultSource
.
printSettingsMediaType :: PrintSettingsClass self => Attr self StringSource
The value of PrintSettingsMediaType
.
printSettingsDither :: PrintSettingsClass self => Attr self StringSource
The value of PrintSettingsDither
.
printSettingsFinishings :: PrintSettingsClass self => Attr self StringSource
The value of PrintSettingsFinishings
.
printSettingsOutputBin :: PrintSettingsClass self => Attr self StringSource
The value of PrintSettingsOutputBin
.
printSettingsNumberUpLayout :: PrintSettingsClass self => Attr self NumberUpLayoutSource
The value of PrintSettingsNumberUpLayout
.
printSettingsPrinterLpi :: PrintSettingsClass self => Attr self DoubleSource
The value of PrintSettingsPrinterLpi
.