Checking whether a certain MIME type is supported on Symbian
(New page: __NOTOC__ __NOEDITSECTION__ {|style="background:#eceff2" width="660px" border="1" cellpadding="5" cellspacing="0" |- |'''ID''' || |'''Creation date''' || June 9, 2008 |- |'''Platf...) |
hamishwillee
(Talk | contribs) m (moved CS001054 - Checking whether a certain MIME type is supported to Checking whether a certain MIME type is supported on Symbian) |
||
| (8 intermediate revisions by 4 users not shown) | |||
| Line 1: | Line 1: | ||
| − | + | {{ArticleMetaData <!-- v1.2 --> | |
| − | + | |sourcecode= <!-- Link to example source code (e.g. [[Media:The Code Example ZIP.zip]]) --> | |
| − | + | |installfile= <!-- Link to installation file (e.g. [[Media:The Installation File.sis]]) --> | |
| − | {| | + | |devices= Nokia N95 8GB |
| − | |- | + | |sdk= <!-- SDK(s) built and tested against (e.g. [http://linktosdkdownload/ Nokia Qt SDK 1.1]) --> |
| − | | | + | |platform= S60 3rd Edition, FP1 |
| − | + | |devicecompatability= <!-- Compatible devices (e.g.: All* (must have GPS) ) --> | |
| − | |- | + | |dependencies= <!-- Any other/external dependencies e.g.: Google Maps Api v1.0 --> |
| − | | | + | |signing= <!-- Empty or one of Self-Signed, DevCert, Manufacturer --> |
| − | | | + | |capabilities= <!-- Capabilities required by the article/code example (e.g. Location, NetworkServices. --> |
| − | |- | + | |keywords= CDocumentHandler, TDataType, CDocumentHandler::CanOpenL() |
| − | | | + | |language= <!-- Language category code for non-English topics - e.g. Lang-Chinese --> |
| − | | | + | |translated-by= <!-- [[User:XXXX]] --> |
| − | | | + | |translated-from-title= <!-- Title only --> |
| − | + | |translated-from-id= <!-- Id of translated revision --> | |
| − | + | |review-by= <!-- After re-review: [[User:username]] --> | |
| − | + | |review-timestamp= <!-- After re-review: YYYYMMDD --> | |
| − | |- | + | |update-by= <!-- After significant update: [[User:username]]--> |
| − | | | + | |update-timestamp= <!-- After significant update: YYYYMMDD --> |
| − | |} | + | |creationdate= 20080609 |
| + | |author= [[User:Tapla]] | ||
| + | <!-- The following are not in current metadata --> | ||
| + | |subcategory= Files/Data | ||
| + | |id= CS001054 | ||
| + | }} | ||
==Overview== | ==Overview== | ||
| Line 31: | Line 36: | ||
<code> | <code> | ||
| − | LIBRARY | + | LIBRARY apmime.lib // TDataType |
| − | LIBRARY | + | LIBRARY commonui.lib // CDocumentHandler |
</code> | </code> | ||
| Line 82: | Line 87: | ||
==Postconditions== | ==Postconditions== | ||
| − | The Document Handler API | + | The Document Handler API has queried whether the {{Icode|audio/basic}} MIME type is supported by the system. |
| − | [[Category:Symbian C++]][[Category:Code | + | [[Category:Symbian C++]][[Category:Code Snippet]][[Category:Files/Data]][[Category:Code Snippet]] |
Latest revision as of 08:55, 13 June 2012
Article Metadata
Tested with
Devices(s): Nokia N95 8GB
Compatibility
Platform(s): S60 3rd Edition, FP1
Article
Keywords: CDocumentHandler, TDataType, CDocumentHandler::CanOpenL()
Created: tapla
(09 Jun 2008)
Last edited: hamishwillee
(13 Jun 2012)
Contents |
Overview
This code snippet demonstrates how to use the Document Handler API for querying whether the system supports a certain MIME type.
This snippet can be self-signed.
MMP file
The following libraries are required:
LIBRARY apmime.lib // TDataType
LIBRARY commonui.lib // CDocumentHandler
Header file
#include <DocumentHandler.h>private: // Data
CDocumentHandler* iDocHandler;
Source file
#include <DocumentHandler.h>iDocHandler = CDocumentHandler::NewL(CEikonEnv::Static()->Process());
_LIT8(KAudioBasicMimeType, "audio/basic");
TDataType audioDataType(KAudioBasicMimeType);
TBool result = EFalse;
TRAPD(err, result = iDocHandler->CanOpenL(audioDataType));
if (err == KMimeNotSupported)
{
// MIME type is not supported
}
else if (result && !err)
{
// Basic audio can be handled
}
else if (!result && !err)
{
// Basic audio cannot be handled
}
else
{
// Some other error
}
Postconditions
The Document Handler API has queried whether the audio/basic MIME type is supported by the system.

