Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Application information files


Overview

Application Information Files, extension .aif, store data concerning an application. The information includes the application’s:

aif files can be specified in a number of ways:

If you manually write an Aiftool resource file,

There are also C++ reader and writer classes for manipulating the data stored in aif files (the writer class is rarely needed).

Software can run without an aif file. In this case; a default icon, typically a question mark, is used for the application and its documents; MIME types are not supported; embedding is not supported; and the application does not support new-file, e.g. the ability to create files from the system shell rather than from within an application. The default caption is the name of its executable, without the extension.

The following topics describe each of the application properties defined in the application information file.

[Top]


Application icons

Icons are used to represent applications, and their associated files/documents, when they are embedded, or when they are shown on the system shell.

Aif files allow multiple icons of different sizes to be stored — the most appropriate size for the current container zoom state is displayed. Supplying a variety of sizes helps to ensure that an icon will not have to be dynamically scaled when it is drawn at a particular size — scaling small bitmaps generally results in a marked loss of quality. The icon sizes to use vary between device families:

Each icon size needs a picture bitmap, and a mask bitmap. The mask should be black for the regions which are to be selected from the picture, and white for the transparent areas where the background should show through.

[Top]


Application captions

An application's caption is the text displayed below its icon. Typically it is the application's name.

Captions for multiple languages can be stored in one .aif, and the one corresponding to the current system language is used. If there is no caption matching the current system language, the .aif filename is used. This means that one .aif can be used for multiple language versions of an application, as long as the icon does not need to change across these versions.

[Top]


Application capabilities

The three file properties/capabilities defined in an .aif file are detailed below. Note the following language-specific behaviour:


embeddability

An application can be defined as embeddable, not embeddable, or EmbeddableOnly. An embeddable file appears in the embeddable list. A file with the property EmbeddableOnly appears in the embeddable list, but not on the shell.

It is possible to set the Embeddable or EmbeddableOnly capability for an application which does not create embeddable documents, e.g. for a Java application. Attempting to embed such an application will cause the system to return Not Supported.

By default, the capability is not embeddable.


hidden

An application can be defined as Hidden or Not Hidden. The Hidden property is intended for applications which are to run in the background. Such files do not appear on the shell or in the embeddable applications list, however they are visible in the system task list.

The Hidden capability can be applied to any application. However Java applications should not be hidden, because this will remove their icon from the shell — which is the whole point of giving them an aif file.

By default, files are not hidden.


new-file

An application can be defined with capabilities Does Not Support New File or Supports New File. The property allows new files to be created from the system screen as well as in the program.

It is possible to set the Supports New File capability for an application which does not have the ability to create new document files, e.g. for a Java application. Attempting to create a new file for such an application will cause the system to launch the application.

By default, files do not support the New File property.


Note:

In C++, these capabilities are encapsulated in the TApaAppCapability class.

[Top]


UIDs, extension and location

Application information files are located in the same directory as the application with which they are associated. They are normally given the same name as the application file (.app), but with an extension .aif.

Like other files, application information files have a set of 3 identifying UIDs:

When an .aif file is created using Aiftool, users need only specify the third UID. Aiftool automatically inserts the others.

[Top]


MIME support

Multipurpose Internet Mail Extensions, MIMEs, define a file format for transferring non-textual data, such as graphics, audio and fax, over the Internet. The datatype_list section of the Aiftool resource file lists the MIME types that the application supports, and the priority of support that each type is given. When a file is to be opened, EPOC launches the application which has the highest priority support for the selected file type.

There are four priority levels, of which only EDataTypePriorityNormal or EDataTypePriorityLow should normally be used. For example, a text editor is good at editing text/plain files, and would hence be given a priority of EDataTypePriorityNormal for that file type. A web browser is less good at handling text files, and would be assigned the lower priority EDataTypePriorityLow. Hence either application can be launched to handle a text document, however if both applications are present, the text editor is launched by preference.

EDataTypePriorityHigh should only be assigned under exceptional conditions  — e.g. if no other application could ever handle a particular MIME type as brilliantly.

EDataTypePriorityLastResort should also be used sparingly. Text editors are terrible at displaying HTML, and would either have the priority EDataTypePriorityLastResort, or would not support the type at all.


Notes: