You Are Here:

Community: Wiki

This page was last modified on 27 May 2009, at 09:24.

Recognizers

From Forum Nokia Wiki


Contents

Description

Plug-in code that can examine sample data, and return, if recognized, its data type. A data type is also commonly known as a MIME type.

The plug-in recognizer architecture allows additional data recognizers to be created and added.


Loading

Before Symbian OS v9.1, data recognizers were plug-in DLLs with a .mdl extension and a UID2 of 0x10003A19. They were located in the \System\Recogs\ folder on any drive.

In Symbian OS v9.1 and onwards, recognizers are ECOM plugins, located under \sys\bin\. Each ECOM data recognizer is loaded by the application architecture (apparc) during the OS startup sequence.


Handling the Data

After a recognizer has been selected, apparc attempts to find the application that can best handle the selected data type. And it is not guaranteed that an application will be available to handle a data type, even if it was successfully recognized.


Recognizers List

The recognizer framework maintains an up to date list of all data recognizers that exist in the system. The list is ordered by recognizer priority.


FrameWork

CApaDataRecognizer is an internal class that represents the recognizer framework.Although CApaDataRecognizer is internal, clients can access most of its properties through the RApaLsSession API.

class CApaDataRecognizerType : public CBase;


Interface

All recognizers must implement CApaDataRecognizerType::DoRecognizeL(). This is the function that is called to do the data recognition. It is not pure virtual, but the implementation in CApaDataRecognizerType does not do anything apart from setting CApaDataRecognizerType::iDataType to a default value. Implementations should set iDataType to the MIME type it considers the data to belong to and iConfidence to indicate how confident it is. The decision is based on the two parameters, aName and aBuffer.

The following code recognizes with maximum confidence the word "example" contained in files with a .example extension.

void CExampleRecognizer::DoRecognizeL(const TDesC& aName, const TDesC8& aBuffer)
{
_LIT8(KExampleData, "example");
_LIT(KDotExample, ".Example");
 
TParse parse;
parse.Set(aName,NULL,NULL);
TPtrC ext=parse.Ext(); // extract the extension from the filename
 
if (ext.CompareF(KDotExample)==0 && aBuffer.FindF(KExampleData)!=KErrNotFound)
{
iConfidence=ECertain;
iDataType=TDataType(KExampleTextMimeType);
}
}

This is located in apmrec.h and should be linked against apmime.lib in mmp file.


Function Members of CApaDataRecognizerType

CApaDataRecognizerType(), ~CApaDataRecognizerType(), Confidence(), CreateDataRecognizerL(), FilePassedByHandleL(), Lock(), Locked(), MimeType(), MimeTypesCount(), PreferredBufSize(), Priority(), RecognizeL(), SupportedDataTypeL(), TRecognitionConfidence, TRecognizerPriority, TypeUid(), Unlock(), UpdateDataTypesL().


Related:

--

Related Wiki Articles

No related wiki articles found

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2findeE78E2ephpE2fTalkE3aE4cargeE5fscreenE5fsaverX qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqfntypeZWikiContentQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZtypeQUqfntypeZWikiContentQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqfntypeZWikiContentQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ