【海外版NOKIA Developer Newsletter】

今月のTIPSその1:ポータブルUIを構築する

 Symbian OS対応のポータブルUIの開発がますます重要となる中、開発者には頻繁にアプリケーション・コードの再利用を行う必要性が生じています。通常は、UIコードをエンジンにあるコアのアプリケーション機能から切り離すのが良いとされます。

 ポータブルUIの生成は、見た目ほど難しくはありません。UIから独立したアプリケーション・エンジンのプログラミングをサポートする技術としては、マクロ、インヘリタンス、デリゲーションの3つがあります。

 マクロは、コードの違いがコード内で最小限の場合のみ、利用価値のある技術です。マクロを使えば同一ファイル内にUIQとAVKONを結合させたソースコードを書き、#ifdefインストラクションを使って適切な部分を選択することが可能です。

 もっと大きなアプリケーションになると、コード全体に各UIの詳細が散在しやすく、マクロはベストなアプローチとは言えません。この場合はインヘリタンスが最適な方法です。インヘリタンスでは基底クラスを使用することで、標準機能に対応したコードを利用できます。UI独自のコードを持つサブクラスは継承して各UI向けに個別のサブクラスを生成します。基底クラスが異なるAppUiクラスから派生させる場合の問題に対応するしかけも用意されており、マクロを使って例えばCAknAppUi(AVKON)やCQikAppUi(UIQ)にリンクします。

 最も洗練された3番目の選択は、デリゲーションです。開発者がAppUiを使ってUI独自のコマンドを受け取ると、そこからデリゲート・クラスを呼び出して標準機能のすべてを代理で処理させます。このようにデリゲート・クラスは、MVC(Model View Controller)のデザインパターンにおけるコントローラの役割を果たします。

 ☆Symbian OS向けポータブルUI構築の詳細はこちら
  ⇒ http://www.forum.nokia.com/main/1,6566,040,00.html?fsrParam=3-3-%2Fmain.html&fileID=5283 (英語)

http://www.nokia.co.jp/forum/support/newsletter/2005/index20.html

Symbian OS application engine development training
Language C++
Level Intermediate
Length 3 days

Course overview and requirements
This course is for application developers focusing on the implementation of engines and other application support services and will give developers an understanding of engine design issues and experience of engine implementation issues. It presents various design techniques and system frameworks of interest to engine developers as well as some of the key Symbian OS APIs used in engines. Areas covered in the course include DLLs, Active Objects, client/server, Sockets, DBMS and binary compatibility. The course consists of approximately 50% practical work and 50% lectures. Delegates should have already attended the Symbian OS essentials course, or have equivalent experience.

The course trains generic Symbian OS programming methodologies, all of which are applicable to all phone types, all emulators, all UI systems and all versions of the OS.

The training platform is a PC Windows platform running Visual Studio 6, gcc and Symbian's own build tools.

Course in detail
Applications for Symbian OS are typically designed as two separate modules, a user interface and an engine. The engine implements all the functionality of the application, without any dependence on a particular user interface or look-and-feel. Symbian OS provides numerous component libraries and APIs to allow developers to write sophisticated engine functionality. This course provides a thorough grounding in these APIs, together with various design techniques and system frameworks of interest to engine developers. Upon completing this course, participants will be able to:

describe the UI-engine and MVC models for Symbian OS applications
understand the design issues involved in developing Symbian OS engines
build application engines as separate DLLs that pay attention to binary compatibility issues
recognize the need for servers and make use of the client server and active object frameworks
implement key services that utilize Symbian OS DBMS and the Socket server

Course agenda

Course overview
1. Overview of the course and high-level application design issues
2. UI-engine and MVC application models

Building and testing
1. Writing DLLs
2. Using RTest and test harnesses

DBMS
1. Symbian OS DBMS server
2. Key construction and manipulating databases using C++ and SQL APIs

Active Objects
1. Using and writing Active Objects

Client-server
1. When and how to write a server
2. Client-side and server-side issues
Sockets and TCP/IP
1. Introduction to the Socket server and its key classes
2. Implementing Socket-based communication
3. Architecture for Socket-based communications

Binary Compatibility (BC)
1. Maintaining BC
2. When to break it!

Subclassing List Box in Symbian
Posted on 20 April 2005 by Antony Pranata


This article explains how to subclass a list box in Symbian, especially in UIQ. One reason to subclass a list box is to have our own custom list box, for example you can display a double line list box (see Figure 1a). I will focus the discussion in this article on UIQ because Series 60 has already various types of list box, for instance CAknDoubleStyleListBox, CAknSingleHeadingStyleListBox, etc. In most cases, you can use one of these classes. However, in a few cases, you might need to subclass list box in Series 60 as well.
(a) Double line list box
(a) Double line list box
(b) Single line list box
(b) Single line list box

Figure 1. The example of custom list box in UIQ.

I will start this article with the architecture of list box in Symbian and then go through how to subclass a list box. At the end of this article, I will give a simple example of custom list box and how to use it (with the complete source code).

Before reading this article, I have a small comment. If you just want to port a Series 60 application that uses CAknXXXListBox to UIQ, there is a faster way. You might consider a tool called S2U, which is able to port Series 60 user interface to UIQ (see Further Reading section at the end of this article).
Architecture of List Box

I won’t discuss the architecture of Symbian list box in more detail (read one of the references at the end of this article if you want to know more about it). Like any other components in Symbian, the list box uses MVC (Model-View-Controller) model. Figure 2 shows the MVC model of the list box in Symbian.
Architecture of list box in Symbian