Association of Symbian s60 file formats
Today, we will briefly record the file format association under Symbian s60-associated file (default) opening program.
File Associations in the Symbian system use MIME (data-type) as the keyword. For example, the Association of JPEG images is based on "image/JPEG"
For such a mime to be associated, the program needs to specify the types of files that can be received, and the associated priority. For different software under the same system, if both are associated with the same file format
Then, select the highest priority as the default program to open.
The method to specify mime Association and priority is to specify an aif_data resource in appaif. RSS, for example:
Resource aif_data
{
App_uid = 0x04e043df;
Num_icons = 2;
Embeddability = kappembeddable;
Newfile = kappdoesnotsupportnewfile;
Datatype_list =
{
Datatype
{
Priority = edatatypepriorityhigh;
Type = "image/JPEG ";
},
Datatype
{
Priority = edatatypepriorityhigh;
Type = "image/BMP ";
}
};
}
The priority is a char type. For more information, see datatype definition:
Struct datatype
{
Long priority;
Ltext8 type (kmaxdatatypelength );
}
The priority has the following constants:
Enum
{
Edatatypeprioritysystem = 0xfff9,
Edatatypepriorityhighly = 10000,
Edatatypeprioritynormal = 0,
Edatatypeprioritylow =-10000,
Edatatypeprioritylastresort =-20000
};
If you want to associate a file that may not be recognized by the system, you need to implement a recognizer for Type Recognition. In the Symbian system, recognizer
When a dynamic library for row file recognition encounters a file (such as opening the File Manager), the system will enumerate all the recognizer currently installed, and pass in the Data Pointer and file path. Expected
Obtain a MIME type until the MIME type is obtained or all recognizer is enumerated.
The recognizer must implement the capadatarecognizertype class, where void dorecognizel (const
Tdesc & aname, const tdesc8 & abuffer) is an important entry. For specific implementation, refer to the manual.
==============
In addition, for SDK versions 3 and 5, the datatype information is in app_reg.rss. For specific modifications, refer to the SDK manual.
To associate dynamic files, you can use the changedatamappingl () API. For more information, see
Http://wiki.forum.nokia.com/index.php/CS001417-
_ Change_application_mime_type_mapping. This method is successfully verified (only version 3 or above is supported ).