Carbider | 06 November, 2007 11:09
One of my favorite classes that Symbian grants to build User Interface is Multiselection List. I’ve learned about it recently.
This is a type of Vertical lists which draws a set of elements each of them can be marked by checkbox.
At future BluSPAN GUI there is “Chat settings” view. User can determine which types of files can be accepted by chat. Example: .bmp, .jpeg, .avi, .mpeg, wav and so on. See diagram 1.

Diagram 1 – Multiselection list at Chat settings view.
To build Multiselection List into my application I had to read about a lot of stages how to use it.
I divided this stages to:
» Defining Multiselection List in resource (.rss) file
» Code implementation in source (.cpp) to Popup it.
» Get results of user choice.
1. Defining Multiselection List in .rss file
I’ve read the Resources_Dialogs.pdf at S60_Platform_Avkon_UI_Resources documentation series. Upon this I’ve formed the resource definition as below:
Listing 1 |
// Multiselection list query dialog RESOURCE DIALOG r_accept_type_multiselection_query { flags = EGeneralQueryFlags; buttons = R_AVKON_SOFTKEYS_OK_CANCEL; items = { DLG_LINE { type = EAknCtListQueryControl; id = EListQueryControl; control = AVKON_LIST_QUERY_CONTROL { listtype = EAknCtSingleGraphicPopupMenuListBox; listbox = LISTBOX { flags = EAknListBoxMultiselectionList; height = 3; width = 3; array_id = r_accept_types_multiselection_query_list_item; }; heading = "Select types:"; }; } }; } RESOURCE ARRAY r_accept_types_multiselection_query_list_item { items = { LBUF { txt = "1t.Bmp"; }, LBUF { txt = "1t.Jpg"; }, LBUF { txt = "1t.Avi"; }, LBUF { txt = "1t.Mp3"; }, LBUF { txt = "1t.Wav"; } }; } |
I have put this listing to [project_name].rss file. After that you can call ExecuteLD() function with Reference to this resource object. This will be shown below.
2. Popuping list. Code implementation.
With UI designer help, choose the Event tab for “Accept types” menu item. Double click on event to generate Handler function.
In this function we need to create an Instance of CAknListQueryDialog class and Execute it. The source code below shows it.
Listing 2 |
// Run a dialog of “Acceptance of data types” CArrayFixFlat<TInt>* indexArray = new(ELeave)CArrayFixFlat<TInt>(5); CleanupStack::PushL(indexArray); CAknListQueryDialog* dlg = new (ELeave) CAknListQueryDialog(indexArray);
if ( dlg->ExecuteLD(R_ACCEPT_TYPE_MULTISELECTION_QUERY ) ) { Here we will take results of User’s choice } CleanupStack::PopAndDestroy();// indexArray |
By this code the Multiselection List will Popup and user can mark preferable items.
3. Geting results of user choice
That task was not easy due to Specific Array type of CArrayFixFlat<TInt>. I could not retrieve data from it. I found a way with help of the similar topic of this forum.
The source code below should be placed at Listing 2 to the “if ( dlg->ExecuteLD)” branch. This source code takes result from List and shows indexes of selected items on screen (diagram 2).
Listing 3 |
if ( dlg->ExecuteLD(R_ACCEPT_TYPE_MULTISELECTION_QUERY ) ) { TBufC<136> resultString; TPtr ptr = resultString.Des();
//temporary string to convert from TInt to text TBufC<136> temporaryString; TPtr ptrTemporaryString = temporaryString.Des(); TInt intValue;
//How much elements did user select from Multiselection list TInt elementsAmount = indexArray->Count();
//Retrieve all element that user have picked up for (TInt elementI = 0; elementI < elementsAmount; elementI++) { intValue = (*indexArray)[elementI]; ptrTemporaryString.Format(_L("%d "), intValue); ptr.Append(temporaryString); }
//Show the elements user have picked up CAknInformationNote* Notelnformation; Notelnformation = new (ELeave) CAknInformationNote; Notelnformation ->ExecuteLD(resultString); } // If |
Diagram 2 – Results of user’s choice. Indexes of selected items
Download source code here: guiSetBluspan Zip Archive v 0.002 (Nokia’s wiki)
See this posts here to know how to use sources.
Carbider | 19 November, 2007 09:47
The PAN profile defines how to enable Bluetooth devices to participate in a personal area network.
One of the roles in PAN profile is a Network Access Point (NAP) that provides an Ethernet bridge to support network services to the PAN user. Read about it here: PAN specification.
For now I will try to simulate connection to a NAP from my phone. Why simulate? Because to achieve the real connection I need realization of BNEP protocol class which will transmit Ethernet payloads via Bluetooth.
Since Bluetooth can be eavesdropped in on, we want to use SSL as David said here in comments.
So the goal for now is to connect to some server using secure internet connection on my phone.
I chose the www.mozilla.org SSLv3 site as a server to connect to.
I found the CSecureSocket example at symbian.com/.../v9.2docs/.../ but not everything went of smoothly rather the connection was not established and system was completed with panics.
It seems that that example is pretty old even not for 3rd edition. But I can’t assert so.
However I scoped the similar problems and documents over here and here.
When got tangled I used some parts of S60v3 Chat code example with insecure internet connection.
The “guiSetBluspan” application that was initiated at previous posts looks like this now:
you need to click “Options” menu then pick “Connect/Disconnect” item and then pick “NAP” item.

Diagram 1 – Connecting from application
After some seconds server will send SSL certificate. You need answer “Continue”.

Diagram 2 – Certificate question
After all steps of connection, handshaking, page request, getting server response and closing connection the notification will appear about successful operation.

Diagram 3 – Connection finished
The objects of these routines were to establish connection to secure HTTPS connection where NAP’s authorization page will be.
At next researches I need to connect to NAP server, provide user’s login and password. NAP is connected to Radius server which will verify user existence and will start accounting on him.
The source codes of application above are provided by this link: guiSetBluspan Zip archive v 0.003 (Nokia’s wiki)
See this posts here to know how to use sources.
The Secure Connection engine in focused in /Core/ folder and is called from “guiSetBluspanSettingItemListView.cpp”
Carbider | 03 December, 2007 16:28
During last weeks I’ve took part in FN Wiki November Contest. Yeah it would be cool to have N95 here, in Sevastopol :-) However we’ll wait till the results.
I decided to contribute to Wiki with the articles and the examples of what I’ve learned about Symbian programming.
I want to post here some articles that are related to my blog.
The code bookmarks in Carbide.
Carbide is designed to make development process more effective. Here is one feature which is inherited from Eclipse and which I like. It is a Bookmarks feature.
It lets you to mark any line in your source code assigning a description. After that you can navigate to it with help of a bookmarks dialog.
You can put a bookmark simply pressing right mouse button on a line numbers tab.

Diagram 01 – Standard way to add bookmarks.
But it is more comfortable to assign a hotkey.
To assign a hotkey, go to Windows->Preferences. In filter text type “keys”. Select “Modify” tab. At “Command” section pick “Edit”. As a “name” pick “Add bookmark”. At the next “Key sequence” section press a key combination (I chose ALT+B). Press 'Add' button.
Now you can press Alt+B at any line to bookmark it.

Diagram 2 – Assign a hotkey.
You can assign a hotkey to show Bookmarks window.
To do that repeat the same actions but pick “Views” at “Category” dropdown. And then pick “Show view (view: Bookmarks)” at name section. Select key combination. I chose “CTRL+ALT+B”.
Diagram 3 – Assign a hotkey to show bookmarks window.
Now you can navigate bookmarks by pressing Enter or double mouse click to pass to suitable line.
To make it more comfortable assign the Bookmarks view as a Fast View:

Now it can be easily removed by ESC key
and easily retrieved by CTRL+ALT+TAB hotkey.
The final navigation process will look like this:

Diagram 5 - Navigation
In my mind it is very convenient and greatly simplifies code navigation.
Konstantine Voytenko
BluSPAN project coordinator
Fishnest Ltd.
bluspan@gmail.com