example/smfclientapp/displaywidget.cpp
author cgandhi <chandradeep.gandhi@sasken.com>
Tue, 18 May 2010 17:33:55 +0530
changeset 6 c39a6cfd1fb9
permissions -rw-r--r--
Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
     1
/**
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
     2
 * Copyright (c) 2010 Sasken Communication Technologies Ltd.
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
     3
 * All rights reserved.
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
     4
 * This component and the accompanying materials are made available
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
     5
 * under the terms of the "Eclipse Public License v1.0" 
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
     6
 * which accompanies  this distribution, and is available
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
     7
 * at the URL "http://www.eclipse.org/legal/epl-v10.html"
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
     8
 *
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
     9
 * Initial Contributors:
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    10
 * Chandradeep Gandhi, Sasken Communication Technologies Ltd - Initial contribution
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    11
 *
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    12
 * Contributors:
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    13
 * Manasij Roy, Nalina Hariharan
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    14
 */
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    15
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    16
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    17
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    18
#include "displaywidget.h"
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    19
#include <QApplication>
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    20
#include <QDesktopWidget>
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    21
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    22
DisplayWidget::DisplayWidget(QWidget *parent)
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    23
    : QWidget(parent)
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    24
{
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    25
	ui.setupUi(this);
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    26
	ui.verticalLayout->setGeometry(QApplication::desktop()->availableGeometry());
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    27
	//Add item as and when they are implemented
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    28
	ui.comboBox_intf->addItem("Contact Fetcher");
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    29
	ui.comboBox_intf->addItem("Post Provider");
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    30
//	connect(ui.comboBox_intf,
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    31
//			SIGNAL(currentIndexChanged(int)),
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    32
//			this,
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    33
//			SLOT(interfaceSelected(int)));
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    34
	connect(ui.pushButton_intf,SIGNAL(clicked()),this,SLOT(interfaceSelected()));
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    35
	connect(ui.pushButton_SP,SIGNAL(clicked()),this,SLOT(serviceProviderSelected()));
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    36
	connect(ui.pushButton_service,SIGNAL(clicked()),this,SLOT(serviceSelected()));
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    37
	writeLog("Start");
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    38
}
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    39
void DisplayWidget::interfaceSelected()
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    40
	{
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    41
	SmfClient client;
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    42
	//TODO:- PM should use commented interface name instead
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    43
//	QString name("org.symbian.smf.client.contact.posts");
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    44
	QString intfName;
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    45
	switch(ui.comboBox_intf->currentIndex())
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    46
		{
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    47
		case 0:
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    48
			intfName = "org.symbian.smf.client.contact.fetcher";
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    49
			break;
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    50
		case 1:
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    51
			intfName = "posts";
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    52
			break;
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    53
		default:
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    54
			//should not reach here!!!!
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    55
			break;
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    56
		}
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    57
	writeLog("Before client.GetServices");
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    58
	providerList= client.GetServices(intfName);
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    59
	ui.comboBox__SP->clear();
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    60
	//add provider names to the combobox
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    61
	for(int i=0; i< providerList->count();i++)
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    62
		{
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    63
		SmfProvider provider = providerList->at(i);
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    64
		ui.comboBox__SP->addItem(provider.serviceName());
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    65
		}
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    66
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    67
	//logging for debugging purpose
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    68
	writeLog("GetServices count=");
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    69
	QString c = QString::number(providerList->count());
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    70
	writeLog(c);
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    71
	//serviceProviderSelected
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    72
//	connect(ui.comboBox__SP,
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    73
//			SIGNAL(currentIndexChanged(int)),
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    74
//			this,
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    75
//			SLOT(serviceProviderSelected(int)));
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    76
	}
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    77
void DisplayWidget::serviceProviderSelected()
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    78
	{
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    79
	
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    80
	switch(ui.comboBox_intf->currentIndex())
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    81
		{
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    82
		case 0:
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    83
			ui.comboBox_service->addItem("Get Friend List");
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    84
			//ui.comboBox_3->addItem("Get Group List");
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    85
			break;
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    86
		case 1:
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    87
			ui.comboBox_service->addItem("Get Own Posts");
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    88
			//ui.comboBox_3->addItem("Get Friend's Posts");
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    89
			break;
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    90
		}
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    91
//	connect(ui.comboBox_service,
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    92
//			SIGNAL(currentIndexChanged(int)),
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    93
//			this,
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    94
//			SLOT(serviceSelected(int)));
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    95
	}
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    96
void DisplayWidget::serviceSelected()
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    97
	{
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    98
	SmfProvider smfP(providerList->at(ui.comboBox_service->currentIndex()));
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    99
	
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   100
	writeLog("Selected SmfProvider=");
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   101
	writeLog(smfP.m_description);
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   102
	writeLog(smfP.m_serviceUrl.toString());
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   103
	writeLog(smfP.m_appUrl.toString());
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   104
	switch(ui.comboBox_intf->currentIndex())
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   105
		{
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   106
		case 1:
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   107
			m_postProvider = new SmfPostProvider(&smfP);
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   108
			//TODO:- it should be nested switch case as there are multiple APIs under one interface
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   109
			//connect to appropriate slot
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   110
			connect(m_postProvider,
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   111
					SIGNAL(postsAvailable(SmfPostList*, SmfError, SmfResultPage)),
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   112
					this,
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   113
					SLOT(showPosts(SmfPostList* , SmfError , SmfResultPage )));
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   114
			
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   115
			writeLog("Before m_postProvider->posts=");
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   116
			//request for self posts
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   117
			m_postProvider->posts();
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   118
			break;
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   119
		case 0:
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   120
			m_contactFetcher = new SmfContactFetcher(&smfP);
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   121
			//connect to appropriate slot
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   122
			connect(m_contactFetcher,
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   123
					SIGNAL(friendsListAvailable(SmfContactList*, SmfError , SmfResultPage)),
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   124
					this,
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   125
					SLOT(showFriends(SmfContactList*, SmfError , SmfResultPage)));
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   126
			
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   127
			writeLog("Before m_contactFetcher->friends=");
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   128
			//request for friends, excluding paging info
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   129
			m_contactFetcher->friends();
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   130
			break;
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   131
		}
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   132
	}
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   133
void DisplayWidget::showPosts(SmfPostList* postlist, SmfError error, SmfResultPage resultPage)
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   134
	{
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   135
	writeLog("TestScreen::showPosts");
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   136
	ui.listWidget->clear();
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   137
	ui.listWidget->setVerticalScrollBar(ui.verticalScrollBar_list);
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   138
	writeLog("TestScreen::showPosts count=");
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   139
	writeLog(QString::number(postlist->count()));
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   140
	writeLog("Error=");
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   141
	writeLog(QString::number(error));
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   142
	if(error)
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   143
		{
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   144
		QString smferrString("Smf Error code=");
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   145
		smferrString += QString::number(error);
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   146
		QMessageBox::information(this,"Error",smferrString,QMessageBox::Ok);
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   147
		}
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   148
	//display post description
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   149
	
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   150
	foreach(SmfPost post, *postlist)
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   151
			{
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   152
			QString desc = post.description();
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   153
			ui.listWidget->addItem(desc);
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   154
			}
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   155
	ui.listWidget->show();
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   156
	}
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   157
void DisplayWidget::showFriends(SmfContactList* frnds, SmfError err, SmfResultPage)
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   158
	{
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   159
	splash.finish(this);
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   160
	writeLog("TestScreen::showFriends count=");
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   161
	writeLog(QString::number(frnds->count()));
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   162
	writeLog("Error=");
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   163
	writeLog(QString::number(err));
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   164
	//display friends
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   165
	
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   166
	foreach(SmfContact frnd, *frnds)
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   167
			{
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   168
		//lets display only street
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   169
		QVariant nameVar = frnd.value("Name");
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   170
		QContactName name = nameVar.value<QContactName>();
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   171
		QString fname;
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   172
		QString lname;
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   173
#ifdef OLDER_QT_MOBILITY
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   174
		fname = name.first();
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   175
		lname = name.last();
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   176
#else
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   177
		fname = name.firstName();
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   178
		lname = name.lastName();
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   179
#endif
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   180
		
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   181
		ui.listWidget->addItem(fname);
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   182
			}
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   183
	ui.listWidget->show();
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   184
	}
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   185
void DisplayWidget::writeLog(QString log) const
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   186
	{
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   187
#ifdef WRITE_LOG 
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   188
	QFile file("c:\\data\\SmfClientLogs.txt");
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   189
    if (!file.open(QIODevice::Append | QIODevice::Text))
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   190
	         ;
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   191
    QTextStream out(&file);
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   192
    out << log << "\n";
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   193
    file.close();
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   194
#endif
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   195
	}
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   196
DisplayWidget::~DisplayWidget()
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   197
{
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   198
c39a6cfd1fb9 Updating the source code for plugin manager, transport manager, smfserver and smfclient. sample plugins and tests are included
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   199
}