×
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)
hamishwillee (Talk | contribs)
m (Hamishwillee - Bot update - Merge KB into wiki)
Line 1: Line 1:
__NOTOC__
+
{{ArticleMetaData <!-- v1.2 -->
__NOEDITSECTION__
+
{{KBCS}}
+
{{ArticleMetaData
+
|id=CS001054
+
|platform=S60 3rd Edition, FP1
+
|devices=Nokia N95 8GB
+
|category=Symbian C++
+
|subcategory=Files/Data
+
|creationdate=July 1, 2008
+
|keywords=CDocumentHandler, TDataType, CDocumentHandler::CanOpenL()
+
 
+
 
|sourcecode= <!-- Link to example source code (e.g. [[Media:The Code Example ZIP.zip]]) -->
 
|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]]) -->
 
|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]) -->
+
|devices= Nokia N95 8GB
|devicecompatability=<!-- Compatible devices (e.g.: All* (must have GPS) ) -->
+
|sdk= <!-- SDK(s) built and tested against (e.g. [http://linktosdkdownload/ Nokia Qt SDK 1.1]) -->
|signing=<!-- Empty or one of Self-Signed, DevCert, Manufacturer -->
+
|platform= S60 3rd Edition, FP1
|capabilities=<!-- Capabilities required (e.g. Location, NetworkServices. -->)
+
|devicecompatability= <!-- Compatible devices (e.g.: All* (must have GPS) ) -->
|author=[[User:Tapla]]
+
|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
 
}}
 
}}
  
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 has 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:Code Snippet]]
+
[[Category:Symbian C++]][[Category:Code Snippet]][[Category:Files/Data]][[Category:Code Snippet]]

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.

74 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×