Namespaces
Variants
Actions
(Difference between revisions)

Checking whether a certain MIME type is supported on Symbian

Jump to: navigation, search
m
Line 2: Line 2:
 
__NOEDITSECTION__
 
__NOEDITSECTION__
 
{{KBCS}}
 
{{KBCS}}
{|style="background:#eceff2" width="660px" border="1" cellpadding="5" cellspacing="0"
+
{{CodeSnippet
|-
+
|id=CS001054
|'''ID''' || CS001054
+
|platform=S60 3rd Edition, FP1
|'''Creation date''' || July 1, 2008
+
|devices=Nokia N95 8GB
|-
+
|category=Symbian C++
|'''Platform''' || S60 3rd Edition, FP1
+
|subcategory=Files/Data
|'''Tested on devices''' || Nokia N95 8GB
+
|creationdate=July 1, 2008
|-
+
|keywords=CDocumentHandler, TDataType, CDocumentHandler::CanOpenL()
|'''Category''' || Symbian C++
+
}}
|'''Subcategory''' || Files/Data
+
|}
+
 
+
 
+
{|style="background:#eceff2" width="660px" border="1" cellpadding="5" cellspacing="0"
+
|-
+
|'''Keywords (APIs, classes, methods, functions):''' CDocumentHandler, TDataType, CDocumentHandler::CanOpenL()
+
|}
+
  
 
==Overview==
 
==Overview==

Revision as of 23:43, 13 October 2008


Template:KBCS

Article Metadata

Tested with
Devices(s): Nokia N95 8GB

Compatibility
Platform(s): S60 3rd Edition, FP1

Article
Keywords: CDocumentHandler, TDataType, CDocumentHandler::CanOpenL()
Created: (01 Jul 2008)
Last edited: extkbeditor1 (13 Oct 2008)

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.

102 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved