gio-0.12.4: Binding to the GIO.

Portabilityportable (depends on GHC)
Stabilityalpha
Maintainergtk2hs-devel@lists.sourceforge.net
Safe HaskellNone

System.GIO.File.ContentType

Contents

Description

 

Synopsis

Details

A content type is a platform specific string that defines the type of a file. On 1 it is a mime type, on win32 it is an extension string like .doc, .txt or a percieved string like audio. Such strings can be looked up in the registry at HkeyClassesRoot.

Methods

contentTypeEqualsSource

Arguments

:: String 
-> String 
-> Bool

returns True if the two strings are identical or equivalent, False otherwise.

Compares two content types for equality.

contentTypeIsASource

Arguments

:: String 
-> String 
-> Bool

returns True if type is a kind of supertype, False otherwise.

Determines if type is a subset of supertype.

contentTypeIsUnknownSource

Arguments

:: String 
-> Bool

returns True if the type is the unknown type.

Checks if the content type is the generic unknown type. On 1 this is the application/octet-stream mimetype, while on win32 it is "*".

contentTypeGetDescriptionSource

Arguments

:: String 
-> String

returns a short description of the content type type.

Gets the human readable description of the content type.

contentTypeGetMimeTypeSource

Arguments

:: String 
-> String

returns the registered mime-type for the given type, or Nothing if unknown.

Gets the mime-type for the content type. If one is registered

contentTypeGetIconSource

Arguments

:: String 
-> Icon

returns Icon corresponding to the content type.

Gets the icon for a content type.

contentTypeCanBeExecutableSource

Arguments

:: String 
-> Bool

returns True if the file type corresponds to a type that can be executable, False otherwise.

Checks if a content type can be executable. Note that for instance things like text files can be executables (i.e. scripts and batch files).

contentTypeFromMimeTypeSource

Arguments

:: String

mimeType a mime type string.

-> String 

Tries to find a content type based on the mime type name.

contentTypeGuessSource

Arguments

:: String 
-> String

data a stream of data,

-> Int

dataSize the size of data

-> IO (Bool, String)

returns a string indicating a guessed content type for the given data.

Guesses the content type based on example data. If the function is uncertain, resultUncertain will be set to True. Either filename or data may be Nothing, in which case the guess will be based solely on the other argument.

contentTypeGuessForTreeSource

Arguments

:: FileClass file 
=> file

root the root of the tree to guess a type for

-> IO [String]

returns a list of possible content types

Tries to guess the type of the tree with root root, by looking at the files it contains. The result is an array of content types, with the best guess coming first.

The types returned all have the form x-contentfoo, e.g. x-contentaudio-cdda (for audio CDs) or x-content/image-dcf (for a camera memory card). See the shared-mime-info specification for more on x-content types.

This function is useful in the implementation of mountGuessContentType.

contentTypesGetRegisteredSource

Arguments

:: IO [String]

returns GList of the registered content types.

Gets a list of strings containing all the registered content types known to the system.