]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/mimetype.tex
Changed GetForce -> !CanVeto
[wxWidgets.git] / docs / latex / wx / mimetype.tex
CommitLineData
b13d92d1
VZ
1\section{\class{wxMimeTypesManager}}\label{wxmimetypesmanager}
2
3This class allows the application to retrieve the information about all known
4MIME types from a system-specific location and the filename extensions to the
5MIME types and vice versa. After initialization the functions
6\helpref{wxMimeTypesManager::GetFileTypeFromMimeType}{wxmimetypesmanagergetfiletypefrommimetype}
7and \helpref{wxMimeTypesManager::GetFileTypeFromExtension}{wxmimetypesmanagergetfiletypefromextension}
8may be called: they will return a \helpref{wxFileType}{wxfiletype} object which
9may be further queried for file description, icon and other attributes.
10
11{\bf Windows:} MIME type information is stored in the registry and no additional
12initialization is needed.
13
14{\bf Unix:} MIME type information is stored in the files mailcap and mime.types
15(system-wide) and .mailcap and .mime.types in the current user's home directory:
16all of these files are searched for and loaded if found by default. However,
17additional functions
18\helpref{wxMimeTypesManager::ReadMailcap}{wxmimetypesmanagerreadmailcap} and
19\helpref{wxMimeTypesManager::ReadMimeTypes}{wxmimetypesmanagerreadmimetypes} are
20provided to load additional files.
21
22NB: Currently, wxMimeTypesManager is limited to reading MIME type information
23but it will support modifying it as well in the future versions.
24
25\wxheading{Required headers}
26
2432b92d 27<wx/mimetype.h>
b13d92d1
VZ
28
29\wxheading{Derived from}
30
31No base class.
32
33\wxheading{See also}
34
35\helpref{wxFileType}{wxfiletype}
36
37\latexignore{\rtfignore{\wxheading{Function groups}}}
38
39\membersection{Constructor and destructor}
40
41NB: You won't normally need to use more than one wxMimeTypesManager object in a
42program.
43
44\helpref{wxMimeTypesManager}{wxmimetypesmanagerctor}\\
45\helpref{\destruct{wxMimeTypesManager}}{wxmimetypesmanagerdtor}
46
47\membersection{Query database}
48
2432b92d
JS
49These functions are the heart of this class: they allow to find a \helpref{file type}{wxfiletype} object
50from either file extension or MIME type.
b13d92d1 51If the function is successful, it returns a pointer to the wxFileType object
2432b92d 52which {\bf must} be deleted by the caller, otherwise NULL will be returned.
b13d92d1
VZ
53
54\helpref{GetFileTypeFromMimeType}{wxmimetypesmanagergetfiletypefrommimetype}\\
55\helpref{GetFileTypeFromExtension}{wxmimetypesmanagergetfiletypefromextension}
56
2432b92d 57\membersection{Initialization functions}\label{wxmimetypesmanagerinit}
b13d92d1 58
2432b92d
JS
59{\bf Unix:} These functions may be used to load additional files (except for the
60default ones which are loaded automatically) containing MIME
b13d92d1
VZ
61information in either mailcap(5) or mime.types(5) format.
62
63\helpref{ReadMailcap}{wxmimetypesmanagerreadmailcap}\\
64\helpref{ReadMimeTypes}{wxmimetypesmanagerreadmimetypes}
65
66%%%%% MEMBERS HERE %%%%%
67\helponly{\insertatlevel{2}{
68
69\wxheading{Members}
70
71}}
72
73\membersection{wxMimeTypesManager::wxMimeTypesManager}\label{wxmimetypesmanagerctor}
2432b92d 74
b13d92d1
VZ
75\func{}{wxMimeTypesManager}{\void}
76
77Constructor puts the object in the "working" state, no additional initialization
78are needed - but \helpref{ReadXXX}{wxmimetypesmanagerinit} may be used to load
79additional mailcap/mime.types files.
80
81\membersection{wxMimeTypesManager::\destruct{wxMimeTypesManager}}\label{wxmimetypesmanagerdtor}
2432b92d
JS
82
83\func{}{\destruct{wxMimeTypesManager}}{\void}
b13d92d1
VZ
84
85Destructor is not virtual, so this class should not be derived from.
86
87\membersection{wxMimeTypesManager::GetFileTypeFromExtension}\label{wxmimetypesmanagergetfiletypefromextension}
2432b92d
JS
88
89\func{wxFileType*}{GetFileTypeFromExtension}{\param{const wxString\&}{ extension}}
b13d92d1
VZ
90
91Gather information about the files with given extension and return the
92corresponding \helpref{wxFileType}{wxfiletype} object or NULL if the extension
93is unknown.
94
95\membersection{wxMimeTypesManager::GetFileTypeFromMimeType}\label{wxmimetypesmanagergetfiletypefrommimetype}
2432b92d
JS
96
97\func{wxFileType*}{GetFileTypeFromMimeType}{\param{const wxString\&}{ mimeType}}
b13d92d1
VZ
98
99Gather information about the files with given MIME type and return the
100corresponding \helpref{wxFileType}{wxfiletype} object or NULL if the MIME type
101is unknown.
102
103\membersection{wxMimeTypesManager::ReadMailcap}\label{wxmimetypesmanagerreadmailcap}
2432b92d
JS
104
105\func{void}{ReadMailcap}{\param{const wxString\&}{ filename}}
b13d92d1
VZ
106
107Load additional file containing information about MIME types and associated
108information in mailcap format. See metamail(1) and mailcap(5) for more
109information.
110
111\membersection{wxMimeTypesManager::ReadMimeTypes}\label{wxmimetypesmanagerreadmimetypes}
2432b92d
JS
112
113\func{void}{ReadMimeTypes}{\param{const wxString\&}{ filename}}
b13d92d1
VZ
114
115Load additional file containing information about MIME types and associated
116information in mime.types file format. See metamail(1) and mailcap(5) for more
117information.
2432b92d 118