Join Now

Get project from CVS to Carbide C++

Carbider | 02 November, 2007 12:16

It recently for me to describe how to Checkout the project’s source codes directly to Carbide C++.  So I decided to carry such an explanation to a single post and refer to it.

Contents:
  1. How to get sources from CVS
  2. How to get sources from Zip archive.

To get sources from CVS to Carbide workspace.

  • Open new workspace in Carbide.
  • Choose “Window->Open perspective->Other->CVS Repository Exporting”
  • At the left side of window (on CVS Repositories tab) click Right mouse button and choose: “New->repository Location”.

 Fill in following data:

  • Host: bluspan.cvs.sourceforge.net
  • Repository path: /cvsroot/bluspan
  • User: anonymous
  • Connection type: pserver

 

 

  • After Location is created, click “Head”, then right-button click at the project you want to get and pick “Check out”.
  • You may need then to import project: File->Import->Simbian OS Bld.inf. The Bld.inf file is usually situated at “group” folder.

  2. To get sources from Zip archive.

  • Extract files from archive
  • Create new Carbide workspace
  • Import project by: File->Import->Simbian OS Bld.inf.

    The Bld.inf file is usually situated at “group” folder.

    

Insert Multiselection list into GUI

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.

 

Accomplish SSL connection from S60v3

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”

 

 
 
Powered by LifeType