mimeapps

Finding associations between MIME types and applications.

Public Imports

desktopfile.file
public import desktopfile.file;
Undocumented in source.

Members

Classes

DesktopFileProvider
class DesktopFileProvider

Implementation of simple desktop file provider.

MimeAppsGroup
class MimeAppsGroup

inilike.file.IniLikeGroup subclass for easy access to the list of applications associated with given type.

MimeAppsListFile
class MimeAppsListFile

Class represenation of single mimeapps.list file containing information about MIME type associations and default applications.

MimeInfoCacheFile
class MimeInfoCacheFile

Class represenation of single mimeinfo.cache file containing information about MIME type associations. Note: Unlike MimeAppsListFile this class does not provide functions for associations update. This is because mimeinfo.cache files should be updated by update-desktop-database utility from desktop-file-utils.

Functions

distributionMimeAppsListPaths
string[] distributionMimeAppsListPaths()

Find mimeapps.list files locations for distribution provided defaults including specific for the current desktop. Found paths are not checked for existence.

distributionMimeAppsListPaths
string[] distributionMimeAppsListPaths(string[] desktopPrefixes)

ditto, but using user-provided desktop prefixes (can be empty, in which case desktop-specific mimeapps.list locations are not included).

findAssociatedApplications
const(DesktopFile)[] findAssociatedApplications(string mimeType, ListRange mimeAppsListFiles, CacheRange mimeInfoCacheFiles, IDesktopFileProvider desktopFileProvider)

Find associated applications for given MIME type.

findDefaultApplication
const(DesktopFile) findDefaultApplication(string mimeType, ListRange mimeAppsListFiles, CacheRange mimeInfoCacheFiles, IDesktopFileProvider desktopFileProvider)

Find default application for given MIME type.

findKnownAssociatedApplications
const(DesktopFile)[] findKnownAssociatedApplications(string mimeType, ListRange mimeAppsListFiles, CacheRange mimeInfoCacheFiles, IDesktopFileProvider desktopFileProvider)

Find all known associated applications for given MIME type, including explicitly removed by user.

getDesktopPrefixes
auto getDesktopPrefixes()

Get desktop prefixes for mimeapps.list overrides.

listAssociatedApplications
string[] listAssociatedApplications(string mimeType, ListRange mimeAppsListFiles, CacheRange mimeInfoCacheFiles)

List associated applications for given MIME type.

listDefaultApplications
string[] listDefaultApplications(string mimeType, ListRange mimeAppsListFiles)

List explicitily set default applications for given MIME type.

listKnownAssociatedApplications
string[] listKnownAssociatedApplications(string mimeType, ListRange mimeAppsListFiles, CacheRange mimeInfoCacheFiles)

List all known associated applications for given MIME type, including explicitly removed by user.

mimeAppsListFiles
MimeAppsListFile[] mimeAppsListFiles(const(string)[] paths)

Create MimeAppsListFile objects for paths.

mimeAppsListFiles
MimeAppsListFile[] mimeAppsListFiles()

ditto, but automatically read MimeAppsListFile objects from determined system paths.

mimeAppsListPaths
string[] mimeAppsListPaths()

Find all known mimeapps.list files locations. Found paths are not checked for existence.

mimeAppsListPaths
string[] mimeAppsListPaths(string[] desktopPrefixes)

ditto, but using user-provided desktop prefixes (can be empty, in which case desktop-specific mimeapps.list locations are not included).

mimeInfoCacheFiles
MimeInfoCacheFile[] mimeInfoCacheFiles(const(string)[] paths)

Create MimeInfoCacheFile objects for paths.

mimeInfoCacheFiles
MimeInfoCacheFile[] mimeInfoCacheFiles()

ditto, but automatically read MimeInfoCacheFile objects from determined system paths.

mimeInfoCachePaths
string[] mimeInfoCachePaths()

Find all known mimeinfo.cache files locations. Found paths are not checked for existence.

updateAssociations
void updateAssociations(string fileName, AssociationUpdateQuery query)

Apply query for file with fileName. This should be mimeapps.list file. If file does not exist it will be created.

updateAssociations
void updateAssociations(AssociationUpdateQuery query)

Change MIME Applications Associations for the current user by applying the provided query.

userAppDataMimeAppsListPaths
string[] userAppDataMimeAppsListPaths()

Find mimeapps.list files deprecated locations for user overrides including specific for the current desktop. Found paths are not checked for existence or write access. These locations are kept for compatibility.

userAppDataMimeAppsListPaths
string[] userAppDataMimeAppsListPaths(string[] desktopPrefixes)

ditto, but using user-provided desktop prefixes (can be empty, in which case desktop-specific mimeapps.list locations are not included).

userMimeAppsListPaths
string[] userMimeAppsListPaths()

Find mimeapps.list files locations for user overrides including specific for the current desktop. Found paths are not checked for existence or write access.

userMimeAppsListPaths
string[] userMimeAppsListPaths(string[] desktopPrefixes)

ditto, but using user-provided desktop prefixes (can be empty, in which case desktop-specific mimeapps.list locations are not included).

vendorMimeAppsListPaths
string[] vendorMimeAppsListPaths()

Find mimeapps.list files locations for sysadmin and ISV overrides including specific for the current desktop. Found paths are not checked for existence.

vendorMimeAppsListPaths
string[] vendorMimeAppsListPaths(string[] desktopPrefixes)

ditto, but using user-provided desktop prefixes (can be empty, in which case desktop-specific mimeapps.list locations are not included).

writableMimeAppsListPaths
deprecated string[] writableMimeAppsListPaths()

Find all writable mimeapps.list files locations including specific for the current desktop. Found paths are not checked for existence or write access.

writableMimeAppsListPaths
deprecated string[] writableMimeAppsListPaths(string[] desktopPrefixes)

ditto, but using user-provided prefix.

Interfaces

IDesktopFileProvider
interface IDesktopFileProvider

Interface for desktop file provider.

Structs

AssociationUpdateQuery
struct AssociationUpdateQuery

Struct used for construction of file assocation update query. This allows to reuse the same query many times or for many mimeapps.list files.

EnvGuard
struct EnvGuard
Undocumented in source.

See Also

Meta