example/flickrcontactfetcherplugin/flickrcontactfetcherplugin.cpp
author cgandhi
Mon, 11 Oct 2010 21:59:54 +0530
changeset 26 83d6a149c755
parent 23 574948b60dab
permissions -rw-r--r--
Submitting following changes - AuthApps for Last.fm and Twitter added API for checking ServiceAuthorization added for SMFCredMgrClient API added for forcefully removing credential details from SMFCredMgr Extra argument checks in SMfClient APIs APIs for service login and logout from SMFClient Redundant members removed from SmfServerSymbian DSM bug fixes Test Apps included
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
     1
/**
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
     2
 * Copyright (c) 2010 Sasken Communication Technologies Ltd.
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
     3
 * All rights reserved.
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
     4
 * This component and the accompanying materials are made available
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
     5
 * under the terms of the "Eclipse Public License v1.0" 
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
     6
 * which accompanies  this distribution, and is available
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
     7
 * at the URL "http://www.eclipse.org/legal/epl-v10.html"
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
     8
 *
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
     9
 * Initial Contributors:
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
    10
 * Chandradeep Gandhi, Sasken Communication Technologies Ltd - Initial contribution
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
    11
 *
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
    12
 * Contributors:
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
    13
 * Nalina Hariharan
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
    14
 * 
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
    15
 * Description:
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
    16
 * The Plugin that fetches contacts from the logged in user's flickr account
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
    17
 *
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
    18
 */
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
    19
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 files
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
#include <QtPlugin>
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
#include <QCryptographicHash>
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
#include <QTextStream>
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
#include <QFile>
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
#include <QMap>
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
#include <QListIterator>
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
    27
#include <QDebug>
17
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    28
#include <QSettings>
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    29
#include <smfpluginutil.h>
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
    30
#ifdef SMF_XMLPARSING
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
    31
#include <QXmlStreamReader>
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
    32
#endif
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
    33
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
#include "flickrcontactfetcherplugin.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
    35
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
/**
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
 * Destructor
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
FlickrContactFetcherPlugin::~FlickrContactFetcherPlugin( )
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
	if(m_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
    42
		delete m_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
    43
	}
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
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
/**
17
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    46
 * Method to interpret the key sets obtained from credential manager 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    47
 * @param aApiKey [out] The api key
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    48
 * @param aApiSecret [out] The api secret
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    49
 * @param aAuthToken [out] The auth token provided by Flickr
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    50
 */
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    51
void FlickrContactFetcherPlugin::fetchKeys( QString &aApiKey, 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    52
		QString &aApiSecret, 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    53
		QString &aAuthToken )
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    54
	{
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    55
	qDebug()<<"Inside FlickrContactFetcherPlugin::fetchKeys()";
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    56
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    57
	qDebug()<<"Reg Token = "<<m_provider->m_smfRegToken;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    58
	qDebug()<<"Expiry Date as int = "<<m_provider->m_validity.toTime_t();
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    59
	
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    60
	SmfAuthParams keys;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    61
	SmfPluginUtil util;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    62
	util.getAuthKeys(keys, m_provider->m_smfRegToken, 
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    63
			m_provider->m_validity, m_provider->m_pluginId);
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    64
	
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    65
	qDebug()<<"Number of key-value pairs = "<<keys.count();
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    66
	
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    67
    QByteArray keyName;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    68
    keyName.append("ApiKey");
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    69
	aApiKey.append(keys.value(keyName));
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    70
	
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    71
    keyName.clear();
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    72
    keyName.append("ApiSecret");
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    73
	aApiSecret.append(keys.value(keyName));
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    74
	
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    75
	keyName.clear();
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    76
    keyName.append("AuthToken");
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    77
    aAuthToken.append(keys.value(keyName));
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    78
		
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    79
	qDebug()<<"Api Key = "<<aApiKey;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    80
	qDebug()<<"Api Secret = "<<aApiSecret;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    81
	qDebug()<<"Auth Token = "<<aAuthToken;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    82
	}
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    83
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    84
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
    85
/**
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
    86
 * Method to get the list of 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
    87
 * @param aRequest [out] The request data to be sent to network
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
 * @param aPageNum The page to be extracted
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
 * @param aItemsPerPage Number of items per page
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
 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
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
 */
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
SmfPluginError FlickrContactFetcherPlugin::friends( SmfPluginRequestData &aRequest,
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
    93
		const int aPageNum, 
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
    94
		const int aItemsPerPage )
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
	{
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
    96
	qDebug()<<"Inside FlickrContactFetcherPlugin::friends()";
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
    97
	
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
    98
	SmfPluginError error = SmfPluginErrInvalidArguments;
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
    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
	// invalid arguments
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
	if( aPageNum < 0 || aItemsPerPage < 0 )
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   102
		{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   103
		qDebug()<<"Invalid arguments";
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
   104
		return error;
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   105
		}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   106
	
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   107
	qDebug()<<"Valid arguments";
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   108
	
17
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   109
	// Get the key sets from SMF Plugin Utility class.
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   110
	QString apiKey;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   111
	QString apiSecret;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   112
	QString authToken;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   113
	fetchKeys(apiKey, apiSecret, authToken );
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   114
	
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   115
	// Create the API signature string
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   116
	QString baseString;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   117
	baseString.append(apiSecret);
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   118
	baseString.append("api_key"+apiKey);
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   119
	baseString.append("auth_token"+authToken);
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   120
	baseString.append("filterfriends");
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   121
#ifdef SMF_XMLPARSING
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   122
	baseString.append("formatxml");
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   123
#else
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   124
	baseString.append("formatjson");
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   125
#endif
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   126
	baseString.append("methodflickr.contacts.getList");
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   127
	baseString.append("page"+QString::number(aPageNum));
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   128
	baseString.append("per_page"+QString::number(aItemsPerPage));
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   129
	
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   130
	// Create the url
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   131
	QUrl url("http://api.flickr.com/services/rest/?");
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   132
	url.addQueryItem("api_key", apiKey);
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   133
	url.addQueryItem("auth_token", authToken);
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   134
	url.addQueryItem("filter", "friends");
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   135
#ifdef SMF_XMLPARSING
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   136
	url.addQueryItem("format", "x");
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   137
#else
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   138
	url.addQueryItem("format", "json");
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   139
#endif
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   140
	url.addQueryItem("method", "flickr.contacts.getList");
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   141
	url.addQueryItem("page", QString::number(aPageNum));
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   142
	url.addQueryItem("per_page", QString::number(aItemsPerPage));
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   143
	url.addQueryItem("api_sig", generateSignature(baseString));
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   144
	
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   145
	// Create the request, set the url
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   146
	aRequest.iNetworkRequest.setUrl(url);
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   147
	aRequest.iRequestType = SmfContactGetFriends;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   148
	aRequest.iPostData = NULL;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   149
	aRequest.iHttpOperationType = QNetworkAccessManager::GetOperation;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   150
	error = SmfPluginErrNone;
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
   151
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   152
	qDebug()<<"Url string is : "<<aRequest.iNetworkRequest.url().toString();
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   153
	return error; 
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
   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
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
 * Method called by plugins to generate a signature string from a base string
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
 * @param aBaseString The base string
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
 * @return The md5 hash of the base string
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
 */
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
QString FlickrContactFetcherPlugin::generateSignature(const QString aBaseString)
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
	{
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   163
	qDebug()<<"Inside FlickrContactFetcherPlugin::generateSignature()";
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   164
	
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
   165
	// Create md5 hash of the signature string
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
    QByteArray byteArray;
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
    byteArray.insert(0, aBaseString.toAscii());
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
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
    QByteArray md5Hash = QCryptographicHash::hash(byteArray,QCryptographicHash::Md5 ).toHex();
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
    QString returnString (md5Hash);
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   171
    qDebug()<<"generated signature = "<<QString(returnString);
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
   172
    return returnString;
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
	}
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
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
/**
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
 * Method to get the list of followers
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
 * @param aRequest [out] The request data to be sent to network
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
 * @param aPageNum The page to be extracted
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
 * @param aItemsPerPage Number of items per page
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
 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
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
 */
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
SmfPluginError FlickrContactFetcherPlugin::followers( SmfPluginRequestData &aRequest,
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   183
		const int aPageNum , 
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
   184
		const int aItemsPerPage  )
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
	{
23
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   186
#ifndef TESTINGTHISFUNCTION
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
   187
	Q_UNUSED(aRequest)
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   188
	Q_UNUSED(aPageNum)
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   189
	Q_UNUSED(aItemsPerPage)
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   190
	qDebug()<<"Inside FlickrContactFetcherPlugin::followers()";
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   191
	return SmfPluginErrServiceNotSupported; 
23
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   192
#else
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   193
	SmfPluginError error = SmfPluginErrInvalidArguments;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   194
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   195
	// invalid arguments
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   196
	if( aPageNum < 0 || aItemsPerPage < 0 )
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   197
		{
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   198
		qDebug()<<"Invalid arguments";
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   199
		return error;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   200
		}
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   201
	
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   202
	qDebug()<<"Valid arguments";
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   203
	
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   204
	// Get the key sets from SMF Plugin Utility class.
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   205
	QString apiKey;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   206
	QString apiSecret;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   207
	QString authToken;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   208
	fetchKeys(apiKey, apiSecret, authToken );
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   209
	
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   210
	// Create the API signature string
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   211
	QString baseString;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   212
	baseString.append(apiSecret);
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   213
	baseString.append("api_key"+apiKey);
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   214
	baseString.append("auth_token"+authToken);
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   215
	baseString.append("filterfriends");
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   216
#ifdef SMF_XMLPARSING
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   217
	baseString.append("formatxml");
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   218
#else
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   219
	baseString.append("formatjson");
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   220
#endif
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   221
	baseString.append("methodflickr.contacts.getList");
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   222
	baseString.append("page"+QString::number(aPageNum));
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   223
	baseString.append("per_page"+QString::number(aItemsPerPage));
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   224
	
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   225
	// Create the url
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   226
	QUrl url("http://api.flickr.com/services/rest/?");
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   227
	url.addQueryItem("api_key", apiKey);
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   228
	url.addQueryItem("auth_token", authToken);
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   229
	url.addQueryItem("filter", "friends");
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   230
#ifdef SMF_XMLPARSING
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   231
	url.addQueryItem("format", "x");
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   232
#else
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   233
	url.addQueryItem("format", "json");
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   234
#endif
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   235
	url.addQueryItem("method", "flickr.contacts.getList");
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   236
	url.addQueryItem("page", QString::number(aPageNum));
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   237
	url.addQueryItem("per_page", QString::number(aItemsPerPage));
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   238
	url.addQueryItem("api_sig", generateSignature(baseString));
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   239
	
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   240
	// Create the request, set the url
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   241
	aRequest.iNetworkRequest.setUrl(url);
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   242
	aRequest.iRequestType = SmfContactGetFollowers;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   243
	aRequest.iPostData = NULL;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   244
	aRequest.iHttpOperationType = QNetworkAccessManager::GetOperation;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   245
	error = SmfPluginErrNone;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   246
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   247
	qDebug()<<"Url string is : "<<aRequest.iNetworkRequest.url().toString();
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   248
	return error; 
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   249
#endif
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
   250
	}
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
   251
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
   252
/**
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
   253
 * Method to search for a contact
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
   254
 * @param aRequest [out] The request data to be sent to network
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
   255
 * @param aContact contact to be searched
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
   256
 * @param aPageNum The page to be extracted
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
   257
 * @param aItemsPerPage Number of items per page
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
   258
 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
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
   259
 */
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
   260
SmfPluginError FlickrContactFetcherPlugin::search( SmfPluginRequestData &aRequest,
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
   261
		const SmfContact &aContact,
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   262
		const int aPageNum , 
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
   263
		const int aItemsPerPage  )
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
   264
	{
23
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   265
#ifndef TESTINGTHISFUNCTION
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
   266
	Q_UNUSED(aRequest)
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   267
	Q_UNUSED(aContact)
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   268
	Q_UNUSED(aPageNum)
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   269
	Q_UNUSED(aItemsPerPage)
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   270
	qDebug()<<"Inside FlickrContactFetcherPlugin::search()";
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   271
	return SmfPluginErrServiceNotSupported; 
23
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   272
#else
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   273
	SmfPluginError error = SmfPluginErrInvalidArguments;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   274
	
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   275
	// Get the key sets from SMF Plugin Utility class.
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   276
	QString apiKey;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   277
	QString apiSecret;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   278
	QString authToken;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   279
	fetchKeys(apiKey, apiSecret, authToken );
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   280
	
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   281
	// Create the API signature string
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   282
	QString baseString;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   283
	baseString.append(apiSecret);
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   284
	baseString.append("api_key"+apiKey);
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   285
	baseString.append("auth_token"+authToken);
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   286
	baseString.append("formatjson");
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   287
	baseString.append("methodflickr.people.findByUsername");
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   288
	//baseString.append("page"+QString::number(aPageNum));
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   289
	//baseString.append("per_page"+QString::number(aItemsPerPage));
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   290
	baseString.append("username"+(aContact.value("Name").value<QContactName>().firstName()));
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   291
	
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   292
	
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   293
	// Create the url
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   294
	QUrl url("http://api.flickr.com/services/rest/?");
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   295
	url.addQueryItem("api_key", apiKey);
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   296
	url.addQueryItem("auth_token", authToken);
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   297
	url.addQueryItem("format", "json");
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   298
	url.addQueryItem("method", "flickr.people.findByUsername");
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   299
	url.addQueryItem("username",aContact.value("Name").value<QContactName>().firstName());
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   300
	//url.addQueryItem("page", QString::number(10));
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   301
	//url.addQueryItem("per_page", QString::number(10));
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   302
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   303
	url.addQueryItem("api_sig", generateSignature(baseString));
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   304
	
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   305
	// Create the request, set the url
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   306
	aRequest.iNetworkRequest.setUrl(url);
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   307
	aRequest.iRequestType = SmfContactSearch;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   308
	aRequest.iPostData = NULL;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   309
	aRequest.iHttpOperationType = QNetworkAccessManager::GetOperation;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   310
	error = SmfPluginErrNone;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   311
//	writeLog("Url string is :"+aRequest.iNetworkRequest.url().toString());
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   312
	return error; 
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   313
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   314
#endif
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
   315
	}
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
   316
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
   317
/**
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
   318
 * Method to search for contacts (friends) who are near the user.
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
   319
 * Proximity defines accuracy level
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
   320
 * @param aRequest [out] The request data to be sent to network
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
   321
 * @param aLocation The location search criteria
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
   322
 * @param aProximity location search boundary
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
   323
 * @param aPageNum The page to be extracted
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
   324
 * @param aItemsPerPage Number of items per page
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
   325
 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
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
   326
 */
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
   327
SmfPluginError FlickrContactFetcherPlugin::searchNear( SmfPluginRequestData &aRequest,
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
   328
		const SmfLocation &aLocation,
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
   329
		const SmfLocationSearchBoundary &aProximity,
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   330
		const int aPageNum , 
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
   331
		const int aItemsPerPage  )
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
   332
	{
23
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   333
#ifndef TESTINGTHISFUNCTION
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
   334
	Q_UNUSED(aRequest)
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   335
	Q_UNUSED(aLocation)
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   336
	Q_UNUSED(aProximity)
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   337
	Q_UNUSED(aPageNum)
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   338
	Q_UNUSED(aItemsPerPage)
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   339
	qDebug()<<"Inside FlickrContactFetcherPlugin::searchNear()";
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   340
	return SmfPluginErrServiceNotSupported; 
23
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   341
#else
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   342
	SmfPluginError error = SmfPluginErrInvalidArguments;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   343
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   344
	// invalid arguments
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   345
	if( aPageNum < 0 || aItemsPerPage < 0 )
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   346
		{
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   347
		qDebug()<<"Invalid arguments";
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   348
		return error;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   349
		}
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   350
	
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   351
	qDebug()<<"Valid arguments";
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   352
	
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   353
	// Get the key sets from SMF Plugin Utility class.
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   354
	QString apiKey;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   355
	QString apiSecret;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   356
	QString authToken;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   357
	fetchKeys(apiKey, apiSecret, authToken );
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   358
	
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   359
	// Create the API signature string
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   360
	QString baseString;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   361
	baseString.append(apiSecret);
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   362
	baseString.append("api_key"+apiKey);
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   363
	baseString.append("auth_token"+authToken);
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   364
	baseString.append("filterfriends");
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   365
#ifdef SMF_XMLPARSING
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   366
	baseString.append("formatxml");
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   367
#else
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   368
	baseString.append("formatjson");
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   369
#endif
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   370
	baseString.append("methodflickr.contacts.getList");
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   371
	baseString.append("page"+QString::number(aPageNum));
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   372
	baseString.append("per_page"+QString::number(aItemsPerPage));
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   373
	
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   374
	// Create the url
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   375
	QUrl url("http://api.flickr.com/services/rest/?");
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   376
	url.addQueryItem("api_key", apiKey);
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   377
	url.addQueryItem("auth_token", authToken);
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   378
	url.addQueryItem("filter", "friends");
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   379
#ifdef SMF_XMLPARSING
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   380
	url.addQueryItem("format", "x");
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   381
#else
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   382
	url.addQueryItem("format", "json");
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   383
#endif
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   384
	url.addQueryItem("method", "flickr.contacts.getList");
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   385
	url.addQueryItem("page", QString::number(aPageNum));
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   386
	url.addQueryItem("per_page", QString::number(aItemsPerPage));
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   387
	url.addQueryItem("api_sig", generateSignature(baseString));
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   388
	
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   389
	// Create the request, set the url
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   390
	aRequest.iNetworkRequest.setUrl(url);
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   391
	aRequest.iRequestType = SmfContactSearchNear;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   392
	aRequest.iPostData = NULL;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   393
	aRequest.iHttpOperationType = QNetworkAccessManager::GetOperation;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   394
	error = SmfPluginErrNone;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   395
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   396
	qDebug()<<"Url string is : "<<aRequest.iNetworkRequest.url().toString();
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   397
	return error; 
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   398
#endif
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
   399
	}
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
   400
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
   401
/**
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
   402
 * Method to get the list of groups
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
   403
 * @param aRequest [out] The request data to be sent to network
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
   404
 * @param aPageNum The page to be extracted
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
   405
 * @param aItemsPerPage Number of items per page
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
   406
 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
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
   407
 */
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
   408
SmfPluginError FlickrContactFetcherPlugin::groups( SmfPluginRequestData &aRequest,
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   409
		const int aPageNum , 
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
   410
		const int aItemsPerPage  )
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
   411
	{
26
83d6a149c755 Submitting following changes -
cgandhi
parents: 23
diff changeset
   412
	Q_UNUSED(aPageNum)
83d6a149c755 Submitting following changes -
cgandhi
parents: 23
diff changeset
   413
	Q_UNUSED(aItemsPerPage)
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   414
	qDebug()<<"Inside FlickrContactFetcherPlugin::groups()";
23
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   415
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   416
	SmfPluginError error = SmfPluginErrInvalidArguments;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   417
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   418
	// invalid arguments
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   419
		/*if( aPageNum < 0 || aItemsPerPage < 0 )
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   420
			{
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   421
			qDebug()<<"Invalid arguments";
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   422
			return error;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   423
			}*/
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   424
	// Get the key sets from SMF Plugin Utility class.
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   425
	QString apiKey;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   426
	QString apiSecret;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   427
	QString authToken;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   428
	fetchKeys(apiKey, apiSecret, authToken );
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   429
	
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   430
	// Create the API signature string
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   431
	QString baseString;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   432
	baseString.append(apiSecret);
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   433
	baseString.append("api_key"+apiKey);
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   434
	baseString.append("auth_token"+authToken);
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   435
	baseString.append("formatjson");
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   436
	baseString.append("methodflickr.groups.pools.getGroups");
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   437
	
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   438
	// Create the url
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   439
	QUrl url("http://api.flickr.com/services/rest/?");
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   440
	url.addQueryItem("api_key", apiKey);
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   441
	url.addQueryItem("auth_token", authToken);
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   442
	url.addQueryItem("format", "json");
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   443
	url.addQueryItem("method","flickr.groups.pools.getGroups");
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   444
	url.addQueryItem("api_sig", generateSignature(baseString));
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   445
		
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   446
	// Create the request, set the url
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   447
	aRequest.iNetworkRequest.setUrl(url);
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   448
	aRequest.iRequestType = SmfContactGetGroups;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   449
	aRequest.iPostData = NULL;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   450
	aRequest.iHttpOperationType = QNetworkAccessManager::GetOperation;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   451
	error = SmfPluginErrNone;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   452
//	writeLog("Url string is : "+aRequest.iNetworkRequest.url().toString());
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   453
	return error; 
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
   454
	}
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
   455
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
   456
/**
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
   457
 * Method to search for a contact in a group
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
   458
 * @param aRequest [out] The request data to be sent to network
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
   459
 * @param aGroup the group in which to search
23
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   460
 * @param aContact The contact to be searched, default (NULL) is the self contact.
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
   461
 * @param aPageNum The page to be extracted
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
   462
 * @param aItemsPerPage Number of items per page
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
   463
 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
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
   464
 */
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
   465
SmfPluginError FlickrContactFetcherPlugin::searchInGroup( SmfPluginRequestData &aRequest,
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
   466
		const SmfGroup &aGroup,
23
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   467
		SmfContact *aContact,
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   468
		const int aPageNum , 
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
   469
		const int aItemsPerPage  )
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
   470
	{
26
83d6a149c755 Submitting following changes -
cgandhi
parents: 23
diff changeset
   471
	Q_UNUSED(aContact)
23
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   472
#ifndef TESTINGTHISFUNCTION
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
   473
	Q_UNUSED(aRequest)
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   474
	Q_UNUSED(aGroup)
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   475
	Q_UNUSED(aPageNum)
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   476
	Q_UNUSED(aItemsPerPage)
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   477
	qDebug()<<"Inside FlickrContactFetcherPlugin::searchInGroup()";
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   478
	return SmfPluginErrServiceNotSupported; 
23
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   479
#else
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   480
	SmfPluginError error = SmfPluginErrInvalidArguments;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   481
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   482
	// invalid arguments
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   483
	if( aPageNum < 0 || aItemsPerPage < 0 )
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   484
		{
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   485
		qDebug()<<"Invalid arguments";
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   486
		return error;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   487
		}
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   488
	
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   489
	qDebug()<<"Valid arguments";
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   490
	
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   491
	// Get the key sets from SMF Plugin Utility class.
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   492
	QString apiKey;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   493
	QString apiSecret;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   494
	QString authToken;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   495
	fetchKeys(apiKey, apiSecret, authToken );
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   496
	
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   497
	// Create the API signature string
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   498
	QString baseString;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   499
	baseString.append(apiSecret);
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   500
	baseString.append("api_key"+apiKey);
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   501
	baseString.append("auth_token"+authToken);
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   502
	baseString.append("filterfriends");
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   503
#ifdef SMF_XMLPARSING
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   504
	baseString.append("formatxml");
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   505
#else
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   506
	baseString.append("formatjson");
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   507
#endif
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   508
	baseString.append("methodflickr.contacts.getList");
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   509
	baseString.append("page"+QString::number(aPageNum));
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   510
	baseString.append("per_page"+QString::number(aItemsPerPage));
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   511
	
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   512
	// Create the url
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   513
	QUrl url("http://api.flickr.com/services/rest/?");
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   514
	url.addQueryItem("api_key", apiKey);
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   515
	url.addQueryItem("auth_token", authToken);
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   516
	url.addQueryItem("filter", "friends");
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   517
#ifdef SMF_XMLPARSING
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   518
	url.addQueryItem("format", "x");
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   519
#else
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   520
	url.addQueryItem("format", "json");
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   521
#endif
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   522
	url.addQueryItem("method", "flickr.contacts.getList");
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   523
	url.addQueryItem("page", QString::number(aPageNum));
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   524
	url.addQueryItem("per_page", QString::number(aItemsPerPage));
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   525
	url.addQueryItem("api_sig", generateSignature(baseString));
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   526
	
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   527
	// Create the request, set the url
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   528
	aRequest.iNetworkRequest.setUrl(url);
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   529
	aRequest.iRequestType = SmfContactSearchInGroup;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   530
	aRequest.iPostData = NULL;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   531
	aRequest.iHttpOperationType = QNetworkAccessManager::GetOperation;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   532
	error = SmfPluginErrNone;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   533
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   534
	qDebug()<<"Url string is : "<<aRequest.iNetworkRequest.url().toString();
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   535
	return error; 
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   536
#endif
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
   537
	}
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
   538
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
   539
/**
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
   540
 * Customised method for SmfContactFetcherPlugin 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
   541
 * @param aRequest [out] The request data to be sent to network
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   542
 * @param aOperation The operation type (should be known between 
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
   543
 * the client interface and the plugin)
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   544
 * @param aData The data required to form the request (The type 
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
   545
 * of data should be known between client and the plugin)
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
   546
 * @return SmfPluginError Plugin error if any, else SmfPluginErrNone
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
   547
 */
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   548
SmfPluginError FlickrContactFetcherPlugin::customRequest( SmfPluginRequestData &aRequest, 
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
   549
		const int &aOperation, QByteArray *aData )
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
   550
	{
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
   551
	Q_UNUSED(aRequest)
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   552
	Q_UNUSED(aOperation)
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   553
	Q_UNUSED(aData)
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   554
	qDebug()<<"Inside FlickrContactFetcherPlugin::customRequest()";
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   555
	return SmfPluginErrServiceNotSupported; 
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
   556
	}
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
   557
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
   558
/**
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
   559
 * The first method to be called in the plugin that implements this 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
   560
 * If this method is not called, plugin may not behave as expected.
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
   561
 */
17
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   562
void FlickrContactFetcherPlugin::initialize( )
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
   563
	{
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
   564
	// Create an instance of FlickrProviderBase
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
   565
	m_provider = new FlickrProviderBase;
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
   566
	m_provider->initialize();
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
   567
	}
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
   568
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
   569
/**
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
   570
 * Method to get the provider information
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
   571
 * @return Instance of SmfProviderBase
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
   572
 */
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
   573
SmfProviderBase* FlickrContactFetcherPlugin::getProviderInfo( )
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
   574
	{
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
   575
	return m_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
   576
	}
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
   577
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
   578
/**
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
   579
 * Method to get the result for a network request.
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   580
 * @param aOperation The type of operation to be requested
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
   581
 * @param aTransportResult The result of transport operation
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
   582
 * @param aResponse The QByteArray instance containing the network response.
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   583
 * The plugins should delete this instance once they have read the 
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
   584
 * data from it.
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   585
 * @param aResult [out] An output parameter to the plugin manager.If the 
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   586
 * return value is SmfSendRequestAgain, QVariant will be of type 
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
   587
 * SmfPluginRequestData.
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   588
 * For SmfGalleryPlugin: If last operation was pictures(), aResult will 
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   589
 * be of type QList<SmfPicture>. If last operation was description(), 
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   590
 * aResult will be of type QString. If last operation was upload() or 
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
   591
 * postComment(), aResult will be of type bool.
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
   592
 * @param aRetType [out] SmfPluginRetType
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
   593
 * @param aPageResult [out] The SmfResultPage structure variable
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
   594
 */
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   595
SmfPluginError FlickrContactFetcherPlugin::responseAvailable( 
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   596
		const SmfRequestTypeID aOperation,
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   597
		const SmfTransportResult &aTransportResult, 
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   598
		QByteArray *aResponse, 
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   599
		QVariant* aResult, 
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
   600
		SmfPluginRetType &aRetType,
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
   601
		SmfResultPage &aPageResult )
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
   602
	{
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
   603
	Q_UNUSED(aPageResult)
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   604
	qDebug()<<"Inside FlickrContactFetcherPlugin::responseAvailable()";
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   605
	
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   606
	SmfPluginError error = SmfPluginErrNetworkError;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   607
	
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   608
	if( !aResponse || (0 == aResponse->size()) )
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   609
		{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   610
		qDebug()<<"Response is NULL or empty";
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   611
		aRetType = SmfRequestError;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   612
		return error;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   613
		}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   614
	
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   615
	QByteArray response(*aResponse);
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   616
	delete aResponse;
17
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   617
	
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   618
	QFile respFile("c://data//SmfPluginFlickrContactResponse.txt");
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   619
	if(!respFile.open(QIODevice::WriteOnly))
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   620
		{
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   621
		qDebug()<<"File to write the response could not be opened, so writing to this file";
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   622
		qDebug()<<"Flickr response = "<<QString(response);
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   623
		}
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   624
	else
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   625
		{
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   626
		respFile.write(response);
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   627
		respFile.close();
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   628
		qDebug()<<"Writing FB response to a file named 'SmfPluginFlickrContactResponse.txt'";
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   629
		}
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   630
	qDebug()<<"FB response size = "<<response.size();
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   631
	
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
   632
	if(SmfTransportOpNoError == aTransportResult)
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
   633
		{
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   634
		qDebug()<<"No transport error";
26
83d6a149c755 Submitting following changes -
cgandhi
parents: 23
diff changeset
   635
23
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   636
#ifndef TESTINGTHISFUNCTION	
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   637
		if(SmfContactGetFriends == aOperation)
23
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   638
#else
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   639
		if(SmfContactGetFriends == aOperation ||aOperation == SmfContactGetFollowers||aOperation== SmfContactSearch ||aOperation ==SmfContactSearchNear||aOperation ==SmfContactSearchInGroup)
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   640
#endif
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   641
			{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   642
			qDebug()<<"For getting friends response";
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   643
			
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   644
			QList<SmfContact> list;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   645
			
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   646
#ifdef SMF_XMLPARSING // Xml parsing
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   647
			// For getting contacts from xml response
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   648
			QXmlStreamReader xml(response);
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   649
			while (!xml.atEnd())
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   650
				{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   651
				xml.readNext();
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   652
				if (xml.tokenType() == QXmlStreamReader::StartElement)
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   653
					{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   654
					// If the tag is contact
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   655
					if (xml.name() == "contact")
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   656
						{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   657
						qDebug()<<"Contact tag found";
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   658
						SmfContact contact;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   659
						QStringRef str;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   660
						QContactName contactname;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   661
						QString username = xml.attributes().value("username").toString();
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   662
						qDebug()<<"Username = "<<username;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   663
						contactname.setFirstName(username);
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   664
						contactname.setLastName(username);
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   665
						QVariant namevar1 = QVariant::fromValue(contactname);
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   666
						contact.setValue("Name",namevar1);
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   667
						list.append(contact);
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   668
						}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   669
					}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   670
				}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   671
#else
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   672
			// To remove the "jsonFlickrApi(" and also remove the last ")" from the response,
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   673
			// as these gives a Json parsing error
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   674
			response.remove(0, 14);
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   675
			response.chop(1);
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   676
			
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   677
			// For getting contacts from json response
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   678
			bool ok;
17
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   679
			SmfPluginUtil util;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   680
			QVariantMap result = util.parse(response, &ok).toMap();
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   681
			if (!ok) {
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   682
				qDebug()<<"An error occurred during json parsing";
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   683
				aResult->setValue(list);
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   684
				aRetType = SmfRequestError;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   685
				return SmfPluginErrParsingFailed;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   686
			}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   687
			
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   688
			QVariantMap map1 = result["contacts"].toMap();
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   689
			qDebug()<<"page = "<<map1["page"].toString();
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   690
			qDebug()<<"pages = "<<map1["pages"].toString();
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   691
			qDebug()<<"per_page = "<<map1["per_page"].toString();
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   692
			qDebug()<<"perpage = "<<map1["perpage"].toString();
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   693
			qDebug()<<"total = "<<map1["perpage"].toString();
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   694
			
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   695
			QList<QVariant> list1 = map1["contact"].toList();
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   696
			
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   697
			QListIterator<QVariant> i(list1);
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   698
			while(i.hasNext())
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   699
				{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   700
				SmfContact contact;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   701
				QVariantMap map2 = i.next().toMap();
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   702
				qDebug()<<"nsid = "<<map2["nsid"].toString();
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   703
				qDebug()<<"username = "<<map2["username"].toString();
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   704
				qDebug()<<"iconserver = "<<map2["iconserver"].toString();
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   705
				qDebug()<<"iconfarm = "<<map2["iconfarm"].toString();
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   706
				qDebug()<<"ignored = "<<map2["ignored"].toString();
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   707
				qDebug()<<"realname = "<<map2["realname"].toString();
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   708
				qDebug()<<"friend = "<<map2["friend"].toString();
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   709
				qDebug()<<"family = "<<map2["family"].toString();
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   710
				qDebug()<<"path_alias = "<<map2["path_alias"].toString();
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   711
				qDebug()<<"location = "<<map2["location"].toString();
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   712
				
17
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   713
				// Contact Name
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   714
				QContactName contactname;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   715
				QString username = map2["username"].toString();
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   716
				qDebug()<<"Username = "<<username;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   717
				contactname.setFirstName(username);
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   718
				contactname.setLastName(username);
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   719
				QVariant nameVar = QVariant::fromValue(contactname);
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   720
				contact.setValue("Name",nameVar);
17
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   721
				
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   722
				// Contact's Flickr Specific ID to QContactGuid
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   723
				QContactGuid guid;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   724
				guid.setGuid(map2["nsid"].toString());
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   725
				QVariant guidVar = QVariant::fromValue(guid);
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   726
				contact.setValue("Guid",guidVar);
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   727
					
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   728
				// Contact's profile image url
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   729
				QUrl url;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   730
				if((0 == map2["iconfarm"].toInt()) && (0 == map2["iconserver"].toInt()))
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   731
					url = QString("http://www.flickr.com/images/buddyicon.jpg");
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   732
				else
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   733
					{
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   734
					QString str("http://farm");
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   735
					str.append(map2["iconfarm"].toString());
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   736
					str.append(".static.flickr.com/");
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   737
					str.append(map2["iconserver"].toString());
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   738
					str.append("/buddyicons/");
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   739
					str.append(map2["nsid"].toString());
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   740
					str.append(".jpg");
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   741
					url = str;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   742
					}
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   743
				QContactAvatar avatar;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   744
				qDebug()<<"Profile image URL = "<<url.toString();
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   745
				avatar.setImageUrl(url);
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   746
				QVariant avatarVar = QVariant::fromValue(avatar);
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   747
				contact.setValue("Avatar",avatarVar);
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   748
				
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   749
				
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   750
				list.append(contact);
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   751
				}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   752
#endif
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   753
			
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   754
			qDebug()<<"list count = "<<list.count();
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
   755
			aResult->setValue(list);
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   756
			aRetType = SmfRequestComplete;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   757
			error = SmfPluginErrNone;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   758
			}
23
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   759
		else if(aOperation==SmfContactGetGroups)
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   760
			{
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   761
		        response.remove(0, 14);
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   762
				response.chop(1);
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   763
			
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   764
			    bool ok;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   765
				qDebug()<<"Before Parser--";
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   766
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   767
				SmfPluginUtil util;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   768
				QVariant result = util.parse(response, &ok);
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   769
				if (!ok) 
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   770
				{
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   771
				    qDebug()<<"An error occurred during json parsing";
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   772
					aRetType = SmfRequestError;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   773
					return SmfPluginErrParsingFailed;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   774
								 //return 0;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   775
				}
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   776
							
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   777
				QVariantMap map1 = result.toMap();
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   778
		        QList<SmfGroup> list;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   779
				QVariantMap map2 = map1["groups"].toMap();
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   780
				int page = map2["page"].toInt(&ok);
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   781
				qDebug()<<"PAGE = "<<map2["page"].toString();
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   782
				QList<QVariant> list1 = map2["group"].toList();
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   783
				QListIterator<QVariant> iter(list1);
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   784
						
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   785
				//Getting the group list from QJson Parser 
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   786
				 while(iter.hasNext())
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   787
				 {
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   788
					QVariantMap map2 = iter.next().toMap();
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   789
					qDebug()<<"name = "<<map2["name"].toString();
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   790
					qDebug()<<"id = "<<map2["id"].toString();
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   791
					SmfGroup group;
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   792
					QString id(map2["id"].toString());
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   793
					group.setId(id);
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   794
					QString grpname(map2["name"].toString());
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   795
					group.setName(grpname);
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   796
						   
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   797
					list.append(group);
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   798
						   
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   799
				 }//end While
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   800
				 qDebug()<<"list count = "<<QString::number(list.count(),10);
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   801
				aResult->setValue(list);
574948b60dab updating the lastfm music plugins and adding the smfhelp.chm
cgandhi
parents: 17
diff changeset
   802
			}
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   803
		else
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   804
			{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   805
			qDebug()<<"Service unsupported, currently only SmfContactGetFriends !!!";
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   806
			aRetType = SmfRequestError;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   807
			error = SmfPluginErrServiceNotSupported;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   808
			}
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
   809
		}
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
   810
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   811
	else if(SmfTransportOpOperationCanceledError == aTransportResult)
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   812
		{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   813
		qDebug()<<"Operation Cancelled !!!";
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   814
		error = SmfPluginErrCancelComplete;
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
   815
		aRetType = SmfRequestComplete;
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
   816
		}
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
   817
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
   818
	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
   819
		{
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   820
		qDebug()<<"Transport Error !!!";
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   821
		error = SmfPluginErrNetworkError;
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
   822
		aRetType = SmfRequestError;
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
   823
		}
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   824
	
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
   825
	return 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
   826
	}
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
   827
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
   828
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
   829
/**
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
   830
 * Destructor
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
   831
 */
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
   832
FlickrProviderBase::~FlickrProviderBase( )
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
   833
	{
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
   834
	}
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
   835
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
   836
/**
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
   837
 * Method to get the Localisable name of the 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
   838
 * @return The Localisable name of the 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
   839
 */
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
   840
QString FlickrProviderBase::serviceName( ) 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
   841
	{
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
   842
	return m_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
   843
	}
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
   844
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
   845
/**
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
   846
 * Method to get the Logo of the 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
   847
 * @return The Logo of the 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
   848
 */
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
   849
QImage FlickrProviderBase::serviceIcon( ) 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
   850
	{
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
   851
	return m_serviceIcon;
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
   852
	}
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
   853
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
   854
/**
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
   855
 * Method to get the Readable service 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
   856
 * @return The Readable service 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
   857
 */
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
   858
QString FlickrProviderBase::description( ) 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
   859
	{
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
   860
	return 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
   861
	}
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
   862
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
   863
/**
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
   864
 * Method to get the Website of the 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
   865
 * @return The Website of the 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
   866
 */
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
   867
QUrl FlickrProviderBase::serviceUrl( ) 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
   868
	{
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
   869
	return m_serviceUrl;
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
   870
	}
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
   871
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
   872
/**
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
   873
 * Method to get the URL of the Application providing this 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
   874
 * @return The URL of the Application providing this 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
   875
 */
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
   876
QUrl FlickrProviderBase::applicationUrl( ) 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
   877
	{
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
   878
	return m_applicationUrl;
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
   879
	}
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
   880
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
   881
/**
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
   882
 * Method to get the Icon of the application
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
   883
 * @return The Icon of the application
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
   884
 */
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
   885
QImage FlickrProviderBase::applicationIcon( ) 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
   886
	{
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
   887
	return m_applicationIcon;
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
   888
	}
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
   889
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
   890
/**
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   891
* Method to get the list of interfaces that this provider support
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   892
* @return List of supported Interafces
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   893
*/
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   894
QList<QString> FlickrProviderBase::supportedInterfaces( ) const
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   895
	{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   896
	return m_supportedInterfaces;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   897
	}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   898
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   899
/**
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   900
* Method to get the list of languages supported by this service provider
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   901
* @return a QStringList of languages supported by this service 
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   902
* provider in 2 letter ISO 639-1 format.
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   903
*/
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   904
QStringList FlickrProviderBase::supportedLanguages( ) const
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   905
	{
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   906
	return m_supportedLangs;
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   907
	}
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   908
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   909
/**
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
   910
 * Method to get the Plugin specific ID
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
   911
 * @return The Plugin specific ID
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
   912
 */
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
   913
QString FlickrProviderBase::pluginId( ) 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
   914
	{
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
   915
	return m_pluginId;
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
   916
	}
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
   917
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
   918
/**
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   919
 * Method to get the ID of the authentication application 
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
   920
 * for this 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
   921
 * @param aProgram The authentication application 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
   922
 * @param aArguments List of arguments required for authentication app
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
   923
 * @param aMode Strting mode for authentication application
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   924
 * @return The ID of the authentication application 
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
   925
 */
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   926
QString FlickrProviderBase::authenticationApp( QString &aProgram, 
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   927
		QStringList & aArguments, 
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
   928
		QIODevice::OpenModeFlag aMode ) 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
   929
	{
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
   930
	Q_UNUSED(aProgram)
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   931
	Q_UNUSED(aArguments)
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   932
	Q_UNUSED(aMode)
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
   933
	return m_authAppId;
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
   934
	}
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
   935
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
   936
/**
26
83d6a149c755 Submitting following changes -
cgandhi
parents: 23
diff changeset
   937
 * Method to get the authentication application process name
83d6a149c755 Submitting following changes -
cgandhi
parents: 23
diff changeset
   938
 * @return The authentication application process name (eg: "FlickrAuthApp.exe")
83d6a149c755 Submitting following changes -
cgandhi
parents: 23
diff changeset
   939
 */
83d6a149c755 Submitting following changes -
cgandhi
parents: 23
diff changeset
   940
QString FlickrProviderBase::authenticationAppName( ) const
83d6a149c755 Submitting following changes -
cgandhi
parents: 23
diff changeset
   941
	{
83d6a149c755 Submitting following changes -
cgandhi
parents: 23
diff changeset
   942
	return m_authAppName;
83d6a149c755 Submitting following changes -
cgandhi
parents: 23
diff changeset
   943
	}
83d6a149c755 Submitting following changes -
cgandhi
parents: 23
diff changeset
   944
83d6a149c755 Submitting following changes -
cgandhi
parents: 23
diff changeset
   945
/**
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   946
 * Method to get the unique registration ID provided by the 
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
   947
 * Smf for authorised plugins
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   948
 * @return The unique registration ID/token provided by the Smf for 
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
   949
 * authorised plugins
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
   950
 */
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
   951
QString FlickrProviderBase::smfRegistrationId( ) 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
   952
	{
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
   953
	return m_smfRegToken;
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
   954
	}
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
   955
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
   956
void FlickrProviderBase::initialize()
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
   957
	{
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
   958
	m_serviceName = "Flickr";
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   959
	m_description = "Flickr contact fetcher plugin description";
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
   960
	m_serviceUrl = QUrl(QString("http://api.flickr.com"));
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
   961
	m_pluginId = "flickrcontactfetcherplugin.qtplugin";
17
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   962
	m_authAppId = "0xE1D8C7D7";
26
83d6a149c755 Submitting following changes -
cgandhi
parents: 23
diff changeset
   963
	m_authAppName = "Flickr.exe";
14
a469c0e6e7fb changes for SmfPost, SmfCredentialMgr, PLuginManager, SmfServer. Adding Sample Plugins and Sample Client Applications.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 6
diff changeset
   964
	m_supportedInterfaces.append("org.symbian.smf.plugin.contact.fetcher/v0.2");
17
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   965
	QSettings iSettings;
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   966
	m_smfRegToken = iSettings.value("CMFlickrRegToken").toString();
106a4bfcb866 pushing the flickr auth app and gallery plugins
cgandhi
parents: 14
diff changeset
   967
	m_validity = iSettings.value("FlckrExpiryTime").toDateTime();
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
   968
	}
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
   969
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
   970
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
   971
/*
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
   972
 * Export Macro
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
   973
 * plugin name : flickrcontactfetcherplugin
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
   974
 * plugin class : FlickrContactFetcherPlugin
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
   975
 */
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
   976
Q_EXPORT_PLUGIN2( flickrcontactfetcherplugin, FlickrContactFetcherPlugin )
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
   977