Querying for Parser Supported Formats

This tutorial describes how to query for parser supported formats.

Purpose

The purpose of this tutorial is to show you how to query MUF for parser supported formats and to check whether a format is supported.

Required Background

The Metadata Utility Library Overview introduces the metadata client utility.

Introduction

After constructing the CMetaDataClientUtility object, the client can query MUF for supported formats. MUF reads all the ECOM plug-in resource files and returns a list of supported parser types available in the system at request time. The client uses this function to know which media formats are supported by the framework.

If the client knows the MIME type of a format, then the client can use the MIME type to check whether a particular format is supported or not.

Using Supported Formats

The following tasks will be covered in this tutorial:

  • Query for parser supported formats

  • Check if a format is supported

Basic Procedure

The high level steps to query parser supported formats are shown here:

  1. Create a new metadata utility object.

  2. Call CMetaDataClientUtility::SupportedFormatsL() to retrieve the list of supported formats.

    IMPORT_C const RPointerArray<CMUFParserType>& SupportedFormatsL();

    This method returns an array of parser supported formats.

The high level steps to check a format is supported are shown here:

  1. Create a new metadata utility object.

  2. Call CMetaDataClientUtility::FormatSupported() and set aMimeType to the MIME type of the format you want to check is supported.

    IMPORT_C TBool FormatSupported(const TDesC8& aMimeType);

    If the provided format type is supported, then the method returns ETrue.

Example

//Create a new utility object (utility)

utility->SupportedFormatsL() //Get the list of supported formats

utility->FormatSupported(image/jpeg) //Check if jpeg format is supported