×
Namespaces

Variants
Actions
(Difference between revisions)

Checking whether a certain MIME type is supported on Symbian

From Nokia Developer Wiki
Jump to: navigation, search
tanjaluodes (Talk | contribs)
m
hamishwillee (Talk | contribs)
m (Hamishwillee - Bot change of template (Template:CodeSnippet) - now using Template:ArticleMetaData)
Line 2: Line 2:
 
__NOEDITSECTION__
 
__NOEDITSECTION__
 
{{KBCS}}
 
{{KBCS}}
{{CodeSnippet
+
{{ArticleMetaData
 
|id=CS001054
 
|id=CS001054
 
|platform=S60 3rd Edition, FP1
 
|platform=S60 3rd Edition, FP1
Line 10: Line 10:
 
|creationdate=July 1, 2008
 
|creationdate=July 1, 2008
 
|keywords=CDocumentHandler, TDataType, CDocumentHandler::CanOpenL()
 
|keywords=CDocumentHandler, TDataType, CDocumentHandler::CanOpenL()
 +
 +
|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]]) -->
 +
|sdk=<!-- SDK(s) built and tested against (e.g. [http://linktosdkdownload/ Nokia Qt SDK 1.1]) -->
 +
|devicecompatability=<!-- Compatible devices (e.g.: All* (must have GPS) ) -->
 +
|signing=<!-- Empty or one of Self-Signed, DevCert, Manufacturer -->
 +
|capabilities=<!-- Capabilities required (e.g. Location, NetworkServices. -->)
 +
|author=[[User:Tapla]]
 
}}
 
}}
  

Revision as of 11:30, 24 June 2011


Template:KBCS

Article Metadata
Tested with
Devices(s): Nokia N95 8GB
Compatibility
Platform(s): S60 3rd Edition, FP1
Platform Security
Capabilities: )
Article
Keywords: CDocumentHandler, TDataType, CDocumentHandler::CanOpenL()
Created: tapla (01 Jul 2008)
Last edited: hamishwillee (24 Jun 2011)

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.

81 page views in the last 30 days.
×