# Aiftool resource file format — `.rss`

## Contents

- Overview
- Include file
- Application UIDs
- Caption list
- Number of icons
- Embeddability capability
- Hidden capability
- New file capability
- Data-type list

### Overview

The resource file used by `aiftool` specifies the application UID, captions, capabilities, the number of icons to be incorporated in the final `aif` file, and the priorities of supported MIME types. The structure of the resource file is as shown below. Each element of the file is described in its own section, and an example file can be viewed in the topic Examples - `aiftool`.

        // include file - contains enumerations and resource structure
        #include <aiftool.rh>

        RESOURCE AIF_DATA
        {
        // Application UID (for narrow and/or unicode builds)
        #ifdef _UNICODE
              app_uid=unicode_application_uid;
        #else
              app_uid=narrow_build_application_uid;
        #endif

        // Application Captions list (captions in supported languages)
        caption_list=
              {
              CAPTION { code=[ELangEnglish]; caption="Caption in English"; }, ...,
              CAPTION { code=[Enumeration_for_selected_language_n]; caption="Caption_in_selected_language_n"; },
              };

        // number of icons to be loaded from the .mbm file
        [num_icons=0; ]

        // Application Capabilities
        [embeddability= KAppNotEmbeddable | KAppEmbeddable | KAppEmbeddableOnly;]
        [hidden= KAppNotHidden | KAppIsHidden      ;]
        [newfile= KAppDoesNotSupportNewFile | KAppSupportsNewFile;]

        // MIME type priorities
        [datatype_list=
              {
              DATATYPE { priority= EDataTypePriorityHigh | EDataTypePriorityNormal | EDataTypePriorityLow | EDataTypePriorityLastResort; type="MIME_type"; },
              DATATYPE { priority=priority_enumeration; type="another_MIME_type"; }
              };]
        }

For information about how to interpret the syntax, see BNF grammars.

### Include file

The resource file includes a header file `aiftool.rh`. Aiftool expects the file to be located in `\Epoc32\Include\`, when it is installed as part of an SDK).

        #include <aiftool.rh>

The file specifies:

- an enumeration for the supported language codes
- an enumeration for the supported application capabilities
- an enumeration for the different MIME type priorities
- a definition of the `AIF_DATA` resource structure, including default `aif` properties.

### Application UIDs

The application UID associates the `.aif` file with its parent application.

        #ifdef _UNICODE
              app_uid=unicode_application_uid;
        #else
              app_uid=narrow_build_application_uid;
        #endif

The same resource file is used to produce both narrow and Unicode `aif` files. Hence both narrow and Unicode build UIDs are specified. For C++ SDK developers, the UIDs should match those specified in the project `.mmp` file.

##### Notes:

- Unicode files are not supported in EPOC release 5. However the tool chain is Unicode enabled, so the functionality has been documented.
- Narrow and Unicode builds have different UIDs/`.aif` files. This prevents Unicode and Narrow build applications from opening each others documents.
- The Unicode `.aif` builder, `aiftoolu` uses the _UNICODE flag to select the Unicode UID.

### Caption list

A caption is the line of text, typically the application’s name, which appears below the application icon in the system shell.

Captions are specified in the `caption_list` section of the resource file. Captions are typically specified for each language supported by the application.

`caption_list=
{`
`CAPTION` `{` `code=`[ELangEnglish]`;` `caption="`Caption in English`";` `}`, ...,
`CAPTION` `{` `code=`[Enumeration_for_selected_language_n]`;` `caption="`Caption_in_selected_language_n`";` `}`,
`};`

The enumeration for supported languages, as defined in the included file, are given below. The `code=[`language_enumeration`]` definition associates each caption with a particular system language setting.

##### Supported language enumeration

ELangAmerican | ELangDutch | ELangIcelandic | ELangSpanish
ELangAustrian | ELangEnglish | ELangItalian | ELangSwedish
ELangAustralian | ELangFinnish | ELangNewZealand | ELangSwissFrench
ELangBelgianFlemish | ELangFrench | ELangNorwegian | ELangSwissGerman
ELangBelgianFrench | ELangGerman | ELangPortuguese | ELangTest
ELangDanish | ELangHungarian | ELangRussian | ELangTurkish

### Number of icons

The `num_icons` field defines the number of bitmaps to be included in the final `aif` file. If not specified, the number defaults to zero, and the `aif` file is displayed with the default icon. The default icon is typically a question mark.

        [num_icons=0;]

### Embeddability capability

The file can take one of three enumerated Embeddability values, as defined in the topic Application capabilities. If undefined, the Embeddability property defaults to KAppNotEmbeddable.

        [embeddability= KAppNotEmbeddable | KAppEmbeddable | KAppEmbeddableOnly;]

### Hidden capability

The file can take one of two enumerated hidden states, as defined in the topic Application capabilities. If undefined, the Hidden property defaults to KAppNotHidden.

        [hidden= KAppNotHidden | KAppIsHidden;]

### New file capability

The file can have one of two enumerated new file creation properties, as defined in the topic Application capabilities. If undefined, the New File property defaults to KAppDoesNotSupportNewFile.

        [newfile= KAppDoesNotSupportNewFile | KAppSupportsNewFile];

### Data-type list

MIME type priorities are specified in the `datatype_list` section of the resource file. The priority for each type, e.g. text/html, determines which application is launched to display a particular document. Priorities can take one of four enumerated levels, as described in the topic MIME support.

[`datatype_list=
{
DATATYPE { priority=` EDataTypePriorityHigh | EDataTypePriorityNormal | EDataTypePriorityLow | EDataTypePriorityLastResort`;` `type="`MIME_type`";},
` `DATATYPE { priority=`priority_enumeration`; type="`another_MIME_type`"; }
};`]

##### Notes:

- Developers should only use `EDataTypePriorityNormal` or `EDataTypePriorityLow`, unless there is a very good reason to do otherwise.