If GNOME or KDE desktop environment is installed, then wxMimeTypesManager
gathers MIME information from respective files (e.g. .kdelnk files under KDE).
- NB: Currently, wxMimeTypesManager is limited to reading MIME type information
+ @note Currently, wxMimeTypesManager is limited to reading MIME type information
but it will support modifying it as well in future versions.
@library{wxbase}
void AddFallbacks(const wxFileTypeInfo* fallbacks);
/**
- NB: You won't normally need to use more than one wxMimeTypesManager object in a
+ @note You won't normally need to use more than one wxMimeTypesManager object in a
program.
@ref ctor() wxMimeTypesManager
-
+
@ref dtor() ~wxMimeTypesManager
*/
default ones which are loaded automatically) containing MIME
information in either mailcap(5) or mime.types(5) format.
ReadMailcap()
-
+
ReadMimeTypes()
-
+
AddFallbacks()
*/
If the function is successful, it returns a pointer to the wxFileType object
which @b must be deleted by the caller, otherwise @NULL will be returned.
GetFileTypeFromMimeType()
-
+
GetFileTypeFromExtension()
*/
usage but may be also used by the application directly if, for example, you want
to use some non-default command to open the file.
The function replaces all occurrences of
-
+
format specification
-
+
with
-
+
%s
-
+
the full file name
-
+
%t
-
+
the MIME type
-
+
%{param}
-
+
the value of the parameter @e param
-
+
using the MessageParameters object you pass to it.
If there is no '%s' in the command string (and the string is not empty), it is
assumed that the command reads the data on stdin and so the effect is the same
there are no other parameters. If you wish to supply additional parameters, you
must derive your own class from MessageParameters and override GetParamValue()
function, for example:
-
+
Now you only need to create an object of this class and pass it to, for example,
GetOpenCommand() like this:
-
+
@b Windows: As only the file name is used by the program associated with the
given extension anyhow (but no other message parameters), there is no need to
ever derive from MessageParameters class for a Windows-only program.