×
Namespaces

Variants
Actions
(Difference between revisions)

Checking whether a certain MIME type is supported on Symbian

From Nokia Developer Wiki
Jump to: navigation, search
Forum Nokia KB (Talk | contribs)
hamishwillee (Talk | contribs)
 
(6 intermediate revisions by 4 users not shown)
Line 1: Line 1:
__NOTOC__
+
{{ArticleMetaData <!-- v1.2 -->
__NOEDITSECTION__
+
|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]]) -->
{|style="background:#eceff2" width="660px" border="1" cellpadding="5" cellspacing="0"
+
|devices= Nokia N95 8GB
|-
+
|sdk= <!-- SDK(s) built and tested against (e.g. [http://linktosdkdownload/ Nokia Qt SDK 1.1]) -->
|'''ID''' || &nbsp;
+
|platform= S60 3rd Edition, FP1
|'''Creation date''' || June 9, 2008
+
|devicecompatability= <!-- Compatible devices (e.g.: All* (must have GPS) ) -->
|-
+
|dependencies= <!-- Any other/external dependencies e.g.: Google Maps Api v1.0 -->
|'''Platform''' || S60 3rd Edition, FP1
+
|signing= <!-- Empty or one of Self-Signed, DevCert, Manufacturer -->
|'''Tested on devices''' || Nokia N95 8GB
+
|capabilities= <!-- Capabilities required by the article/code example (e.g. Location, NetworkServices. -->
|-
+
|keywords= CDocumentHandler, TDataType, CDocumentHandler::CanOpenL()
|'''Category''' || Symbian C++
+
|language= <!-- Language category code for non-English topics - e.g. Lang-Chinese -->
|'''Subcategory''' || Files/Data
+
|translated-by= <!-- [[User:XXXX]] -->
|}
+
|translated-from-title= <!-- Title only -->
 
+
|translated-from-id= <!-- Id of translated revision -->
 
+
|review-by= <!-- After re-review: [[User:username]] -->
{|style="background:#eceff2" width="660px" border="1" cellpadding="5" cellspacing="0"
+
|review-timestamp= <!-- After re-review: YYYYMMDD -->
|-
+
|update-by= <!-- After significant update: [[User:username]]-->
|'''Keywords (APIs, classes, methods, functions):''' CDocumentHandler, TDataType, CDocumentHandler::CanOpenL()
+
|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 apmime.lib    // TDataType
+
LIBRARY apmime.lib    // TDataType
LIBRARY commonui.lib  // CDocumentHandler  
+
LIBRARY commonui.lib  // CDocumentHandler  
 
</code>
 
</code>
  
Line 82: Line 87:
 
==Postconditions==
 
==Postconditions==
  
The Document Handler API is queried whether the <tt>audio/basic</tt> MIME type is supported by the system.
+
The Document Handler API has queried whether the {{Icode|audio/basic}} MIME type is supported by the system.
  
[[Category:Symbian C++]][[Category:Code Examples]][[Category:Files/Data]]
+
[[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

[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.
95 page views in the last 30 days.
×