⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mimetype.tex

📁 很牛的GUI源码wxWidgets-2.8.0.zip 可在多种平台下运行.
💻 TEX
字号:
\section{\class{wxMimeTypesManager}}\label{wxmimetypesmanager}This class allows the application to retrieve the information about all knownMIME types from a system-specific location and the filename extensions to theMIME types and vice versa. After initialization the functions\helpref{wxMimeTypesManager::GetFileTypeFromMimeType}{wxmimetypesmanagergetfiletypefrommimetype} and \helpref{wxMimeTypesManager::GetFileTypeFromExtension}{wxmimetypesmanagergetfiletypefromextension} may be called: they will return a \helpref{wxFileType}{wxfiletype} object whichmay be further queried for file description, icon and other attributes.{\bf Windows:} MIME type information is stored in the registry and no additionalinitialization is needed.{\bf Unix:} MIME type information is stored in the files mailcap and mime.types(system-wide) and .mailcap and .mime.types in the current user's home directory:all of these files are searched for and loaded if found by default. However,additional functions \helpref{wxMimeTypesManager::ReadMailcap}{wxmimetypesmanagerreadmailcap} and \helpref{wxMimeTypesManager::ReadMimeTypes}{wxmimetypesmanagerreadmimetypes} areprovided to load additional files.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 informationbut it will support modifying it as well in future versions.\wxheading{Global objects}Global instance of wxMimeTypesManager is always available. It is definedas follows:\begin{verbatim}wxMimeTypesManager *wxTheMimeTypesManager;\end{verbatim}It is recommended to use this instance instead of creating your own becausegathering MIME information may take quite a long time on Unix systems.\wxheading{Derived from}No base class.\wxheading{Include files}<wx/mimetype.h>\wxheading{See also}\helpref{wxFileType}{wxfiletype}\latexignore{\rtfignore{\wxheading{Function groups}}}\membersection{Helper functions}\label{mimehelperfunctions}All of these functions are static (i.e. don't need a wxMimeTypesManager objectto call them) and provide some useful operations for string representations ofMIME types. Their usage is recommended instead of directly working with MIMEtypes using wxString functions.\helpref{IsOfType}{wxmimetypesmanagerisoftype}\membersection{Constructor and destructor}\label{mimeconstructordestructor}NB: You won't normally need to use more than one wxMimeTypesManager object in aprogram.\helpref{wxMimeTypesManager}{wxmimetypesmanagerctor}\\\helpref{\destruct{wxMimeTypesManager}}{wxmimetypesmanagerdtor}\membersection{Query database}\label{mimequerydatabase}These functions are the heart of this class: they allow to find a \helpref{file type}{wxfiletype} objectfrom either file extension or MIME type.If the function is successful, it returns a pointer to the wxFileType objectwhich {\bf must} be deleted by the caller, otherwise NULL will be returned.\helpref{GetFileTypeFromMimeType}{wxmimetypesmanagergetfiletypefrommimetype}\\\helpref{GetFileTypeFromExtension}{wxmimetypesmanagergetfiletypefromextension}\membersection{Initialization functions}\label{wxmimetypesmanagerinit}{\bf Unix:} These functions may be used to load additional files (except for thedefault ones which are loaded automatically) containing MIMEinformation in either mailcap(5) or mime.types(5) format.\helpref{ReadMailcap}{wxmimetypesmanagerreadmailcap}\\\helpref{ReadMimeTypes}{wxmimetypesmanagerreadmimetypes}\\\helpref{AddFallbacks}{wxmimetypesmanageraddfallbacks}%%%%% MEMBERS HERE %%%%%\helponly{\insertatlevel{2}{\wxheading{Members}}}\membersection{wxMimeTypesManager::wxMimeTypesManager}\label{wxmimetypesmanagerctor}\func{}{wxMimeTypesManager}{\void}Constructor puts the object in the "working" state, no additional initializationare needed - but \helpref{ReadXXX}{wxmimetypesmanagerinit} may be used to loadadditional mailcap/mime.types files.\membersection{wxMimeTypesManager::\destruct{wxMimeTypesManager}}\label{wxmimetypesmanagerdtor}\func{}{\destruct{wxMimeTypesManager}}{\void}Destructor is not virtual, so this class should not be derived from.\membersection{wxMimeTypesManager::AddFallbacks}\label{wxmimetypesmanageraddfallbacks}\func{void}{AddFallbacks}{\param{const wxFileTypeInfo *}{fallbacks}}This function may be used to provide hard-wired fallbacks for the MIME typesand extensions that might not be present in the system MIME database.% TODOPlease see the typetest sample for an example of using it.\membersection{wxMimeTypesManager::GetFileTypeFromExtension}\label{wxmimetypesmanagergetfiletypefromextension}\func{wxFileType*}{GetFileTypeFromExtension}{\param{const wxString\&}{ extension}}Gather information about the files with given extension and return thecorresponding \helpref{wxFileType}{wxfiletype} object or NULL if the extensionis unknown.\membersection{wxMimeTypesManager::GetFileTypeFromMimeType}\label{wxmimetypesmanagergetfiletypefrommimetype}\func{wxFileType*}{GetFileTypeFromMimeType}{\param{const wxString\&}{ mimeType}}Gather information about the files with given MIME type and return thecorresponding \helpref{wxFileType}{wxfiletype} object or NULL if the MIME typeis unknown.\membersection{wxMimeTypesManager::IsOfType}\label{wxmimetypesmanagerisoftype}\func{bool}{IsOfType}{\param{const wxString\&}{ mimeType}, \param{const wxString\&}{ wildcard}}This function returns true if either the given {\it mimeType} is exactly thesame as {\it wildcard} or if it has the same category and the subtype of{\it wildcard} is '*'. Note that the '*' wildcard is not allowed in{\it mimeType} itself.The comparison don by this function is case insensitive so it is notnecessary to convert the strings to the same case before calling it.\membersection{wxMimeTypesManager::ReadMailcap}\label{wxmimetypesmanagerreadmailcap}\func{bool}{ReadMailcap}{\param{const wxString\&}{ filename}, \param{bool}{ fallback = false}}Load additional file containing information about MIME types and associatedinformation in mailcap format. See metamail(1) and mailcap(5) for moreinformation.{\it fallback} parameter may be used to load additional mailcap files withoutoverriding the settings found in the standard files: normally, entries fromfiles loaded with ReadMailcap will override the entries from files loadedpreviously (and the standard ones are loaded in the very beginning), but thiswill not happen if this parameter is set to true (default is false).The return value is true if there were no errors in the file or falseotherwise.\membersection{wxMimeTypesManager::ReadMimeTypes}\label{wxmimetypesmanagerreadmimetypes}\func{bool}{ReadMimeTypes}{\param{const wxString\&}{ filename}}Load additional file containing information about MIME types and associatedinformation in mime.types file format. See metamail(1) and mailcap(5) for moreinformation.The return value is true if there were no errors in the file or falseotherwise.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -