|
|
|
UIQ application binaries are compiled from a number of source and header files.
The following sections discuss the files used in the C++ part of the build process, the files used in the resource file part of the build process and the files which are used by both processes.
The implementation of the Application UI framework classes is provided in standard C++ source files. The file usually only #includes the application header file:
#include "Myexapp.h"
The source files for the UI implement the entry point E32Main() and the model DLLs implement the DLL entry point function E32Dll( ).
Application interfaces are declared in standard C++ header files. The code fragment below shows the include definitions for a minimal UIQ application. The application is minimal because a real application is likely to include, at the very least, some Qikon specific headers, for example, Qikctl.h and Qikdlg.h for UIQ specific controls and dialogs. It could look something like this:
#ifndef __MYEXAPP_H
#define __MYEXAPP_H
#include <Coeccntx.h>
#include <Eikenv.h>
#include <QikAppui.h>
#include <QikApplication.h>
#include <QikDocument.h>
#include <Eikmenup.h>
#include <Eikon.hrh>
#include <Qikon.hrh>
#include “ExampleApp.rsg”
#include “ExampleApp.hrh”
…
#endif
The first five #includes are the UI Control framework, uikon environment, AppUi class, application class, document class and menu classes. Eikon.hrh and Qikon.hrh define standard commands from Uikon and Qikon, which are shared with the resource compiler. ExampleApp.hrh defines application-specific commands. ExampleApp.rsg defines the location of resources within the application’s compiled resource file.
All applications require a resource file. It defines user interface elements including application screen furniture such as menus and custom dialogs. The resource file provides a more economical format than C++ for specifying GUI elements. However, applications can also use C++ to dynamically modify user interface elements defined in resource files. An application’s resource file typically has the same name as the application, with the extension .rss.
However, the recommended way to create controls is to use the .rss file as much as it is possible.
This file contains text strings, which can be replaced for internationalization. This makes translation easier, because all language dependent data is in one place.
Contains definitions for symbolic constants such as command IDs, which are used, for example, in menu bars and buttons.
The .rsg file, which contains symbolic constants, is the compiled .rss file to include in C++ source files and other resource files at build time.
The GUI APIs provide resource structures found in .rh files. For example, Uikon.rh defines the struct MENU_BAR that applications use to define their menu bars.