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 |
On-disk representation of a [classbuffer
].
A GtkSourceFile
object is the on-disk representation of a [classbuffer
].
With a GtkSourceFile
, you can create and configure a [classfileLoader
]
and [classfileSaver
] which take by default the values of the
GtkSourceFile
properties (except for the file loader which auto-detect some
properties). On a successful load or save operation, the GtkSourceFile
properties are updated. If an operation fails, the GtkSourceFile
properties
have still the previous valid values.
Synopsis
- newtype File = File (ManagedPtr File)
- class (GObject o, IsDescendantOf File o) => IsFile o
- toFile :: (MonadIO m, IsFile o) => o -> m File
- fileCheckFileOnDisk :: (HasCallStack, MonadIO m, IsFile a) => a -> m ()
- fileGetCompressionType :: (HasCallStack, MonadIO m, IsFile a) => a -> m CompressionType
- fileGetEncoding :: (HasCallStack, MonadIO m, IsFile a) => a -> m Encoding
- fileGetLocation :: (HasCallStack, MonadIO m, IsFile a) => a -> m File
- fileGetNewlineType :: (HasCallStack, MonadIO m, IsFile a) => a -> m NewlineType
- fileIsDeleted :: (HasCallStack, MonadIO m, IsFile a) => a -> m Bool
- fileIsExternallyModified :: (HasCallStack, MonadIO m, IsFile a) => a -> m Bool
- fileIsLocal :: (HasCallStack, MonadIO m, IsFile a) => a -> m Bool
- fileIsReadonly :: (HasCallStack, MonadIO m, IsFile a) => a -> m Bool
- fileNew :: (HasCallStack, MonadIO m) => m File
- fileSetLocation :: (HasCallStack, MonadIO m, IsFile a, IsFile b) => a -> Maybe b -> m ()
- getFileCompressionType :: (MonadIO m, IsFile o) => o -> m CompressionType
- getFileEncoding :: (MonadIO m, IsFile o) => o -> m Encoding
- clearFileLocation :: (MonadIO m, IsFile o) => o -> m ()
- constructFileLocation :: (IsFile o, MonadIO m, IsFile a) => a -> m (GValueConstruct o)
- getFileLocation :: (MonadIO m, IsFile o) => o -> m File
- setFileLocation :: (MonadIO m, IsFile o, IsFile a) => o -> a -> m ()
- getFileNewlineType :: (MonadIO m, IsFile o) => o -> m NewlineType
- getFileReadOnly :: (MonadIO m, IsFile o) => o -> m Bool
Exported types
Memory-managed wrapper type.
Instances
Eq File Source # | |
GObject File Source # | |
Defined in GI.GtkSource.Objects.File | |
ManagedPtrNewtype File Source # | |
Defined in GI.GtkSource.Objects.File toManagedPtr :: File -> ManagedPtr File | |
TypedObject File Source # | |
Defined in GI.GtkSource.Objects.File | |
HasParentTypes File Source # | |
Defined in GI.GtkSource.Objects.File | |
IsGValue (Maybe File) Source # | Convert |
Defined in GI.GtkSource.Objects.File gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe File -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe File) | |
type ParentTypes File Source # | |
Defined in GI.GtkSource.Objects.File type ParentTypes File = '[Object] |
class (GObject o, IsDescendantOf File o) => IsFile o Source #
Instances
(GObject o, IsDescendantOf File o) => IsFile o Source # | |
Defined in GI.GtkSource.Objects.File |
Methods
Click to display all available methods, including inherited ones
Methods
bindProperty, bindPropertyFull, checkFileOnDisk, forceFloating, freezeNotify, getv, isDeleted, isExternallyModified, isFloating, isLocal, isReadonly, notify, notifyByPspec, ref, refSink, runDispose, stealData, stealQdata, thawNotify, unref, watchClosure.
Getters
getCompressionType, getData, getEncoding, getLocation, getNewlineType, getProperty, getQdata.
Setters
checkFileOnDisk
:: (HasCallStack, MonadIO m, IsFile a) | |
=> a |
|
-> m () |
Checks synchronously the file on disk, to know whether the file is externally modified, or has been deleted, and whether the file is read-only.
File
doesn't create a FileMonitor
to track those properties, so
this function needs to be called instead. Creating lots of FileMonitor
's
would take lots of resources.
Since this function is synchronous, it is advised to call it only on local
files. See [methodfile
.is_local].
getCompressionType
fileGetCompressionType Source #
:: (HasCallStack, MonadIO m, IsFile a) | |
=> a |
|
-> m CompressionType | Returns: the compression type. |
No description available in the introspection data.
getEncoding
:: (HasCallStack, MonadIO m, IsFile a) | |
=> a |
|
-> m Encoding | Returns: the character encoding. |
getLocation
:: (HasCallStack, MonadIO m, IsFile a) | |
=> a |
|
-> m File | Returns: the |
No description available in the introspection data.
getNewlineType
:: (HasCallStack, MonadIO m, IsFile a) | |
=> a |
|
-> m NewlineType | Returns: the newline type. |
No description available in the introspection data.
isDeleted
:: (HasCallStack, MonadIO m, IsFile a) | |
=> a |
|
-> m Bool | Returns: whether the file has been deleted. |
isExternallyModified
fileIsExternallyModified Source #
:: (HasCallStack, MonadIO m, IsFile a) | |
=> a |
|
-> m Bool | Returns: whether the file is externally modified. |
isLocal
:: (HasCallStack, MonadIO m, IsFile a) | |
=> a |
|
-> m Bool | Returns: whether the file is local. |
isReadonly
:: (HasCallStack, MonadIO m, IsFile a) | |
=> a |
|
-> m Bool | Returns: whether the file is read-only. |
new
:: (HasCallStack, MonadIO m) | |
=> m File | Returns: a new |
No description available in the introspection data.
setLocation
:: (HasCallStack, MonadIO m, IsFile a, IsFile b) | |
=> a |
|
-> Maybe b | |
-> m () |
Sets the location.
Properties
compressionType
The compression type.
getFileCompressionType :: (MonadIO m, IsFile o) => o -> m CompressionType Source #
Get the value of the “compression-type
” property.
When overloading is enabled, this is equivalent to
get
file #compressionType
encoding
The character encoding, initially Nothing
. After a successful file
loading or saving operation, the encoding is non-Nothing
.
getFileEncoding :: (MonadIO m, IsFile o) => o -> m Encoding Source #
Get the value of the “encoding
” property.
When overloading is enabled, this is equivalent to
get
file #encoding
location
The location.
clearFileLocation :: (MonadIO m, IsFile o) => o -> m () Source #
Set the value of the “location
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#location
constructFileLocation :: (IsFile 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
.
getFileLocation :: (MonadIO m, IsFile o) => o -> m File Source #
Get the value of the “location
” property.
When overloading is enabled, this is equivalent to
get
file #location
setFileLocation :: (MonadIO m, IsFile o, IsFile a) => o -> a -> m () Source #
Set the value of the “location
” property.
When overloading is enabled, this is equivalent to
set
file [ #location:=
value ]
newlineType
The line ending type.
getFileNewlineType :: (MonadIO m, IsFile o) => o -> m NewlineType Source #
Get the value of the “newline-type
” property.
When overloading is enabled, this is equivalent to
get
file #newlineType
readOnly
Whether the file is read-only or not. The value of this property is not updated automatically (there is no file monitors).
getFileReadOnly :: (MonadIO m, IsFile o) => o -> m Bool Source #
Get the value of the “read-only
” property.
When overloading is enabled, this is equivalent to
get
file #readOnly