|
Nokia N97 SDK Example Applications Guide |
1. About this Example
2. Running the example
3. Architecture
4. Design and Implementation
This example uses the CContactDatabase and CPbkContactEngine classes for database handling.
This example can be run in both a real S60 device and the emulator provided with the SDK. This example does not involve any configurations.
Pressing the Options softkey displays the following six choices:
Select Default database to open the database. The Phonebook application uses this database.
Selecting Default database from the Open submenu opens the created contact database. If the default contact database is opened, the application title is "Default db”.
Select Contact template to create a contact template.
Selecting Contact template from the Create submenu creates a new contact template. A contact template is a contact item, which is used to initialize the field set for other contact items. The example application does not check if the contact template already exists.
The following dialog appears in the display:
CContactDatabase has the following methods for Contact Template handling:
There can be preset information in the contact template. All contact template information is copied to the new contact items.
Example:
A company name is added to the contact template. When the user adds a new contact to the contact database, a company name is automatically inserted to the new contact items.
The following message appears in the display if a contact database is not opened:
Selecting Edit/View from the Contacts submenu or clicking with the joystick (or similar pointing device) displays the following dialog. Selecting Options menu behaves the same way as if it is opened from the Phonebook application. Selecting Exit from the Options menu closes the contact database example application.
Selecting Create from the Contacts submenu displays the following dialog:
Selecting Delete from the Contacts submenu displays the following dialog displayed below. This shows how to delete a contact. The contact database can be opened or closed. If the contact database is opened, the application closes it before deleting.
Selecting Add to contact group from the Contacts submenu displays the contact groups listbox. This example shows how to add a contact to a contact group.
Select Contacts to display contacts from the selected contact database in the listbox.
Select Groups to display contact groups from the selected contact database in the listbox.
Select Create to create a new contact group. There can be more than one group with the same name in the contact database.
Select Delete to delete selected contact group. This method does not delete contacts from the group.
Selecting Create from the Contact groups submenu displays the following dialog:
Selecting Delete from the Contact groups submenu displays the following dialog:
Select Exit at any time to exit the application.
This use case demonstrates how to create a contacts database, add a contact, a contact group and add a contact to the contact group. The Contacts example is opened for the first time.
The following UML diagram illustrates the general architecture of the contact API example application:
In this example CContactDatabase, CPbkContactEngine and CPbkContactEditorDlg are the classes for contacts handling.
|
© Nokia 2009 |