Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Save a [classbuffer
] into a file.
A GtkSourceFileSaver
object permits to save a [classbuffer
] into a
File
.
A file saver should be used only for one save operation, including errors
handling. If an error occurs, you can reconfigure the saver and relaunch the
operation with [methodfileSaver
.save_async].
Synopsis
- newtype FileSaver = FileSaver (ManagedPtr FileSaver)
- class (GObject o, IsDescendantOf FileSaver o) => IsFileSaver o
- toFileSaver :: (MonadIO m, IsFileSaver o) => o -> m FileSaver
- fileSaverGetBuffer :: (HasCallStack, MonadIO m, IsFileSaver a) => a -> m Buffer
- fileSaverGetCompressionType :: (HasCallStack, MonadIO m, IsFileSaver a) => a -> m CompressionType
- fileSaverGetEncoding :: (HasCallStack, MonadIO m, IsFileSaver a) => a -> m Encoding
- fileSaverGetFile :: (HasCallStack, MonadIO m, IsFileSaver a) => a -> m File
- fileSaverGetFlags :: (HasCallStack, MonadIO m, IsFileSaver a) => a -> m [FileSaverFlags]
- fileSaverGetLocation :: (HasCallStack, MonadIO m, IsFileSaver a) => a -> m File
- fileSaverGetNewlineType :: (HasCallStack, MonadIO m, IsFileSaver a) => a -> m NewlineType
- fileSaverNew :: (HasCallStack, MonadIO m, IsBuffer a, IsFile b) => a -> b -> m FileSaver
- fileSaverNewWithTarget :: (HasCallStack, MonadIO m, IsBuffer a, IsFile b, IsFile c) => a -> b -> c -> m FileSaver
- fileSaverSaveAsync :: (HasCallStack, MonadIO m, IsFileSaver a, IsCancellable b) => a -> Int32 -> Maybe b -> Maybe FileProgressCallback -> Maybe AsyncReadyCallback -> m ()
- fileSaverSaveFinish :: (HasCallStack, MonadIO m, IsFileSaver a, IsAsyncResult b) => a -> b -> m ()
- fileSaverSetCompressionType :: (HasCallStack, MonadIO m, IsFileSaver a) => a -> CompressionType -> m ()
- fileSaverSetEncoding :: (HasCallStack, MonadIO m, IsFileSaver a) => a -> Maybe Encoding -> m ()
- fileSaverSetFlags :: (HasCallStack, MonadIO m, IsFileSaver a) => a -> [FileSaverFlags] -> m ()
- fileSaverSetNewlineType :: (HasCallStack, MonadIO m, IsFileSaver a) => a -> NewlineType -> m ()
- constructFileSaverBuffer :: (IsFileSaver o, MonadIO m, IsBuffer a) => a -> m (GValueConstruct o)
- getFileSaverBuffer :: (MonadIO m, IsFileSaver o) => o -> m Buffer
- constructFileSaverCompressionType :: (IsFileSaver o, MonadIO m) => CompressionType -> m (GValueConstruct o)
- getFileSaverCompressionType :: (MonadIO m, IsFileSaver o) => o -> m CompressionType
- setFileSaverCompressionType :: (MonadIO m, IsFileSaver o) => o -> CompressionType -> m ()
- clearFileSaverEncoding :: (MonadIO m, IsFileSaver o) => o -> m ()
- constructFileSaverEncoding :: (IsFileSaver o, MonadIO m) => Encoding -> m (GValueConstruct o)
- getFileSaverEncoding :: (MonadIO m, IsFileSaver o) => o -> m Encoding
- setFileSaverEncoding :: (MonadIO m, IsFileSaver o) => o -> Encoding -> m ()
- constructFileSaverFile :: (IsFileSaver o, MonadIO m, IsFile a) => a -> m (GValueConstruct o)
- getFileSaverFile :: (MonadIO m, IsFileSaver o) => o -> m File
- constructFileSaverFlags :: (IsFileSaver o, MonadIO m) => [FileSaverFlags] -> m (GValueConstruct o)
- getFileSaverFlags :: (MonadIO m, IsFileSaver o) => o -> m [FileSaverFlags]
- setFileSaverFlags :: (MonadIO m, IsFileSaver o) => o -> [FileSaverFlags] -> m ()
- constructFileSaverLocation :: (IsFileSaver o, MonadIO m, IsFile a) => a -> m (GValueConstruct o)
- getFileSaverLocation :: (MonadIO m, IsFileSaver o) => o -> m File
- constructFileSaverNewlineType :: (IsFileSaver o, MonadIO m) => NewlineType -> m (GValueConstruct o)
- getFileSaverNewlineType :: (MonadIO m, IsFileSaver o) => o -> m NewlineType
- setFileSaverNewlineType :: (MonadIO m, IsFileSaver o) => o -> NewlineType -> m ()
Exported types
Memory-managed wrapper type.
Instances
Eq FileSaver Source # | |
GObject FileSaver Source # | |
Defined in GI.GtkSource.Objects.FileSaver | |
ManagedPtrNewtype FileSaver Source # | |
Defined in GI.GtkSource.Objects.FileSaver toManagedPtr :: FileSaver -> ManagedPtr FileSaver | |
TypedObject FileSaver Source # | |
Defined in GI.GtkSource.Objects.FileSaver | |
HasParentTypes FileSaver Source # | |
Defined in GI.GtkSource.Objects.FileSaver | |
IsGValue (Maybe FileSaver) Source # | Convert |
Defined in GI.GtkSource.Objects.FileSaver gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe FileSaver -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe FileSaver) | |
type ParentTypes FileSaver Source # | |
Defined in GI.GtkSource.Objects.FileSaver type ParentTypes FileSaver = '[Object] |
class (GObject o, IsDescendantOf FileSaver o) => IsFileSaver o Source #
Type class for types which can be safely cast to FileSaver
, for instance with toFileSaver
.
Instances
(GObject o, IsDescendantOf FileSaver o) => IsFileSaver o Source # | |
Defined in GI.GtkSource.Objects.FileSaver |
toFileSaver :: (MonadIO m, IsFileSaver o) => o -> m FileSaver Source #
Methods
Click to display all available methods, including inherited ones
Methods
bindProperty, bindPropertyFull, forceFloating, freezeNotify, getv, isFloating, notify, notifyByPspec, ref, refSink, runDispose, saveAsync, saveFinish, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getBuffer, getCompressionType, getData, getEncoding, getFile, getFlags, getLocation, getNewlineType, getProperty, getQdata.
Setters
setCompressionType, setData, setDataFull, setEncoding, setFlags, setNewlineType, setProperty.
getBuffer
:: (HasCallStack, MonadIO m, IsFileSaver a) | |
=> a |
|
-> m Buffer | Returns: the |
No description available in the introspection data.
getCompressionType
fileSaverGetCompressionType Source #
:: (HasCallStack, MonadIO m, IsFileSaver a) | |
=> a |
|
-> m CompressionType | Returns: the compression type. |
No description available in the introspection data.
getEncoding
:: (HasCallStack, MonadIO m, IsFileSaver a) | |
=> a |
|
-> m Encoding | Returns: the encoding. |
No description available in the introspection data.
getFile
:: (HasCallStack, MonadIO m, IsFileSaver a) | |
=> a |
|
-> m File | Returns: the |
No description available in the introspection data.
getFlags
:: (HasCallStack, MonadIO m, IsFileSaver a) | |
=> a |
|
-> m [FileSaverFlags] | Returns: the flags. |
No description available in the introspection data.
getLocation
:: (HasCallStack, MonadIO m, IsFileSaver a) | |
=> a |
|
-> m File | Returns: the |
No description available in the introspection data.
getNewlineType
fileSaverGetNewlineType Source #
:: (HasCallStack, MonadIO m, IsFileSaver a) | |
=> a |
|
-> m NewlineType | Returns: the newline type. |
No description available in the introspection data.
new
newWithTarget
fileSaverNewWithTarget Source #
:: (HasCallStack, MonadIO m, IsBuffer a, IsFile b, IsFile c) | |
=> a |
|
-> b |
|
-> c |
|
-> m FileSaver | Returns: a new |
Creates a new FileSaver
object with a target location.
When the file saving is finished successfully, targetLocation
is set to the file
's
[propertyfile
:location] property. If an error occurs, the previous valid
location is still available in [classfile
].
This constructor is suitable for a "save as" operation, or for saving a new buffer for the first time.
saveAsync
:: (HasCallStack, MonadIO m, IsFileSaver a, IsCancellable b) | |
=> a |
|
-> Int32 |
|
-> Maybe b |
|
-> Maybe FileProgressCallback |
|
-> Maybe AsyncReadyCallback |
|
-> m () |
Saves asynchronously the buffer into the file.
See the AsyncResult
documentation to know how to use this function.
saveFinish
:: (HasCallStack, MonadIO m, IsFileSaver a, IsAsyncResult b) | |
=> a |
|
-> b |
|
-> m () | (Can throw |
Finishes a file saving started with [methodfileSaver
.save_async].
If the file has been saved successfully, the following [classfile
]
properties will be updated: the location, the encoding, the newline type and
the compression type.
Since the 3.20 version, textBufferSetModified
is called with False
if the file has been saved successfully.
setCompressionType
fileSaverSetCompressionType Source #
:: (HasCallStack, MonadIO m, IsFileSaver a) | |
=> a |
|
-> CompressionType |
|
-> m () |
Sets the compression type. By default the compression type is taken from the
File
.
setEncoding
:: (HasCallStack, MonadIO m, IsFileSaver a) | |
=> a |
|
-> Maybe Encoding |
|
-> m () |
setFlags
:: (HasCallStack, MonadIO m, IsFileSaver a) | |
=> a |
|
-> [FileSaverFlags] |
|
-> m () |
No description available in the introspection data.
setNewlineType
fileSaverSetNewlineType Source #
:: (HasCallStack, MonadIO m, IsFileSaver a) | |
=> a |
|
-> NewlineType |
|
-> m () |
Sets the newline type. By default the newline type is taken from the
File
.
Properties
buffer
constructFileSaverBuffer :: (IsFileSaver o, MonadIO m, IsBuffer a) => a -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “buffer
” property. This is rarely needed directly, but it is used by new
.
getFileSaverBuffer :: (MonadIO m, IsFileSaver o) => o -> m Buffer Source #
Get the value of the “buffer
” property.
When overloading is enabled, this is equivalent to
get
fileSaver #buffer
compressionType
The compression type.
constructFileSaverCompressionType :: (IsFileSaver o, MonadIO m) => CompressionType -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “compression-type
” property. This is rarely needed directly, but it is used by new
.
getFileSaverCompressionType :: (MonadIO m, IsFileSaver o) => o -> m CompressionType Source #
Get the value of the “compression-type
” property.
When overloading is enabled, this is equivalent to
get
fileSaver #compressionType
setFileSaverCompressionType :: (MonadIO m, IsFileSaver o) => o -> CompressionType -> m () Source #
Set the value of the “compression-type
” property.
When overloading is enabled, this is equivalent to
set
fileSaver [ #compressionType:=
value ]
encoding
The file's encoding.
clearFileSaverEncoding :: (MonadIO m, IsFileSaver o) => o -> m () Source #
Set the value of the “encoding
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#encoding
constructFileSaverEncoding :: (IsFileSaver o, MonadIO m) => Encoding -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “encoding
” property. This is rarely needed directly, but it is used by new
.
getFileSaverEncoding :: (MonadIO m, IsFileSaver o) => o -> m Encoding Source #
Get the value of the “encoding
” property.
When overloading is enabled, this is equivalent to
get
fileSaver #encoding
setFileSaverEncoding :: (MonadIO m, IsFileSaver o) => o -> Encoding -> m () Source #
Set the value of the “encoding
” property.
When overloading is enabled, this is equivalent to
set
fileSaver [ #encoding:=
value ]
file
constructFileSaverFile :: (IsFileSaver o, MonadIO m, IsFile a) => a -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “file
” property. This is rarely needed directly, but it is used by new
.
getFileSaverFile :: (MonadIO m, IsFileSaver o) => o -> m File Source #
Get the value of the “file
” property.
When overloading is enabled, this is equivalent to
get
fileSaver #file
flags
File saving flags.
constructFileSaverFlags :: (IsFileSaver o, MonadIO m) => [FileSaverFlags] -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “flags
” property. This is rarely needed directly, but it is used by new
.
getFileSaverFlags :: (MonadIO m, IsFileSaver o) => o -> m [FileSaverFlags] Source #
Get the value of the “flags
” property.
When overloading is enabled, this is equivalent to
get
fileSaver #flags
setFileSaverFlags :: (MonadIO m, IsFileSaver o) => o -> [FileSaverFlags] -> m () Source #
Set the value of the “flags
” property.
When overloading is enabled, this is equivalent to
set
fileSaver [ #flags:=
value ]
location
The File
where to save the buffer. By default the location is taken
from the File
at construction time.
constructFileSaverLocation :: (IsFileSaver o, MonadIO m, IsFile a) => a -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “location
” property. This is rarely needed directly, but it is used by new
.
getFileSaverLocation :: (MonadIO m, IsFileSaver o) => o -> m File Source #
Get the value of the “location
” property.
When overloading is enabled, this is equivalent to
get
fileSaver #location
newlineType
The newline type.
constructFileSaverNewlineType :: (IsFileSaver o, MonadIO m) => NewlineType -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “newline-type
” property. This is rarely needed directly, but it is used by new
.
getFileSaverNewlineType :: (MonadIO m, IsFileSaver o) => o -> m NewlineType Source #
Get the value of the “newline-type
” property.
When overloading is enabled, this is equivalent to
get
fileSaver #newlineType
setFileSaverNewlineType :: (MonadIO m, IsFileSaver o) => o -> NewlineType -> m () Source #
Set the value of the “newline-type
” property.
When overloading is enabled, this is equivalent to
set
fileSaver [ #newlineType:=
value ]