Maintainer | gtk2hs-users@lists.sourceforge.net |
---|---|
Stability | provisional |
Portability | portable (depends on GHC) |
Safe Haskell | None |
Language | Haskell98 |
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
- printSettingsNew :: IO PrintSettings
- printSettingsNewFromFile :: GlibFilePath fp => fp -> IO PrintSettings
- printSettingsCopy :: PrintSettingsClass self => self -> IO PrintSettings
- printSettingsHasKey :: (PrintSettingsClass self, GlibString string) => self -> string -> IO Bool
- printSettingsGet :: (PrintSettingsClass self, GlibString string) => self -> string -> IO string
- printSettingsSet :: (PrintSettingsClass self, GlibString string) => self -> string -> string -> IO ()
- printSettingsUnset :: (PrintSettingsClass self, GlibString string) => self -> string -> IO ()
- printSettingsForeach :: PrintSettingsClass self => self -> (String -> IO ()) -> IO ()
- printSettingsGetBool :: (PrintSettingsClass self, GlibString string) => self -> string -> IO Bool
- printSettingsSetBool :: (PrintSettingsClass self, GlibString string) => self -> string -> Bool -> IO ()
- printSettingsGetDouble :: (PrintSettingsClass self, GlibString string) => self -> string -> IO Double
- printSettingsGetDoubleWithDefault :: (PrintSettingsClass self, GlibString string) => self -> string -> Double -> IO Double
- printSettingsSetDouble :: (PrintSettingsClass self, GlibString string) => self -> string -> Double -> IO ()
- printSettingsGetLength :: (PrintSettingsClass self, GlibString string) => self -> string -> Unit -> IO Double
- printSettingsSetLength :: (PrintSettingsClass self, GlibString string) => self -> string -> Double -> Unit -> IO ()
- printSettingsGetInt :: (PrintSettingsClass self, GlibString string) => self -> string -> IO Int
- printSettingsGetIntWithDefault :: (PrintSettingsClass self, GlibString string) => self -> string -> Int -> IO Int
- printSettingsSetInt :: (PrintSettingsClass self, GlibString string) => 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, GlibString string) => self -> string -> IO Bool
- printSettingsToFile :: (PrintSettingsClass self, GlibString string) => self -> string -> IO Bool
- printSettingsPrinter :: (PrintSettingsClass self, GlibString string) => 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, GlibString string) => Attr self string
- printSettingsMediaType :: (PrintSettingsClass self, GlibString string) => Attr self string
- printSettingsDither :: (PrintSettingsClass self, GlibString string) => Attr self string
- printSettingsFinishings :: (PrintSettingsClass self, GlibString string) => Attr self string
- printSettingsOutputBin :: (PrintSettingsClass self, GlibString string) => 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 -> PrintSettings Source
toPrintSettings :: PrintSettingsClass o => o -> PrintSettings Source
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 PrintSettings Source
Creates a new PrintSettings
object.
printSettingsNewFromFile Source
:: GlibFilePath fp | |
=> fp |
|
-> 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, GlibString string) | |
=> self | |
-> string |
|
-> IO Bool | returns |
Returns True
, if a value is associated with key
.
:: (PrintSettingsClass self, GlibString string) | |
=> self | |
-> string |
|
-> IO string | returns the string value for |
Looks up the string value associated with key
.
:: (PrintSettingsClass self, GlibString string) | |
=> self | |
-> string |
|
-> string |
|
-> IO () |
Associates value
with key
.
:: (PrintSettingsClass self, GlibString string) | |
=> self | |
-> string |
|
-> IO () |
Removes any value associated with key
:: PrintSettingsClass self | |
=> self | |
-> (String -> IO ()) |
|
-> IO () |
Calls func
for each key-value pair of settings
.
:: (PrintSettingsClass self, GlibString string) | |
=> 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, GlibString string) | |
=> self | |
-> string |
|
-> Bool |
|
-> IO () |
Sets key
to a boolean value.
:: (PrintSettingsClass self, GlibString string) | |
=> self | |
-> string |
|
-> IO Double | returns the double value of |
Returns the double value associated with key
, or 0.
printSettingsGetDoubleWithDefault Source
:: (PrintSettingsClass self, GlibString string) | |
=> 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, GlibString string) | |
=> self | |
-> string |
|
-> Double |
|
-> IO () |
Sets key
to a double value.
:: (PrintSettingsClass self, GlibString string) | |
=> 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, GlibString string) | |
=> self | |
-> string |
|
-> Double |
|
-> Unit |
|
-> IO () |
Associates a length in units of unit
with key
.
:: (PrintSettingsClass self, GlibString string) | |
=> self | |
-> string |
|
-> IO Int | returns the integer value of |
Returns the integer value of key
, or 0.
printSettingsGetIntWithDefault Source
:: (PrintSettingsClass self, GlibString string) | |
=> 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, GlibString string) | |
=> self | |
-> string |
|
-> Int |
|
-> IO () |
Sets key
to an integer value.
printSettingsGetPaperWidth Source
:: PrintSettingsClass self | |
=> self | |
-> Unit |
|
-> IO Double | returns the paper width, in units of |
Gets the value of PrintSettingsPaperWidth
, converted to unit.
printSettingsSetPaperWidth Source
:: PrintSettingsClass self | |
=> self | |
-> Double |
|
-> Unit |
|
-> IO () |
Sets the value of PrintSettingsPaperWidth
.
printSettingsGetPaperHeight Source
:: PrintSettingsClass self | |
=> self | |
-> Unit |
|
-> IO Double | returns the paper height, in units of |
Gets the value of PrintSettingsPaperHeight
, converted to unit.
printSettingsSetPaperHeight Source
:: PrintSettingsClass self | |
=> self | |
-> Double |
|
-> Unit |
|
-> IO () |
Sets the value of PrintSettingsPaperHeight
.
printSettingsSetResolutionXy Source
:: PrintSettingsClass self | |
=> self | |
-> Int |
|
-> Int |
|
-> IO () |
Sets the values of PrintSettingsResolution
, PrintSettingsResolutionX
and
PrintSettingsResolutionY
.
- Available since Gtk+ version 2.16
printSettingsGetResolutionX Source
:: PrintSettingsClass self | |
=> self | |
-> IO Int | returns the horizontal resolution in dpi |
Gets the value of "resolution-x"
.
- Available since Gtk+ version 2.16
printSettingsGetResolutionY Source
:: 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, GlibString string) | |
=> self | |
-> string |
|
-> IO Bool | returns |
Reads the print settings from fileName
. See printSettingsToFile
.
- Available since Gtk+ version 2.14
:: (PrintSettingsClass self, GlibString string) | |
=> 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, GlibString string) => Attr self string Source
Obtain the value of PrintSettingsPrinter
.
printSettingsOrientation :: PrintSettingsClass self => Attr self PageOrientation Source
The value of 'PrintSettingsOrientation'
, converted to a PageOrientation
.
printSettingsPaperSize :: PrintSettingsClass self => Attr self PaperSize Source
The value of PrintSettingsPaperFormat
, converted to a PaperSize
.
printSettingsUseColor :: PrintSettingsClass self => Attr self Bool Source
The value of 'PrintSettingsUseColor'
.
printSettingsCollate :: PrintSettingsClass self => Attr self Bool Source
The value of 'PrintSettingsCollate'
.
printSettingsReverse :: PrintSettingsClass self => Attr self Bool Source
The value of 'PrintSettingsReverse'
.
printSettingsDuplex :: PrintSettingsClass self => Attr self PrintDuplex Source
The value of 'PrintSettingsDuplex'
.
printSettingsQuality :: PrintSettingsClass self => Attr self PrintQuality Source
The value of 'PrintSettingsQuality'
.
printSettingsNCopies :: PrintSettingsClass self => Attr self Int Source
The value of PrintSettingsNCopies
.
printSettingsNumberUp :: PrintSettingsClass self => Attr self Int Source
The value of PrintSettingsNumberUp
.
printSettingsResolution :: PrintSettingsClass self => Attr self Int Source
The value of PrintSettingsResolution
.
printSettingsScale :: PrintSettingsClass self => Attr self Double Source
The value of PrintSettingsScale
.
printSettingsPrintPages :: PrintSettingsClass self => Attr self PrintPages Source
The value of PrintSettingsPrintPages
.
printSettingsPageSet :: PrintSettingsClass self => Attr self PageSet Source
The value of PrintSettingsPageSet
.
printSettingsDefaultSource :: (PrintSettingsClass self, GlibString string) => Attr self string Source
The value of PrintSettingsDefaultSource
.
printSettingsMediaType :: (PrintSettingsClass self, GlibString string) => Attr self string Source
The value of PrintSettingsMediaType
.
printSettingsDither :: (PrintSettingsClass self, GlibString string) => Attr self string Source
The value of PrintSettingsDither
.
printSettingsFinishings :: (PrintSettingsClass self, GlibString string) => Attr self string Source
The value of PrintSettingsFinishings
.
printSettingsOutputBin :: (PrintSettingsClass self, GlibString string) => Attr self string Source
The value of PrintSettingsOutputBin
.
printSettingsNumberUpLayout :: PrintSettingsClass self => Attr self NumberUpLayout Source
The value of PrintSettingsNumberUpLayout
.
printSettingsPrinterLpi :: PrintSettingsClass self => Attr self Double Source
The value of PrintSettingsPrinterLpi
.