Class sh::tools::filetypes::FileTypeManager¶
-
class
sh::tools::filetypes
::
FileTypeManager
: public QObject, public sh::base::Singleton¶ Utilities for dealing with file types.
It can determine the type of a file (png, plaintext, html, …), it can provide information about how to open them with an external program, and more.
For most tasks it uses a pluggable interface. Actual implementations of strategies for those tasks reside in separate classes in this namespace.
Public Functions
Determines the mimetype for one file.
Determines the mimetypes for a list of files.
Determines how to open a file with a given mimetype with an external program.
-
QList<std::shared_ptr<OpenMethod>>
getAllOpenMethods
()¶ Returns a list of all known infos how to open a file external programs.
This has roughly one entry for each installed program on the user’s system, which can graphically open files.
-
void
doInitialize
()¶ Executes singleton initialization.
-
void
doShutdown
()¶ Executes singleton shutdown.
-
void
shutdown
()¶ Shutdown down this singleton.
-
bool
isAlive
()¶ Returns if this singleton is alive (true until its shutdown begins).
Private Functions
-
FileTypeManager
(QObject *parent = 0)¶
Private Members
-
QList<std::shared_ptr<MimetypeDeterminationStrategy>>
_mimetypeDeterminationMethods
¶
-
QList<std::shared_ptr<OpenMethodDeterminationStrategy>>
_openMethodDeterminationMethods
¶
-
QList<std::shared_ptr<MimetypeInformationRetrievalStrategy>>
_mimetypeInformationRetrievalMethods
¶
-
QMutex
_mutex
¶
-
class
MimetypeDeterminationStrategy
¶ Abstract base class for a mimetype determination strategy.
Subclassed by sh::tools::filetypes::FreedesktopOrgToolsMimetypeDeterminationStrategy, sh::tools::filetypes::SuffixListMimetypeDeterminationStrategy, sh::tools::filetypes::UnixFileToolMimetypeDeterminationStrategy
-
class
MimetypeInformationRetrievalStrategy
¶ Abstract base class for mimetype information retrieval strategy.
Subclassed by sh::tools::filetypes::FreeDesktopOrgMimetypeInformationRetrievalStrategy
-
class
OpenMethodDeterminationStrategy
¶ Abstract base class for a ‘open method’ determination strategy.
Subclassed by sh::tools::filetypes::FreedesktopOrgToolsOpenMethodDeterminationStrategy, sh::tools::filetypes::UserDefinedOpenMethodDeterminationStrategy