×
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)
Forum Nokia KB (Talk | contribs)
Line 1: Line 1:
 
__NOTOC__
 
__NOTOC__
 
__NOEDITSECTION__
 
__NOEDITSECTION__
 
+
{{KBCS}}
 
{|style="background:#eceff2" width="660px" border="1" cellpadding="5" cellspacing="0"  
 
{|style="background:#eceff2" width="660px" border="1" cellpadding="5" cellspacing="0"  
 
|-
 
|-
|'''ID''' ||  
+
|'''ID''' || CS001054
|'''Creation date''' || June 9, 2008
+
|'''Creation date''' || July 1, 2008
 
|-
 
|-
 
|'''Platform''' || S60 3rd Edition, FP1
 
|'''Platform''' || S60 3rd Edition, FP1
Line 82: Line 82:
 
==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 <tt>audio/basic</tt> MIME type is supported by the system.
  
 
[[Category:Symbian C++]][[Category:Code Examples]][[Category:Files/Data]]
 
[[Category:Symbian C++]][[Category:Code Examples]][[Category:Files/Data]]

Revision as of 12:26, 1 July 2008


Template:KBCS

ID CS001054 Creation date July 1, 2008
Platform S60 3rd Edition, FP1 Tested on devices Nokia N95 8GB
Category Symbian C++ Subcategory Files/Data


Keywords (APIs, classes, methods, functions): CDocumentHandler, TDataType, CDocumentHandler::CanOpenL()

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.

67 page views in the last 30 days.
×