×
Namespaces

Variants
Actions
(Difference between revisions)

Checking whether a certain MIME type is supported on Symbian

From Nokia Developer Wiki
Jump to: navigation, search
hamishwillee (Talk | contribs)
m (Hamishwillee - Bot update - Merge KB into wiki)
hamishwillee (Talk | contribs)
 

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

[edit] 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.

[edit] MMP file

The following libraries are required:

LIBRARY apmime.lib    // TDataType
LIBRARY commonui.lib // CDocumentHandler

[edit] Header file

#include <DocumentHandler.h>
private:  // Data
CDocumentHandler* iDocHandler;

[edit] 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
}

[edit] Postconditions

The Document Handler API has queried whether the audio/basic MIME type is supported by the system.

This page was last modified on 13 June 2012, at 08:55.
60 page views in the last 30 days.