# HG changeset patch # User cgandhi # Date 1281006997 -19800 # Node ID 106a4bfcb866babb4447e3781d60205a11e1fa66 # Parent b78fa4cdbf2bdf4105ff71b0dcd86735cab593f6 pushing the flickr auth app and gallery plugins diff -r b78fa4cdbf2b -r 106a4bfcb866 example/AuthApp/AuthApp.cpp --- a/example/AuthApp/AuthApp.cpp Thu Aug 05 16:35:33 2010 +0530 +++ b/example/AuthApp/AuthApp.cpp Thu Aug 05 16:46:37 2010 +0530 @@ -19,19 +19,23 @@ #include #include +#include "keys.h" AuthApp::AuthApp(QWidget *parent) : QMainWindow(parent), ui(new Ui::AuthAppClass) { + qDebug()<<"Inside AuthApp::AuthApp()"; ui->setupUi(this); //iFBSession = FBSession::sessionForApplication("df51def3e750a350ddb961a70b5ab5ab", "3b86a756f77967dea4674f080fa5d345", QString()); - iFBSession = FBSession::sessionForApplication("ed6d6d36813f0fbae8061776beb68daf", "fb10f1c758fc285b2a6113344ef4c893", QString()); //NArasimha's APP - //iFBSession = FBSession::sessionForApplication("077fd6b8881f39c2dc23207323cca439", "cb13436999afde9338ecd8b0bfb82508", QString()); //Nalina's App + //iFBSession = FBSession::sessionForApplication("ed6d6d36813f0fbae8061776beb68daf", "fb10f1c758fc285b2a6113344ef4c893", QString()); //NArasimha's APP + iFBSession = FBSession::sessionForApplication(kApiKey,kApiSecret, QString()); //Nalina's App + //iFBSession = FBSession::sessionForApplication("114354298600019", "fb10f1c758fc285b2a6113344ef4c893", QString());//Sid's App + //iFBSession = FBSession::sessionForApplication("283d4e964b2754505cbbcf69c1d68f3c", "eb8723a3b5921250df442f9695e6bd29", QString());//Sid's App connect (iFBSession,SIGNAL(sessionDidLogin(QString)), this, SLOT(sessionDidLogin(QString))); connect (iFBSession, SIGNAL(sessionDidLogout()), this, SLOT(sessionDidLogout())); - CheckforLogin(); + //CheckforLogin(); } AuthApp::~AuthApp() @@ -53,6 +57,7 @@ } void AuthApp::CheckforLogin() { + qDebug()<<"Inside AuthApp::CheckforLogin()"; iLoginDialog = NULL; if ( !( iFBSession->resume() ) ){ ui->buttonForget->setDisabled(true); @@ -61,12 +66,13 @@ } void AuthApp::on_pushButton_clicked() { + qDebug()<<"Inside AuthApp::on_pushButton_clicked()"; iLoginDialog = new FBLoginDialog(); iLoginDialog->show(); } void AuthApp::sessionDidLogin(QString sessionkey) { - + qDebug()<<"Inside AuthApp::sessionDidLogin()"; if (iLoginDialog ) { QMessageBox msgbox; @@ -89,6 +95,7 @@ void AuthApp::sessionDidLogout() { + qDebug()<<"Inside AuthApp::sessionDidLogout()"; QMessageBox msgbox; msgbox.setText("logged out successfully!!"); msgbox.exec(); @@ -104,5 +111,6 @@ void AuthApp::on_buttonForget_clicked() { + qDebug()<<"Inside AuthApp::on_buttonForget_clicked()"; iFBSession->logout(); } diff -r b78fa4cdbf2b -r 106a4bfcb866 example/AuthApp/AuthApp.loc --- a/example/AuthApp/AuthApp.loc Thu Aug 05 16:35:33 2010 +0530 +++ b/example/AuthApp/AuthApp.loc Thu Aug 05 16:46:37 2010 +0530 @@ -1,5 +1,5 @@ // ============================================================================ -// * Generated by qmake (2.01a) (Qt 4.6.3) on: 2010-06-22T14:10:40 +// * Generated by qmake (2.01a) (Qt 4.6.2) on: 2010-07-30T14:11:44 // * This file is generated by qmake and should not be modified by the // * user. // ============================================================================ diff -r b78fa4cdbf2b -r 106a4bfcb866 example/AuthApp/AuthApp.pkg --- a/example/AuthApp/AuthApp.pkg Thu Aug 05 16:35:33 2010 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +0,0 @@ -; Installation file for AuthApp GUI App -; -; This is an auto-generated PKG file by Carbide. -; This file uses variables specific to Carbide builds that will not work -; on command-line builds. If you want to use this generated PKG file from the -; command-line tools you will need to modify the variables with the appropriate -; values: $(EPOCROOT), $(PLATFORM), $(TARGET) -; -;Language - standard language definitions -&EN - -; standard SIS file header -#{"AuthApp"},(0xEFE2FD23),1,0,0 - -;Localised Vendor name -%{"Vendor-EN"} - -;Unique Vendor name -:"Vendor" - -;Supports Series 60 v 3.0 -[0x101F7961], 0, 0, 0, {"Series60ProductID"} - -;Files to install -; -"$(EPOCROOT)Epoc32\release\$(PLATFORM)\$(TARGET)\AuthApp.exe" -"!:\sys\bin\AuthApp.exe" -"$(EPOCROOT)Epoc32\data\z\private\10003a3f\import\apps\AuthApp_reg.rsc" -"!:\private\10003a3f\import\apps\AuthApp_reg.rsc" - -; Add any installation notes if applicable -;"AuthApp.txt" -"!:\private\EFE2FD23\AuthApp.txt" - -;required for application to be covered by backup/restore facility -"backup_registration.xml" -"!:\private\EFE2FD23\backup_registration.xml" - diff -r b78fa4cdbf2b -r 106a4bfcb866 example/AuthApp/AuthApp.pro --- a/example/AuthApp/AuthApp.pro Thu Aug 05 16:35:33 2010 +0530 +++ b/example/AuthApp/AuthApp.pro Thu Aug 05 16:46:37 2010 +0530 @@ -6,7 +6,8 @@ webkit \ xml LIBS += -lsmfcredmgrclient -HEADERS += progressbar.h \ +HEADERS += inc/keys.h \ + progressbar.h \ inc/requestSP.h \ inc/xmlParser.h \ inc/sessionSP.h \ @@ -27,7 +28,8 @@ AuthApp.ui RESOURCES += symbian: { + TARGET.EPOCHEAPSIZE = 0x020000 \ + 0x3200000 TARGET.UID3 = 0xEFE2FD23 # Symbian specific, unprotected uid3 from symbiansigned.com TARGET.CAPABILITY = NetworkServices # Symbian specific, we just need network access - #ICON = smfdemo.svg } diff -r b78fa4cdbf2b -r 106a4bfcb866 example/AuthApp/AuthApp.rss --- a/example/AuthApp/AuthApp.rss Thu Aug 05 16:35:33 2010 +0530 +++ b/example/AuthApp/AuthApp.rss Thu Aug 05 16:46:37 2010 +0530 @@ -1,5 +1,5 @@ // ============================================================================ -// * Generated by qmake (2.01a) (Qt 4.6.3) on: 2010-06-22T14:10:40 +// * Generated by qmake (2.01a) (Qt 4.6.2) on: 2010-07-30T14:11:44 // * This file is generated by qmake and should not be modified by the // * user. // ============================================================================ diff -r b78fa4cdbf2b -r 106a4bfcb866 example/AuthApp/AuthApp_installer.pkg --- a/example/AuthApp/AuthApp_installer.pkg Thu Aug 05 16:35:33 2010 +0530 +++ b/example/AuthApp/AuthApp_installer.pkg Thu Aug 05 16:46:37 2010 +0530 @@ -1,11 +1,10 @@ -; AuthApp_installer.pkg generated by qmake at 2010-06-22T14:10:40 +; AuthApp_installer.pkg generated by qmake at 2010-07-30T14:11:44 ; This file is generated by qmake and should not be modified by the user ; ; Language &EN - ; SIS header: name, uid, version #{"AuthApp installer"},(0xA000D7CE),1,0,0 @@ -17,15 +16,15 @@ ; Manual PKG pre-rules from PRO files -; Dependency to Qt Webkit -; Default dependency to Qt libraries ; Default HW/platform dependencies [0x101F7961],0,0,0,{"S60ProductID"} [0x102032BE],0,0,0,{"S60ProductID"} [0x102752AE],0,0,0,{"S60ProductID"} [0x1028315F],0,0,0,{"S60ProductID"} +; Default dependency to Qt libraries +; Dependency to Qt Webkit -"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/SMFCode/smf_baseline_22june_latest/example/AuthApp/AuthApp.sis" - "c:\adm\AuthApp.sis" -@"F:/Qt/4.6.3/smartinstaller.sis",(0x2002CCCD) +"D:/smf/MissingCode/smfrepo/example/AuthApp/AuthApp.sis" - "c:\adm\AuthApp.sis" +@"D:/Qt/4.6.2/smartinstaller.sis",(0x2002CCCD) diff -r b78fa4cdbf2b -r 106a4bfcb866 example/AuthApp/AuthApp_reg.rss --- a/example/AuthApp/AuthApp_reg.rss Thu Aug 05 16:35:33 2010 +0530 +++ b/example/AuthApp/AuthApp_reg.rss Thu Aug 05 16:46:37 2010 +0530 @@ -1,5 +1,5 @@ // ============================================================================ -// * Generated by qmake (2.01a) (Qt 4.6.3) on: 2010-06-22T14:10:40 +// * Generated by qmake (2.01a) (Qt 4.6.2) on: 2010-07-30T14:11:44 // * This file is generated by qmake and should not be modified by the // * user. // ============================================================================ diff -r b78fa4cdbf2b -r 106a4bfcb866 example/AuthApp/AuthApp_template.pkg --- a/example/AuthApp/AuthApp_template.pkg Thu Aug 05 16:35:33 2010 +0530 +++ b/example/AuthApp/AuthApp_template.pkg Thu Aug 05 16:46:37 2010 +0530 @@ -1,11 +1,10 @@ -; AuthApp_template.pkg generated by qmake at 2010-06-22T14:10:40 +; AuthApp_template.pkg generated by qmake at 2010-07-30T14:11:44 ; This file is generated by qmake and should not be modified by the user ; ; Language &EN - ; SIS header: name, uid, version #{"AuthApp"},(0xEFE2FD23),1,0,0 @@ -17,20 +16,20 @@ ; Manual PKG pre-rules from PRO files -; Dependency to Qt Webkit -(0x200267C2), 4, 6, 3, {"QtWebKit"} -; Default dependency to Qt libraries -(0x2001E61C), 4, 6, 3, {"Qt"} ; Default HW/platform dependencies [0x101F7961],0,0,0,{"S60ProductID"} [0x102032BE],0,0,0,{"S60ProductID"} [0x102752AE],0,0,0,{"S60ProductID"} [0x1028315F],0,0,0,{"S60ProductID"} +; Default dependency to Qt libraries +(0x2001E61C), 4, 6, 2, {"Qt"} +; Dependency to Qt Webkit +(0x200267C2), 4, 6, 2, {"QtWebKit"} ; Executable and default resource files -"/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/release/$(PLATFORM)/$(TARGET)/AuthApp.exe" - "!:\sys\bin\AuthApp.exe" -"/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/data/z/resource/apps/AuthApp.rsc" - "!:\resource\apps\AuthApp.rsc" -"/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/data/z/private/10003a3f/import/apps/AuthApp_reg.rsc" - "!:\private\10003a3f\import\apps\AuthApp_reg.rsc" +"/S60/devices/Nokia_Symbian3_SDK_v0.8/epoc32/release/$(PLATFORM)/$(TARGET)/AuthApp.exe" - "!:\sys\bin\AuthApp.exe" +"/S60/devices/Nokia_Symbian3_SDK_v0.8/epoc32/data/z/resource/apps/AuthApp.rsc" - "!:\resource\apps\AuthApp.rsc" +"/S60/devices/Nokia_Symbian3_SDK_v0.8/epoc32/data/z/private/10003a3f/import/apps/AuthApp_reg.rsc" - "!:\private\10003a3f\import\apps\AuthApp_reg.rsc" ; Manual PKG post-rules from PRO files diff -r b78fa4cdbf2b -r 106a4bfcb866 example/AuthApp/inc/baseDialog.h --- a/example/AuthApp/inc/baseDialog.h Thu Aug 05 16:35:33 2010 +0530 +++ b/example/AuthApp/inc/baseDialog.h Thu Aug 05 16:46:37 2010 +0530 @@ -29,8 +29,6 @@ class FBError; class QNetworkReply; -#define __WINSCW__ - const QString KSuccessurl = "http://www.facebook.com/connect/login_success.html"; /** * The base Dialoggg @@ -146,7 +144,7 @@ void setTitle ( const QString& aTitle ); virtual void GetSessionKey(const QUrl& aUrl); - + virtual void FetchKeyFromUrl(const QUrl& aUrl); private: void createControls(); diff -r b78fa4cdbf2b -r 106a4bfcb866 example/AuthApp/inc/keys.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/AuthApp/inc/keys.h Thu Aug 05 16:46:37 2010 +0530 @@ -0,0 +1,15 @@ +/* + * keys.h + * + * Created on: Jul 16, 2010 + * Author: satishkk + */ + +#ifndef KEYS_H_ +#define KEYS_H_ + +static const QString kApiKey = "077fd6b8881f39c2dc23207323cca439"; +static const QString kApiSecret = "cb13436999afde9338ecd8b0bfb82508"; +static const QString kAppId = "118421274862377"; + +#endif /* KEYS_H_ */ diff -r b78fa4cdbf2b -r 106a4bfcb866 example/AuthApp/inc/loginDialog.h --- a/example/AuthApp/inc/loginDialog.h Thu Aug 05 16:35:33 2010 +0530 +++ b/example/AuthApp/inc/loginDialog.h Thu Aug 05 16:46:37 2010 +0530 @@ -49,7 +49,7 @@ protected: virtual void dialogWillDisappear(); void GetSessionKey(const QUrl& aUrl); - + void FetchKeyFromUrl(const QUrl& aUrl); private: void connectToGetSession(const QString& aToken); void loadLoginPage(); diff -r b78fa4cdbf2b -r 106a4bfcb866 example/AuthApp/main.cpp --- a/example/AuthApp/main.cpp Thu Aug 05 16:35:33 2010 +0530 +++ b/example/AuthApp/main.cpp Thu Aug 05 16:46:37 2010 +0530 @@ -33,9 +33,42 @@ #include #include +void debugOutput(QtMsgType type, const char *msg) + { + QFile logFile("c://data//FaceBookLog.txt"); + Q_ASSERT(logFile.open( QIODevice::WriteOnly | QIODevice::Text | QIODevice::Append )); + QTextStream stream(&logFile); + + switch (type) + { + case QtDebugMsg: + stream< #include @@ -64,7 +65,7 @@ progressbar = new QProgressBar(this); layout->addWidget(iWebView); - layout->addWidget(progressbar); + //layout->addWidget(progressbar); setLayout(layout); @@ -87,6 +88,7 @@ } QString FBDialog::generateURL( const QString& aUrl, const QHash& aParams) const { + qDebug()<<"Inside FBDialog::generateURL()"; QString url ( aUrl ); QStringList pairs; @@ -111,6 +113,7 @@ QByteArray FBDialog::generatePostBody (const QHash& aParams) const { + qDebug()<<"Inside FBDialog::generatePostBody()"; QByteArray body; if (!aParams.count()) @@ -143,6 +146,7 @@ } void FBDialog::dismiss (bool /*aAnimated*/) { + qDebug()<<"Inside FBDialog::dismiss()"; dialogWillDisappear(); iLoadingUrl.clear(); @@ -153,6 +157,7 @@ void FBDialog::dismissWithSuccess( bool aSuccess, bool aAnimated) { + qDebug()<<"Inside FBDialog::dismissWithSuccess()"; if (aSuccess) { emit dialogDidSucceed(); } else { @@ -164,6 +169,7 @@ void FBDialog::dismissWithError (const FBError& aError, bool aAnimated) { + qDebug()<<"Inside FBDialog::dismissWithError()"; emit dialogDidFailWithError( aError ); dismiss(aAnimated); } @@ -188,11 +194,13 @@ void FBDialog::cancel() {} -void FBDialog::load() {} +void FBDialog::load() { + qDebug()<<"Inside FBDialog::load()"; +} void FBDialog::show() { - + qDebug()<<"Inside FBDialog::show()"; load(); showMaximized(); dialogWillAppear(); @@ -201,6 +209,7 @@ void FBDialog::loadURL(const QString& aUrl, QNetworkAccessManager::Operation aMethod, const QHash& aGetParams, const QHash& aPostParams) { + qDebug()<<"Inside FBDialog::loadURL()"; //proxysettings(); iIgnorePageLoadCompleteEvent = false; @@ -228,24 +237,38 @@ request.setHeader (QNetworkRequest::ContentTypeHeader, contentType); body = generatePostBody (aPostParams); } - #ifdef __WINSCW__ proxysettings(); - #endif qDebug()<< "Check URL : " << iLoadingUrl; iWebView->load ( request, aMethod, body); - + } void FBDialog::proxysettings() { - +#ifdef EMULATORTESTING qDebug()<<"proxysettings"; + + // Reading the keys, CSM Stubbed - START + QFile file("c:\\data\\DoNotShare.txt"); + if (!file.open(QIODevice::ReadOnly)) + { + qDebug()<<"File to read the windows username and password could not be opened, returning!!!"; + return; + } + + QByteArray arr = file.readAll(); + QList list = arr.split(' '); + file.close(); + + QString username(list[0]); + QString password(list[1]); + QString httpProxy = "10.1.0.214";//ipwproxy.sasken.com QString httpPort = "3128"; - QString httpUser ="";/* This could be taken thru an QDialog implmentation to remove the Hard coding */ - QString httpPass ="";/* This could be taken thru an QDialog implmentation to remove the Hard coding */ + QString httpUser =username;/* This could be taken thru an QDialog implmentation to remove the Hard coding */ + QString httpPass =password;/* This could be taken thru an QDialog implmentation to remove the Hard coding */ /*==Classes used from Network Module==*/ QNetworkProxy proxy; @@ -257,7 +280,7 @@ proxy.setPassword(httpPass); QNetworkProxy::setApplicationProxy(proxy); - +#endif } void FBDialog::dialogWillAppear() {} @@ -272,13 +295,16 @@ { qDebug() << "Loading the url: " << url; + proxysettings(); + iWebView->load(url); } void FBDialog::loadStarted() { qDebug() << "Load started: " << iWebView->url(); + layout->addWidget(progressbar); progressbar->setVisible(true); } void FBDialog::loadProgress(int progress) @@ -289,10 +315,15 @@ { } +void FBDialog::FetchKeyFromUrl(const QUrl& aUrl) +{ + +} void FBDialog::loadFinished ( bool ok ) { qDebug() << "Load " << (ok ? "" : "un") << "successfull for: " << iWebView->url(); progressbar->setVisible(false); + layout->removeWidget(progressbar); if (ok) { QString PAth = iWebView->url().toString(); @@ -307,6 +338,7 @@ if(URL.contains("auth_token")) { + qDebug() << "URL contains auth token"; iWebView->setHidden(true); QMessageBox msgbox; QString msg ("Logged in Success!!!Complete the Authorization?"); @@ -317,8 +349,13 @@ } } + else if(URL.contains("session_key") && URL.contains("uid")) + { + FetchKeyFromUrl(iWebView->url()); + } else { + qDebug() << "URL doesnt have auth_token field"; iWebView->setHidden(true); QMessageBox msgbox; QString msg ("Permissions Success!!!continue login?"); diff -r b78fa4cdbf2b -r 106a4bfcb866 example/AuthApp/src/loginDialog.cpp --- a/example/AuthApp/src/loginDialog.cpp Thu Aug 05 16:35:33 2010 +0530 +++ b/example/AuthApp/src/loginDialog.cpp Thu Aug 05 16:46:37 2010 +0530 @@ -15,6 +15,8 @@ * Login Dialog class of Authentication Application */ +#include + #include "authAppConstants.h" #include "sessionSP.h" #include "errorCodes.h" @@ -29,6 +31,7 @@ /////////////////////////////////////////////////////////////////////////////////////////////////// void FBLoginDialog::connectToGetSession(const QString& aToken) { + qDebug()<<"Inside FBLoginDialog::connectToGetSession()"; iGetSessionRequest = FBRequest::requestWithSession(iSession); connect(iGetSessionRequest, SIGNAL(requestDidLoad(QVariant)), this, SLOT(requestDidLoad(QVariant))); @@ -55,20 +58,18 @@ void FBLoginDialog::loadLoginPage() { + qDebug()<<"Inside FBLoginDialog::loadLoginPage()"; Dictionary getParams, postParams; - - getParams["fbconnect"] = "1"; - - #ifdef __WINSCW__ - getParams["connect_display"] = "touch"; - #else - getParams["connect_display"] = "popup"; - #endif - getParams["api_key"] = iSession->apiKey(); + getParams["connect_display"] = "popup"; + getParams["v"]="1.0"; getParams["next"] = KSuccessurl; getParams["cancel_url"] = "http://www.facebook.com/connect/login_failure.html"; - getParams["req_perms"] = "read_stream,publish_stream,offline_access"; + getParams["fbconnect"] = "1"; + getParams["return_session"]="1"; // Uncomment this to get session in the url + getParams["session_key_only"]="1"; // Uncomment this to get session in the url + getParams["ext_perm"/*"req_perms"*/] = "read_stream,publish_stream,offline_access,user_photos,friends_photos,user_status,friends_status,user_location,friends_location,user_activities,friends_activities,user_relationships,friends_relationships,read_requests,read_friendlists"; + // req_perms=read_stream,publish_stream,offline_access loadURL(kLoginURL,QNetworkAccessManager::GetOperation, getParams, postParams); @@ -84,11 +85,13 @@ void FBLoginDialog::load() { + qDebug()<<"Inside FBLoginDialog::load()"; loadLoginPage(); } void FBLoginDialog::dialogWillDisappear() { + qDebug()<<"Inside FBLoginDialog::dialogWillDisappear()"; iGetSessionRequest->cancel(); if (!iSession->isConnected()) @@ -99,6 +102,7 @@ void FBLoginDialog::GetSessionKey(const QUrl& aUrl) { + qDebug()<<"Inside FBLoginDialog::GetSessionKey()"; const QString authToken = "auth_token="; const QString url ( aUrl.toString() ); @@ -120,12 +124,48 @@ connectToGetSession(token); } } - +void FBLoginDialog::FetchKeyFromUrl(const QUrl& aUrl) +{ + const QString url ( aUrl.toString() ); + QStringList varList = url.split("{"); + QString newvar = varList[1]; + varList.clear(); + varList = newvar.split(","); + QString session_key = varList[0]; + QString uid = varList[1]; + QString expires = varList[2]; + QString secret = varList[3]; + varList.clear(); + varList = session_key.split(":"); + session_key = varList[1]; + session_key = session_key.mid(1,session_key.length()-2); + varList.clear(); + varList = uid.split(":"); + uid = varList[1]; + varList.clear(); + varList = expires.split(":"); + expires = varList[1]; + varList.clear(); + varList = secret.split(":"); + secret = varList[1]; + secret = secret.mid(1,secret.length()-2); + varList.clear(); + qDebug()<<"session_key"<beginSession(session_key, secret,expiration); + iSession->resume(); +} /////////////////////////////////////////////////////////////////////////////////////////////////// // slots for signals from FBRequest void FBLoginDialog::requestDidLoad(const QVariant& aResult) { + qDebug()<<"Inside FBLoginDialog::requestDidLoad"; bool conversionError = false; QVariantHash object = aResult.toHash(); QString sessionKey = object.value("session_key").toString(); @@ -143,10 +183,12 @@ void FBLoginDialog::requestFailedWithFacebookError (const FBError& aCode ) { + qDebug()<<"Inside FBLoginDialog::requestFailedWithFacebookError()"; dismissWithError(aCode, true); } void FBLoginDialog::requestFailedWithNetworkError( QNetworkReply::NetworkError aCode ) { + qDebug()<<"Inside FBLoginDialog::requestFailedWithNetworkError()"; dismissWithError(aCode, true); } diff -r b78fa4cdbf2b -r 106a4bfcb866 example/AuthApp/src/requestSP.cpp --- a/example/AuthApp/src/requestSP.cpp Thu Aug 05 16:35:33 2010 +0530 +++ b/example/AuthApp/src/requestSP.cpp Thu Aug 05 16:46:37 2010 +0530 @@ -70,6 +70,7 @@ void FBRequest::connect() { + qDebug()<<"Inside FBRequest::connect()"; emit requestLoading(); QString url ; @@ -139,6 +140,7 @@ QString FBRequest::generateGetURL() const { + qDebug()<<"Inside FBRequest::generateGetURL()"; const QUrl url(iUrl); const QString queryPrefix = url.hasQuery() ? "&" : "?"; @@ -197,6 +199,7 @@ void FBRequest::generatePostBody( QByteArray& body ) { + qDebug()<<"Inside FBRequest::generatePostBody()"; QString endLine = "\r\n--" + kStringBoundary + "\r\n"; body.append( "--" + kStringBoundary.toUtf8() + "\r\n" ) ; @@ -234,6 +237,7 @@ void FBRequest::handleResponseData( const QByteArray& aResponseData ) { + qDebug()<<"Inside FBRequest::handleResponseData()"; FBError error; QVariant result = parseXMLResponse( aResponseData, error); if (error.code() != 0) @@ -250,6 +254,7 @@ void FBRequest::post( const QString& aUrl, const Dictionary& aParams) { + qDebug()<<"Inside FBRequest::post()"; iUrl = aUrl; iParams = aParams; @@ -258,7 +263,7 @@ void FBRequest::cancel() { - + qDebug()<<"Inside FBRequest::cancel()"; } @@ -303,6 +308,7 @@ QVariant FBRequest::parseXMLResponse ( const QByteArray& aResponseData, FBError& aError) { + qDebug()<<"Inside FBRequest::handleResponseData()"; QXmlInputSource input; input.setData(aResponseData); @@ -348,7 +354,7 @@ void FBRequest::networkReplyFinished () { - +qDebug()<<"Inside FBRequest::networkReplyFinished()"; QNetworkReply* reply = static_cast ( sender() ); QByteArray responseData = reply->readAll(); diff -r b78fa4cdbf2b -r 106a4bfcb866 example/AuthApp/src/sessionSP.cpp --- a/example/AuthApp/src/sessionSP.cpp Thu Aug 05 16:35:33 2010 +0530 +++ b/example/AuthApp/src/sessionSP.cpp Thu Aug 05 16:46:37 2010 +0530 @@ -20,12 +20,16 @@ #include #include #include + +#include "keys.h" + /////////////////////////////////////////////////////////////////////////////////////////////////// // global static const QString kAPIRestURL = "http://api.facebook.com/restserver.php"; static const QString kAPIRestSecureURL = "https://api.facebook.com/restserver.php"; + static const int kMaxBurstRequests = 3; static const int kBurstDuration = 2; @@ -93,6 +97,7 @@ void FBSession::beginSession (const QString& aSessionKey, const QString& aSessionSecret, const QDateTime& aExpires ) { + qDebug()<<"Inside FBSession::beginSession()"; iSessionKey = aSessionKey; iSessionSecret = aSessionSecret; @@ -104,10 +109,11 @@ bool FBSession::resume() { - QString CMRegToken = iSettings.value("CMRegToken").toString(); - QDateTime ExpiryTime = iSettings.value("ExpiryTime").toDateTime(); + qDebug()<<"Inside FBSession::resume()"; + QString fbCMRegToken = iSettings.value("FBCMRegToken").toString(); + QDateTime fbExpiryTime = iSettings.value("FBExpiryTime").toDateTime(); SmfAuthParams Params; - if(m_Client->AuthDataSet(CMRegToken,ExpiryTime,Params)) + if(m_Client->AuthDataSet(fbCMRegToken,fbExpiryTime,Params)) { QByteArray accessToken = Params.value("accessToken"); emit sessionDidLogin( accessToken ); @@ -117,13 +123,14 @@ } void FBSession::cancelLogin() { + qDebug()<<"Inside FBSession::cancelLogin()"; if (!isConnected()) { emit sessionDidNotLogin(); } } void FBSession::logout() { - + qDebug()<<"Inside FBSession::logout()"; iExpirationDate = QDateTime(); iSessionKey.clear(); iSessionSecret.clear(); @@ -134,6 +141,7 @@ } void FBSession::send (FBRequest* aRequest) { + qDebug()<<"Inside FBSession::send()"; performRequest (aRequest, true); } @@ -142,15 +150,23 @@ // instance private functions void FBSession::save() { - + qDebug()<<"Inside FBSession::save()"; SmfAuthParams Params; - Params.insert("accessToken",iSessionKey.toAscii()); + Params.insert("ApiKey",kApiKey.toAscii()); + Params.insert("ApiSecret",kApiSecret.toAscii()); + Params.insert("AppId",kAppId.toAscii()); + Params.insert("SessionKey",iSessionKey.toAscii()); + Params.insert("SessionSecret",iSessionSecret.toAscii()); + QList UrlList; + UrlList.append(QUrl("http://api.facebook.com")); UrlList.append(QUrl("http://www.facebook.com")); QStringList PluginList; - PluginList.append(QString("facebook")); + PluginList.append(QString("fbactivityfetcherplugin.qtplugin")); + PluginList.append(QString("fbcontactfetcherplugin.qtplugin")); + PluginList.append(QString("fbpostproviderplugin.qtplugin")); QString UID("0xEFE2FD23"); @@ -158,16 +174,21 @@ iExpirationDate = QDateTime::currentDateTime(); iExpirationDate.addYears(1); - QString CMRegToken = m_Client->StoreAuthData(Params,iExpirationDate,UrlList,PluginList,UID,true); + QString fbCMRegToken = m_Client->StoreAuthData(Params,iExpirationDate,UrlList,PluginList,UID,true); + qDebug()<<"Reg token returned by auth app = "< +#include + +#include "keys.h" + +AuthApp::AuthApp(QWidget *parent) + : QMainWindow(parent), + ui(new Ui::AuthAppClass) +{ + ui->setupUi(this); + //iFBSession = FBSession::sessionForApplication("df51def3e750a350ddb961a70b5ab5ab", "3b86a756f77967dea4674f080fa5d345", QString()); + //iFBSession = FBSession::sessionForApplication("114354298600019", "fb10f1c758fc285b2a6113344ef4c893", QString()); //Facebook keys + //iFBSession = FBSession::sessionForApplication("697207f5f3610334e02d828450e66589", "520edd7afff9b79f", QString()); //Flickr Mobile Based + //iFBSession = FBSession::sessionForApplication("2d03ca48309291ee6815410c3a5bb278", "1bb754981c7c6974", QString()); //Flickr Web based + iFBSession = FBSession::sessionForApplication(kApiKey,kApiSecret, QString()); //Flickr Web based + connect (iFBSession, SIGNAL(sessionDidLogout()), this, SLOT(sessionDidLogout())); + connect (iFBSession,SIGNAL(sessionDidLogin(QString)), this, SLOT(sessionDidLogin(QString))); + + //CheckforLogin(); +} + +AuthApp::~AuthApp() +{ + delete iFBSession; + delete ui; +} + +void AuthApp::changeEvent(QEvent *e) +{ + QMainWindow::changeEvent(e); + switch (e->type()) { + case QEvent::LanguageChange: + ui->retranslateUi(this); + break; + default: + break; + } +} +void AuthApp::CheckforLogin() +{ + iLoginDialog = NULL; + if ( !( iFBSession->resume() ) ){ + ui->buttonForget->setDisabled(true); + ui->pushButton->setEnabled(true); + } +} +void AuthApp::on_pushButton_clicked() +{ + qDebug()<<"Inside AuthApp::on_pushButton_clicked"; + iLoginDialog = new FBLoginDialog(); + iLoginDialog->connecttoGetFrob(); + +} +void AuthApp::sessionDidLogin(QString Token) +{ + + if (iLoginDialog ) + { + QMessageBox msgbox; + QString msg ("Authorization completes!!"); + msgbox.setText(msg); + msgbox.exec(); + + iLoginDialog->deleteLater(); + iLoginDialog = NULL; + }else{ + QMessageBox msgbox; + QString msg ("your already authorized,Please logout and Login again for new authorization!!"); + msgbox.setText(msg); + msgbox.exec(); + } + + ui->pushButton->setDisabled(true); + ui->buttonForget->setEnabled(true); +} + +void AuthApp::sessionDidLogout() +{ + QMessageBox msgbox; + msgbox.setText("logged out successfully!!"); + msgbox.exec(); + + ui->pushButton->setEnabled(true); + ui->buttonForget->setDisabled(true); + +} +void AuthApp::requestFailedWithFacebookError ( const FBError& aError ) +{ + qDebug() << "facebook error is " << aError.code() << " - " << aError.description(); +} + +void AuthApp::on_buttonForget_clicked() +{ + iFBSession->logout(); +} diff -r b78fa4cdbf2b -r 106a4bfcb866 example/FlickrAuthApp/AuthApp.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/FlickrAuthApp/AuthApp.h Thu Aug 05 16:46:37 2010 +0530 @@ -0,0 +1,54 @@ +/** +* Copyright (c) 2010 Sasken Communication Technologies Ltd. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the "{License}" +* which accompanies this distribution, and is available +* at the URL "{LicenseUrl}". +* +* Initial Contributors: +* Narasimhulu Kavadapu, Sasken Communication Technologies Ltd - Initial contribution +* +* Contributors: +* +* Description: +* UI Class of Authentication Application +*/ + +#ifndef AUTHAPP_H +#define AUTHAPP_H + +#include +#include "ui_AuthApp.h" +#include "errorCodes.h" +#include "loginDialog.h" +#include "sessionSP.h" + +class AuthApp : public QMainWindow +{ + Q_OBJECT + +public: + AuthApp(QWidget *parent = 0); + ~AuthApp(); +private: + void CheckforLogin(); +private slots: + void on_buttonForget_clicked(); + void on_pushButton_clicked(); + + void sessionDidLogin(QString sessionkey); + void sessionDidLogout(); + + void requestFailedWithFacebookError ( const FBError& aError ); + +protected: + void changeEvent(QEvent *e); + +private: + FBSession* iFBSession; + FBLoginDialog* iLoginDialog; + Ui::AuthAppClass *ui; +}; + +#endif // AUTHAPP_H diff -r b78fa4cdbf2b -r 106a4bfcb866 example/FlickrAuthApp/AuthApp.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/FlickrAuthApp/AuthApp.loc Thu Aug 05 16:46:37 2010 +0530 @@ -0,0 +1,13 @@ +// ============================================================================ +// * Generated by qmake (2.01a) (Qt 4.6.1) on: 2010-06-23T11:36:56 +// * This file is generated by qmake and should not be modified by the +// * user. +// ============================================================================ + +#ifdef LANGUAGE_SC +#define STRING_r_short_caption "AuthApp" +#define STRING_r_caption "AuthApp" +#else +#define STRING_r_short_caption "AuthApp" +#define STRING_r_caption "AuthApp" +#endif diff -r b78fa4cdbf2b -r 106a4bfcb866 example/FlickrAuthApp/AuthApp.ui --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/FlickrAuthApp/AuthApp.ui Thu Aug 05 16:46:37 2010 +0530 @@ -0,0 +1,50 @@ + + AuthAppClass + + + + 0 + 0 + 275 + 310 + + + + MainWindow + + + + + + + Logout + + + + + + + Login to Flickr + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + diff -r b78fa4cdbf2b -r 106a4bfcb866 example/FlickrAuthApp/Flickr.loc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/FlickrAuthApp/Flickr.loc Thu Aug 05 16:46:37 2010 +0530 @@ -0,0 +1,13 @@ +// ============================================================================ +// * Generated by qmake (2.01a) (Qt 4.6.2) on: 2010-07-30T14:11:44 +// * This file is generated by qmake and should not be modified by the +// * user. +// ============================================================================ + +#ifdef LANGUAGE_SC +#define STRING_r_short_caption "Flickr" +#define STRING_r_caption "Flickr" +#else +#define STRING_r_short_caption "Flickr" +#define STRING_r_caption "Flickr" +#endif diff -r b78fa4cdbf2b -r 106a4bfcb866 example/FlickrAuthApp/Flickr.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/FlickrAuthApp/Flickr.rss Thu Aug 05 16:46:37 2010 +0530 @@ -0,0 +1,21 @@ +// ============================================================================ +// * Generated by qmake (2.01a) (Qt 4.6.2) on: 2010-07-30T14:11:44 +// * This file is generated by qmake and should not be modified by the +// * user. +// ============================================================================ + +#include +#include "Flickr.loc" + +RESOURCE LOCALISABLE_APP_INFO r_localisable_app_info + { + short_caption = STRING_r_short_caption; + caption_and_icon = + CAPTION_AND_ICON_INFO + { + caption = STRING_r_caption; + number_of_icons = 0; + icon_file = ""; + }; + } + diff -r b78fa4cdbf2b -r 106a4bfcb866 example/FlickrAuthApp/FlickrAuthApp.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/FlickrAuthApp/FlickrAuthApp.pro Thu Aug 05 16:46:37 2010 +0530 @@ -0,0 +1,39 @@ +TEMPLATE = app +TARGET = Flickr +QT += core \ + gui \ + network \ + webkit \ + xml +LIBS += -lsmfcredmgrclient +HEADERS += inc/keys.h \ + Flickr.loc \ + progressbar.h \ + inc/requestSP.h \ + inc/xmlParser.h \ + inc/sessionSP.h \ + inc/loginDialog.h \ + inc/errorCodes.h \ + inc/baseDialog.h \ + inc/authAppConstants.h \ + inc/keys.h \ + AuthApp.h +SOURCES += Flickr_reg.rss \ + Flickr.rss \ + progressbar.cpp \ + src/requestSP.cpp \ + src/xmlParser.cpp \ + src/sessionSP.cpp \ + src/loginDialog.cpp \ + src/baseDialog.cpp \ + main.cpp \ + AuthApp.cpp +FORMS += progressbar.ui \ + AuthApp.ui +RESOURCES += +symbian: { + TARGET.EPOCHEAPSIZE = 0x020000 \ + 0x3200000 + TARGET.UID3 = 0xE1D8C7D7 # Symbian specific, unprotected uid3 from symbiansigned.com + TARGET.CAPABILITY = NetworkServices # Symbian specific, we just need network access +} diff -r b78fa4cdbf2b -r 106a4bfcb866 example/FlickrAuthApp/Flickr_installer.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/FlickrAuthApp/Flickr_installer.pkg Thu Aug 05 16:46:37 2010 +0530 @@ -0,0 +1,30 @@ +; Flickr_installer.pkg generated by qmake at 2010-07-30T14:11:44 +; This file is generated by qmake and should not be modified by the user +; + +; Language +&EN + +; SIS header: name, uid, version +#{"Flickr installer"},(0xA000D7CE),1,0,0 + +; Localised Vendor name +%{"Vendor"} + +; Unique Vendor name +:"Vendor" + + +; Manual PKG pre-rules from PRO files +; Default HW/platform dependencies +[0x101F7961],0,0,0,{"S60ProductID"} +[0x102032BE],0,0,0,{"S60ProductID"} +[0x102752AE],0,0,0,{"S60ProductID"} +[0x1028315F],0,0,0,{"S60ProductID"} + +; Default dependency to Qt libraries +; Dependency to Qt Webkit + + +"D:/smf/MissingCode/smfrepo/example/FlickrAuthApp/Flickr.sis" - "c:\adm\Flickr.sis" +@"D:/Qt/4.6.2/smartinstaller.sis",(0x2002CCCD) diff -r b78fa4cdbf2b -r 106a4bfcb866 example/FlickrAuthApp/Flickr_reg.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/FlickrAuthApp/Flickr_reg.rss Thu Aug 05 16:46:37 2010 +0530 @@ -0,0 +1,18 @@ +// ============================================================================ +// * Generated by qmake (2.01a) (Qt 4.6.2) on: 2010-07-30T14:11:44 +// * This file is generated by qmake and should not be modified by the +// * user. +// ============================================================================ + +#include +#include + +UID2 KUidAppRegistrationResourceFile +UID3 0xE1D8C7D7 + +RESOURCE APP_REGISTRATION_INFO + { + app_file="Flickr"; + localisable_resource_file="\\resource\\apps\\Flickr"; + + } diff -r b78fa4cdbf2b -r 106a4bfcb866 example/FlickrAuthApp/Flickr_template.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/FlickrAuthApp/Flickr_template.pkg Thu Aug 05 16:46:37 2010 +0530 @@ -0,0 +1,35 @@ +; Flickr_template.pkg generated by qmake at 2010-07-30T14:11:44 +; This file is generated by qmake and should not be modified by the user +; + +; Language +&EN + +; SIS header: name, uid, version +#{"Flickr"},(0xE1D8C7D7),1,0,0 + +; Localised Vendor name +%{"Vendor"} + +; Unique Vendor name +:"Vendor" + + +; Manual PKG pre-rules from PRO files +; Default HW/platform dependencies +[0x101F7961],0,0,0,{"S60ProductID"} +[0x102032BE],0,0,0,{"S60ProductID"} +[0x102752AE],0,0,0,{"S60ProductID"} +[0x1028315F],0,0,0,{"S60ProductID"} + +; Default dependency to Qt libraries +(0x2001E61C), 4, 6, 2, {"Qt"} +; Dependency to Qt Webkit +(0x200267C2), 4, 6, 2, {"QtWebKit"} + +; Executable and default resource files +"/S60/devices/Nokia_Symbian3_SDK_v0.8/epoc32/release/$(PLATFORM)/$(TARGET)/Flickr.exe" - "!:\sys\bin\Flickr.exe" +"/S60/devices/Nokia_Symbian3_SDK_v0.8/epoc32/data/z/resource/apps/Flickr.rsc" - "!:\resource\apps\Flickr.rsc" +"/S60/devices/Nokia_Symbian3_SDK_v0.8/epoc32/data/z/private/10003a3f/import/apps/Flickr_reg.rsc" - "!:\private\10003a3f\import\apps\Flickr_reg.rsc" + +; Manual PKG post-rules from PRO files diff -r b78fa4cdbf2b -r 106a4bfcb866 example/FlickrAuthApp/backup_registration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/FlickrAuthApp/backup_registration.xml Thu Aug 05 16:46:37 2010 +0530 @@ -0,0 +1,5 @@ + + + + + diff -r b78fa4cdbf2b -r 106a4bfcb866 example/FlickrAuthApp/inc/authAppConstants.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/FlickrAuthApp/inc/authAppConstants.h Thu Aug 05 16:46:37 2010 +0530 @@ -0,0 +1,30 @@ +/** +* Copyright (c) 2010 Sasken Communication Technologies Ltd. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the "{License}" +* which accompanies this distribution, and is available +* at the URL "{LicenseUrl}". +* +* Initial Contributors: +* Narasimhulu Kavadapu, Sasken Communication Technologies Ltd - Initial contribution +* +* Contributors: +* +* Description: +* Common variable declarations +*/ + +#ifndef FBCONNECTGLOBAL_H +#define FBCONNECTGLOBAL_H + +#include +#include +#include + +typedef QHash Dictionary; +typedef QHashIterator DictionaryIterator; + + + +#endif // FBCONNECTGLOBAL_H diff -r b78fa4cdbf2b -r 106a4bfcb866 example/FlickrAuthApp/inc/baseDialog.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/FlickrAuthApp/inc/baseDialog.h Thu Aug 05 16:46:37 2010 +0530 @@ -0,0 +1,159 @@ +/** +* Copyright (c) 2010 Sasken Communication Technologies Ltd. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the "{License}" +* which accompanies this distribution, and is available +* at the URL "{LicenseUrl}". +* +* Initial Contributors: +* Narasimhulu Kavadapu, Sasken Communication Technologies Ltd - Initial contribution +* +* Contributors: +* +* Description: +* Base class of All dialogs +*/ + +#ifndef FB_DIALOG_H_ +#define FB_DIALOH_H_ + +#include +#include +#include +#include +#include "authAppConstants.h" + +// FORWARD DECLARATIONS +class FBSession; +class FBError; +class QNetworkReply; + +//#define __WINSCW__ + +/** + * The base Dialoggg + */ +class FBDialog : public QWidget +{ + Q_OBJECT + +protected: + + /** + * The session for which the login is taking place. + */ + FBSession* iSession; + QWebView* iWebView; + QString iLoadingUrl; + bool iIgnorePageLoadCompleteEvent; + QProgressBar* progressbar; + QVBoxLayout* layout; + +signals: + + /** + * Called when the dialog succeeds and is about to be dismissed. + */ + void dialogDidSucceed (); + + /** + * Called when the dialog is cancelled and is about to be dismissed. + */ + void dialogDidCancel(); + + /** + * Called when dialog failed to load due to an error. + */ + void dialogDidFailWithError ( const FBError& error ); + + + +private slots: + void cancel(); + + /* slots for signals from QWebView.page() */ + void linkClicked ( const QUrl & url ); + void loadStarted (); + void loadProgress(int progress); + void loadFinished ( bool ok ); + //void urlChanged ( const QUrl & url ); + //Network Error Slots + void slotAuthenticationRequired( QNetworkReply* reply, QAuthenticator* authenticator ); + void slotsslErrors( QNetworkReply* reply, const QList& errors ); + void slotproxyAuthenticationRequired( const QNetworkProxy& proxy, QAuthenticator* authenticator ); + +public: + + void proxysettings(); + /** + * Creates the view but does not display it. + */ + FBDialog(FBSession* aSession); + FBDialog(); + + /** + * Displays the view with an animation. + * + * The view will be added to the top of the current key window. + */ + void show(); + + /** Displays the first page of the dialog. + * + * Do not ever call this directly. It is intended to be overriden by subclasses. + */ + virtual void load (); + + /** + * Displays a URL in the dialog. + */ + void loadURL(const QString& aUrl, QNetworkAccessManager::Operation aMethod, const QHash& aGetParams, + const QHash& aPostParams); + + + void dismiss(bool aAnimated); + + /** + * Hides the view and notifies delegates of success or cancellation. + */ + void dismissWithSuccess (bool aSuccess, bool aAnimated); + + /** + * Hides the view and notifies delegates of an error. + */ + void dismissWithError (const FBError& aError); + + /** + * Subclasses may override to perform actions just prior to showing the dialog. + */ + virtual void dialogWillAppear(); + + /** + * Subclasses may override to perform actions just after the dialog is hidden. + */ + virtual void dialogWillDisappear(); + + /** + * Subclasses should override to process data returned from the server in a 'fbconnect' url. + * + * Implementations must call dismissWithSuccess:YES at some point to hide the dialog. + */ + virtual void dialogDidSucceed(const QUrl& aUrl); + + QString title() const; + void setTitle ( const QString& aTitle ); + + virtual void GetSessionKey(const QUrl& aUrl); + + virtual void connectToGetFullToken(); + +private: + void createControls(); + QString generateURL( const QString& aUrl, const QHash& aParams) const; + QByteArray generatePostBody (const QHash& aParams) const; + + void postDismissCleanup(); + + }; +#endif diff -r b78fa4cdbf2b -r 106a4bfcb866 example/FlickrAuthApp/inc/errorCodes.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/FlickrAuthApp/inc/errorCodes.h Thu Aug 05 16:46:37 2010 +0530 @@ -0,0 +1,221 @@ +/** +* Copyright (c) 2010 Sasken Communication Technologies Ltd. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the "{License}" +* which accompanies this distribution, and is available +* at the URL "{LicenseUrl}". +* +* Initial Contributors: +* Narasimhulu Kavadapu, Sasken Communication Technologies Ltd - Initial contribution +* +* Contributors: +* +* Description: +* Common Errors Declaration +*/ + +#ifndef FBERROR_H_ +#define FBERROR_H_ + + +#include "authAppConstants.h" + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Error codes +/* defined by this proj*/ +#define FBRESPONSE_PARSE_ERROR 13 /* the xml parser was unable to parse the response returned by the server */ + +/* defined and returned by facebook */ +#define FBAPI_EC_SUCCESS 0 +#define FBAPI_EC_UNKNOWN 1 +#define FBAPI_EC_SERVICE 2 +#define FBAPI_EC_METHOD 3 +#define FBAPI_EC_TOO_MANY_CALLS 4 +#define FBAPI_EC_BAD_IP 5 +#define FBAPI_EC_HOST_API 6 +#define FBAPI_EC_HOST_UP 7 +#define FBAPI_EC_SECURE 8 +#define FBAPI_EC_RATE 9 +#define FBAPI_EC_PERMISSION_DENIED 10 +#define FBAPI_EC_DEPRECATED 11 +#define FBAPI_EC_VERSION 12 + +#define FBAPI_EC_PARAM 100 +#define FBAPI_EC_PARAM_FBAPI_KEY 101 +#define FBAPI_EC_PARAM_SESSION_KEY 102 +#define FBAPI_EC_PARAM_CALL_ID 103 +#define FBAPI_EC_PARAM_SIGNATURE 104 +#define FBAPI_EC_PARAM_TOO_MANY 105 +#define FBAPI_EC_PARAM_USER_ID 110 +#define FBAPI_EC_PARAM_USER_FIELD 111 +#define FBAPI_EC_PARAM_SOCIAL_FIELD 112 +#define FBAPI_EC_PARAM_EMAIL 113 +#define FBAPI_EC_PARAM_ALBUM_ID 120 +#define FBAPI_EC_PARAM_PHOTO_ID 121 +#define FBAPI_EC_PARAM_FEED_PRIORITY 130 +#define FBAPI_EC_PARAM_CATEGORY 140 +#define FBAPI_EC_PARAM_SUBCATEGORY 141 +#define FBAPI_EC_PARAM_TITLE 142 +#define FBAPI_EC_PARAM_DESCRIPTION 143 +#define FBAPI_EC_PARAM_BAD_JSON 144 +#define FBAPI_EC_PARAM_BAD_EID 150 +#define FBAPI_EC_PARAM_UNKNOWN_CITY 151 +#define FBAPI_EC_PARAM_BAD_PAGE_TYPE 152 + +#define FBAPI_EC_PERMISSION 200 +#define FBAPI_EC_PERMISSION_USER 210 +#define FBAPI_EC_PERMISSION_ALBUM 220 +#define FBAPI_EC_PERMISSION_PHOTO 221 +#define FBAPI_EC_PERMISSION_MESSAGE 230 +#define FBAPI_EC_PERMISSION_MARKUP_OTHER_USER 240 +#define FBAPI_EC_PERMISSION_STATUS_UPDATE 250 +#define FBAPI_EC_PERMISSION_PHOTO_UPLOAD 260 +#define FBAPI_EC_PERMISSION_SMS 270 +#define FBAPI_EC_PERMISSION_CREATE_LISTING 280 +#define FBAPI_EC_PERMISSION_EVENT 290 +#define FBAPI_EC_PERMISSION_LARGE_FBML_TEMPLATE 291 +#define FBAPI_EC_PERMISSION_LIVEMESSAGE 292 +#define FBAPI_EC_PERMISSION_RSVP_EVENT 299 + +#define FBAPI_EC_EDIT 300 +#define FBAPI_EC_EDIT_USER_DATA 310 +#define FBAPI_EC_EDIT_PHOTO 320 +#define FBAPI_EC_EDIT_ALBUM_SIZE 321 +#define FBAPI_EC_EDIT_PHOTO_TAG_SUBJECT 322 +#define FBAPI_EC_EDIT_PHOTO_TAG_PHOTO 323 +#define FBAPI_EC_EDIT_PHOTO_FILE 324 +#define FBAPI_EC_EDIT_PHOTO_PENDING_LIMIT 325 +#define FBAPI_EC_EDIT_PHOTO_TAG_LIMIT 326 +#define FBAPI_EC_EDIT_ALBUM_REORDER_PHOTO_NOT_IN_ALBUM 327 +#define FBAPI_EC_EDIT_ALBUM_REORDER_TOO_FEW_PHOTOS 328 +#define FBAPI_EC_MALFORMED_MARKUP 329 +#define FBAPI_EC_EDIT_MARKUP 330 +#define FBAPI_EC_EDIT_FEED_TOO_MANY_USER_CALLS 340 +#define FBAPI_EC_EDIT_FEED_TOO_MANY_USER_ACTION_CALLS 341 +#define FBAPI_EC_EDIT_FEED_TITLE_LINK 342 +#define FBAPI_EC_EDIT_FEED_TITLE_LENGTH 343 +#define FBAPI_EC_EDIT_FEED_TITLE_NAME 344 +#define FBAPI_EC_EDIT_FEED_TITLE_BLANK 345 +#define FBAPI_EC_EDIT_FEED_BODY_LENGTH 346 +#define FBAPI_EC_EDIT_FEED_PHOTO_SRC 347 +#define FBAPI_EC_EDIT_FEED_PHOTO_LINK 348 +#define FBAPI_EC_EDIT_VIDEO_SIZE 350 +#define FBAPI_EC_EDIT_VIDEO_INVALID_FILE 351 +#define FBAPI_EC_EDIT_VIDEO_INVALID_TYPE 352 +#define FBAPI_EC_EDIT_FEED_TITLE_ARRAY 360 +#define FBAPI_EC_EDIT_FEED_TITLE_PARAMS 361 +#define FBAPI_EC_EDIT_FEED_BODY_ARRAY 362 +#define FBAPI_EC_EDIT_FEED_BODY_PARAMS 363 +#define FBAPI_EC_EDIT_FEED_PHOTO 364 +#define FBAPI_EC_EDIT_FEED_TEMPLATE 365 +#define FBAPI_EC_EDIT_FEED_TARGET 366 +#define FBAPI_EC_USERS_CREATE_INVALID_EMAIL 370 +#define FBAPI_EC_USERS_CREATE_EXISTING_EMAIL 371 +#define FBAPI_EC_USERS_CREATE_BIRTHDAY 372 +#define FBAPI_EC_USERS_CREATE_PASSWORD 373 +#define FBAPI_EC_USERS_REGISTER_INVALID_CREDENTIAL 374 +#define FBAPI_EC_USERS_REGISTER_CONF_FAILURE 375 +#define FBAPI_EC_USERS_REGISTER_EXISTING 376 +#define FBAPI_EC_USERS_REGISTER_DEFAULT_ERROR 377 +#define FBAPI_EC_USERS_REGISTER_PASSWORD_BLANK 378 +#define FBAPI_EC_USERS_REGISTER_PASSWORD_INVALID_CHARS 379 +#define FBAPI_EC_USERS_REGISTER_PASSWORD_SHORT 380 +#define FBAPI_EC_USERS_REGISTER_PASSWORD_WEAK 381 +#define FBAPI_EC_USERS_REGISTER_USERNAME_ERROR 382 +#define FBAPI_EC_USERS_REGISTER_MISSING_INPUT 383 +#define FBAPI_EC_USERS_REGISTER_INCOMPLETE_BDAY 384 +#define FBAPI_EC_USERS_REGISTER_INVALID_EMAIL 385 +#define FBAPI_EC_USERS_REGISTER_EMAIL_DISABLED 386 +#define FBAPI_EC_USERS_REGISTER_ADD_USER_FAILED 387 +#define FBAPI_EC_USERS_REGISTER_NO_GENDER 388 + +#define FBAPI_EC_AUTH_EMAIL 400 +#define FBAPI_EC_AUTH_LOGIN 401 +#define FBAPI_EC_AUTH_SIG 402 +#define FBAPI_EC_AUTH_TIME 403 + +#define FBAPI_EC_SESSION_METHOD 451 +#define FBAPI_EC_SESSION_REQUIRED 453 +#define FBAPI_EC_SESSION_REQUIRED_FOR_SECRET 454 +#define FBAPI_EC_SESSION_CANNOT_USE_SESSION_SECRET 455 + +#define FBAPI_EC_MESG_BANNED 500 +#define FBAPI_EC_MESG_NO_BODY 501 +#define FBAPI_EC_MESG_TOO_LONG 502 +#define FBAPI_EC_MESG_RATE 503 +#define FBAPI_EC_MESG_INVALID_THREAD 504 +#define FBAPI_EC_MESG_INVALID_RECIP 505 +#define FBAPI_EC_POKE_INVALID_RECIP 510 +#define FBAPI_EC_POKE_OUTSTANDING 511 +#define FBAPI_EC_POKE_RATE 512 + +#define FQL_EC_UNKNOWN_ERROR 600 +#define FQL_EC_PARSER_ERROR 601 +#define FQL_EC_UNKNOWN_FIELD 602 +#define FQL_EC_UNKNOWN_TABLE 603 +#define FQL_EC_NO_INDEX 604 +#define FQL_EC_UNKNOWN_FUNCTION 605 +#define FQL_EC_INVALID_PARAM 606 +#define FQL_EC_INVALID_FIELD 607 +#define FQL_EC_INVALID_SESSION 608 + +#define FBAPI_EC_REF_SET_FAILED 700 +#define FBAPI_EC_FB_APP_UNKNOWN_ERROR 750 +#define FBAPI_EC_FB_APP_FETCH_FAILED 751 +#define FBAPI_EC_FB_APP_NO_DATA 752 +#define FBAPI_EC_FB_APP_NO_PERMISSIONS 753 +#define FBAPI_EC_FB_APP_TAG_MISSING 754 + +#define FBAPI_EC_DATA_UNKNOWN_ERROR 800 +#define FBAPI_EC_DATA_INVALID_OPERATION 801 +#define FBAPI_EC_DATA_QUOTA_EXCEEDED 802 +#define FBAPI_EC_DATA_OBJECT_NOT_FOUND 803 +#define FBAPI_EC_DATA_OBJECT_ALREADY_EXISTS 804 +#define FBAPI_EC_DATA_DATABASE_ERROR 805 +#define FBAPI_EC_DATA_CREATE_TEMPLATE_ERROR 806 +#define FBAPI_EC_DATA_TEMPLATE_EXISTS_ERROR 807 +#define FBAPI_EC_DATA_TEMPLATE_HANDLE_TOO_LONG 808 +#define FBAPI_EC_DATA_TEMPLATE_HANDLE_ALREADY_IN_USE 809 +#define FBAPI_EC_DATA_TOO_MANY_TEMPLATE_BUNDLES 810 +#define FBAPI_EC_DATA_MALFORMED_ACTION_LINK 811 +#define FBAPI_EC_DATA_TEMPLATE_USES_RESERVED_TOKEN 812 + +#define FBAPI_EC_NO_SUCH_APP 900 +#define FBAPI_BATCH_TOO_MANY_ITEMS 950 +#define FBAPI_EC_BATCH_ALREADY_STARTED 951 +#define FBAPI_EC_BATCH_NOT_STARTED 952 +#define FBAPI_EC_BATCH_METHOD_NOT_ALLOWED_IN_BATCH_MODE 953 + +#define FBAPI_EC_EVENT_INVALID_TIME 1000 +#define FBAPI_EC_INFO_NO_INFORMATION 1050 +#define FBAPI_EC_INFO_SET_FAILED 1051 + +#define FBAPI_EC_LIVEMESSAGE_SEND_FAILED 1100 +#define FBAPI_EC_LIVEMESSAGE_EVENT_NAME_TOO_LONG 1101 +#define FBAPI_EC_LIVEMESSAGE_MESSAGE_TOO_LONG 1102 + +#define FBAPI_EC_PAGES_CREATE 1201 + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +/////////////////////////////////////////////////////////////////////////////////////////////////// +class FBError +{ + +public: + FBError(quint8 aErrorCode) : iErrorCode (aErrorCode) {} + FBError() : iErrorCode(0) {} + + inline quint8 code() const { return iErrorCode; } + inline void setCode( quint8 aErrorCode ) { iErrorCode = aErrorCode; } + + inline QString description() const { return iErrorDescription; } + inline void setDescription( const QString& aErrorDescription ) { iErrorDescription = aErrorDescription; } + +private: + quint8 iErrorCode; + QString iErrorDescription; +}; + +#endif // FBERROR_H_ diff -r b78fa4cdbf2b -r 106a4bfcb866 example/FlickrAuthApp/inc/keys.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/FlickrAuthApp/inc/keys.h Thu Aug 05 16:46:37 2010 +0530 @@ -0,0 +1,14 @@ +/* + * keys.h + * + * Created on: Jul 16, 2010 + * Author: satishkk + */ + +#ifndef KEYS_H_ +#define KEYS_H_ + +static const QString kApiKey = "2835574777f7421bc0d058f5a1ad5a56"; +static const QString kApiSecret = "f902dad777efa173"; + +#endif /* KEYS_H_ */ diff -r b78fa4cdbf2b -r 106a4bfcb866 example/FlickrAuthApp/inc/loginDialog.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/FlickrAuthApp/inc/loginDialog.h Thu Aug 05 16:46:37 2010 +0530 @@ -0,0 +1,55 @@ +/** +* Copyright (c) 2010 Sasken Communication Technologies Ltd. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the "{License}" +* which accompanies this distribution, and is available +* at the URL "{LicenseUrl}". +* +* Initial Contributors: +* Narasimhulu Kavadapu, Sasken Communication Technologies Ltd - Initial contribution +* +* Contributors: +* +* Description: +* Login Dialog class of Authentication Application +*/ + + +#ifndef FB_LOGIN_DIALOG_H_ +#define FB_LOGIN_DIALOG_H_ + +#include "baseDialog.h" +#include "requestSP.h" +#include + +// FORWARD DECLARATIONS +class FBRequest; + +class FBLoginDialog : public FBDialog +{ + Q_OBJECT + +private: + FBRequest* iGetSessionRequest; + +private slots: + /* slots for handling signals from FBRequest iGetSessionRequest */ + void requestDidLoad (const QVariant& aResult); + + void requestFailedWithFlickrError ( const FBError& aError ); + void requestFailedWithNetworkError( QNetworkReply::NetworkError code ); + +public: + FBLoginDialog(FBSession* aSession); + FBLoginDialog(); + void connecttoGetFrob(); + void load(); + +private: + void connectToGetFullToken(); + + void loadLoginPage(); + + }; +#endif diff -r b78fa4cdbf2b -r 106a4bfcb866 example/FlickrAuthApp/inc/requestSP.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/FlickrAuthApp/inc/requestSP.h Thu Aug 05 16:46:37 2010 +0530 @@ -0,0 +1,216 @@ +/** +* Copyright (c) 2010 Sasken Communication Technologies Ltd. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the "{License}" +* which accompanies this distribution, and is available +* at the URL "{LicenseUrl}". +* +* Initial Contributors: +* Narasimhulu Kavadapu, Sasken Communication Technologies Ltd - Initial contribution +* +* Contributors: +* +* Description: +* class to handle calls to rest Server API's +*/ +#ifndef FBREQUEST_H +#define FBREQUEST_H + +#include +#include +#include +#include +#include +#include +#include +#include "progressbar.h" +#include "authAppConstants.h" +#include "xmlParser.h" + +// FORWARD DECLARATIONS +class FBSession; +class FBError; + +/////////////////////////////////////////////////////////////////////////////////////////////////// +class FBRequest : public QObject +{ + Q_OBJECT + +private: + + /* pointer to the session that owns this request */ + FBSession* iSession; + + /** + * The URL which will be contacted to execute the request. + */ + QString iUrl; + + /** + * The API method which will be called. + */ + QString iMethod; + + /** + * An object used by the user of the request to help identify the meaning of the request. + */ + void* iUserInfo; + + /** + * The dictionary of parameters to pass to the method. + * + * These values in the dictionary will be converted to strings using the + * standard Objective-C object-to-string conversion facilities. + */ + Dictionary iParams; + + /** + * A data parameter. + * + * Used for methods such as photos.upload, video.upload, events.create, and + * events.edit. + */ + QByteArray iDataParam; + + /** + * true if iDataParam holds picture data + */ + bool iDataParamPicture; + + /** + * The timestamp of when the request was sent to the server. + */ + QDateTime iTimestamp; + QHttp iConnection; + QByteArray iResponseText; + + QNetworkAccessManager iNetworkAccessManager; + progressbar* pbar; + +signals: /* the signals ommitted by FBRequest */ + + /** + * Called just before the request is sent to the server. + */ + void requestLoading(); + + /** + * Called when an error prevents the request from completing successfully. + */ + void requestFailedWithNetworkError( QNetworkReply::NetworkError code ); + void requestFailedWithFlickrError ( const FBError& aError ); + + /** + * Called when a request returns and its response has been parsed into an object. + * + * The resulting object may be a dictionary, an array, a string, or a number, depending + * on thee format of the API response. + */ + void requestDidLoad ( const QVariant& aResult); + + + +private slots: + void networkReplyError ( QNetworkReply::NetworkError code ); + void networkReplyFinished (); + +public: /* class functions */ + /** + * Creates a new API request for the global session. + */ + static FBRequest* request(); + + /** + * Creates a new API request for a particular session. + */ + static FBRequest* requestWithSession (FBSession* aSession); + +public: /* instance functions */ + + /** + * Creates a new request paired to a session. + */ + FBRequest (FBSession* aSession); + + /** + * Calls a method on the server asynchronously. + * + * The delegate will be called for each stage of the loading process. + */ + void call (const QString& aMethod, const Dictionary& aParams); + + void callforToken (); + + /** + * Calls a method on the server asynchronously, with a file upload component. + * + * The delegate will be called for each stage of the loading process. + */ + void callWithDataParams (const QString& aMethod, const Dictionary& aParams, const QByteArray& aDataParam, bool aDataParamPicture); + + /** + * Calls a URL on the server asynchronously. + * + * The delegate will be called for each stage of the loading process. + */ + void post( const QString& aUrl, const Dictionary& aParams); + + /** + * Stops an active request before the response has returned. + */ + void cancel(); + + /** + * returns the time stamp of when the request was sent to the server + */ + const QDateTime& timeStamp() const; + + void connect(); + + QString generateSig(Dictionary Params); + + void proxysettings(); + +private: + /** + * Given a string returns its hex coded md5 hash + */ + static QString md5(const QString&); + + /** + * @return true if the current request method is a special method + */ + bool isSpecialMethod() const; + + /** + * @return QString a url to use for the given method + */ + QString urlForMethod (const QString& aMethod) const; + + /** + * @return the Get Url for the request + */ + QString generateGetURL() const; + + QString generateCallId() const; + + + void generatePostBody(QByteArray& body); + + /** + * handles the data received from the server + * @param aResponseData is the data received from the server + */ + void handleResponseData( const QByteArray& aResponseData ); + + /** + * @param aResponseData is the data received from the server + * @param aError will get error codes if any error occurs ( this will change in the future ) + * @return a void* pointer, this will change + */ + QVariant parseXMLResponse ( const QByteArray& aResponseData, FBError& aError); + +}; + +#endif // FBREQUEST_H diff -r b78fa4cdbf2b -r 106a4bfcb866 example/FlickrAuthApp/inc/sessionSP.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/FlickrAuthApp/inc/sessionSP.h Thu Aug 05 16:46:37 2010 +0530 @@ -0,0 +1,209 @@ +/** +* Copyright (c) 2010 Sasken Communication Technologies Ltd. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the "{License}" +* which accompanies this distribution, and is available +* at the URL "{LicenseUrl}". +* +* Initial Contributors: +* Narasimhulu Kavadapu, Sasken Communication Technologies Ltd - Initial contribution +* +* Contributors: +* +* Description: +* class to maintian session & all credential keys. +*/ + +#ifndef FBSESSION_H +#define FBSESSION_H + +#include +#include +#include +#include +#include +#include "smfcredmgrclient.h" +#include "authAppConstants.h" + +// FORWARD DECLARATIONS +class FBRequest; + +const QString KFacebokkKeysFileName = "c://Data//FacebookKeys.txt"; + +/////////////////////////////////////////////////////////////////////////////////////////////////// +/** + * An FBSession represents a single user's authenticated session for a Facebook application. + * + * To create a session, you must use the session key of your application (which can + * be found on the Facebook developer website). You may then use the login dialog to ask + * the user to enter their email address and password. If successful, you will get back a + * session key which can be used to make requests to the Facebook API. + * + * Session keys are cached and stored on the disk of the device so that you do not need to ask + * the user to login every time they launch the app. To restore the last active session, call the + * resume method after instantiating your session. + */ +class FBSession : public QObject +{ + Q_OBJECT + +private: + /** + * Your application's API key, as passed to the constructor. + */ + QString iApiKey; + + /** + * Your application's API secret, as passed to the constructor. + */ + QString iApiSecret; + + /** + * The current user's Frob key. + */ + QString iFrobKey; + + /** + * The current user's Full token + */ + QString iToken; + + /** + * The settings object used to restore session from the disk. + */ + QSettings iSettings; + /** + * The Credentail Object used to store auth data + */ + SmfCredMgrClient* m_Client; + /** + * Variable to store + */ + QString iCMRegToken; + +signals: /* the signals ommitted by FBSession */ + + /** + * Called when session logged in sucessfully + * @param SessionKey is the fb assigned session key + */ + void sessionDidLogin (QString SessionKey); + + /** + * Called when a user closes the login dialog without logging in. + */ + void sessionDidNotLogin (); + + /** + * Called when a session is about to log out. + * @param aUid is the fb assigned session id + */ + void sessionWillLogout (); + + /** + * Called when a session has logged out. + */ + void sessionDidLogout (); + +public: /* class functions */ + + /** + * The globally shared session instance. + */ + static FBSession* session(); + + /** + * Sets the globally shared session instance. + * + * This session is not retained, so you are still responsible for retaining it yourself. The + * first session that is created is automatically stored here. + */ + static void setSession(FBSession* aSession); + + /** + * Constructs a session and stores it as the globally shared session instance. + * + * @param aSessionProxy a url to that proxies auth.getSession + */ + static FBSession* sessionForApplication ( const QString& aKey, const QString& aSecret, const QString& aSessionProxy); + +public: /* instance functions */ + + /** + * Constructs a session for an application. + * + * @param secret the application secret (optional) + * @param getSessionProxy a url to that proxies auth.getSession (optional) + */ + FBSession( const QString& aKey, const QString& aSecret, const QString& aSessionProxy ); + + /** + * Destructor + */ + ~FBSession(); + + /** + * Saves Frob Key + */ + void SaveFrobKey ( const QString& aFrob); + + /** + * Saves Token + */ + void Savetoken (const QString& token ); + + /** + * Resumes a previous session whose uid, session key, and secret are cached on disk. + */ + bool resume(); + + /** + * Ends the current session and deletes the uid, session key, and secret from disk. + */ + void logout(); + + /** + * Sends a fully configured request to the server for execution. + */ + void send (FBRequest* aRequest); + + /** + * @return const QString& http:// URL to the facebook REST server + */ + const QString& apiURL() const; + /** + * @return const QString& the api secret + */ + const QString& apiSecret() const { return iApiSecret; } + + /** + * @return api key for this session + */ + const QString& apiKey() const { return iApiKey; } + + /** + * @return the Frob key + */ + const QString& frobKey() const { return iFrobKey; } + +private: + + /** + * Saves the fb connect session information to disk + */ + void save(); + /** + * Forgets any fb connect session information saved to disk + */ + void unsave(); + /** + * @param aRequest, the request to perform. + * @param aEnqueue, if true add to queue if cant perform the request right now + */ + bool performRequest(FBRequest* aRequest, bool aEnqueue); + + +}; + +#endif // FBSESSION_H diff -r b78fa4cdbf2b -r 106a4bfcb866 example/FlickrAuthApp/inc/xmlParser.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/FlickrAuthApp/inc/xmlParser.h Thu Aug 05 16:46:37 2010 +0530 @@ -0,0 +1,84 @@ +/** +* Copyright (c) 2010 Sasken Communication Technologies Ltd. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the "{License}" +* which accompanies this distribution, and is available +* at the URL "{LicenseUrl}". +* +* Initial Contributors: +* Narasimhulu Kavadapu, Sasken Communication Technologies Ltd - Initial contribution +* +* Contributors: +* +* Description: +* XML Parser class +*/ + +#ifndef FB_XML_HANDLER_H +#define FB_XML_HANDLER_H + +#include +#include +#include +#include + +#include "authAppConstants.h" + +// FORWARD DECLARATIONS +class FBRequest; + +/////////////////////////////////////////////////////////////////////////////////////////////////// +class FBXMLHandler : public QObject, public QXmlDefaultHandler +{ + Q_OBJECT + +private: + QVariantList iStack; + QList iNameStack; + QVariant iRootObject; + QString iRootName; + QString iChars; + + QString iParseErrorMessage; + bool iError; + +public: /* class functions */ + + FBXMLHandler(); + ~FBXMLHandler(); + + inline const QString& rootName() const { return iRootName; } + inline QVariant rootObject() const { return iRootObject; } + + inline bool parseError() const { return iError; } + +private: + /* methods from QXmlDefaultHandler */ + bool startElement( const QString & namespaceURI, + const QString & localName, + const QString & qName, + const QXmlAttributes & atts); + bool characters(const QString& text); + bool endElement( const QString & namespaceURI, + const QString & localName, + const QString & qName ); + + /* methods from QXmlErrorHandler */ + bool error(const QXmlParseException& exception); + bool fatalError(const QXmlParseException& exception); + + /* private functions*/ + const QString& topName() const; + void flushCharacters(); + QVariant topObject(bool aCreate); + + QVariant topContainer(); + + + void initWhiteSpaceHash(); + QHash iWhiteSpaceAndNewLineCharSet; + +}; + +#endif // FB_XML_HANDLER_H diff -r b78fa4cdbf2b -r 106a4bfcb866 example/FlickrAuthApp/main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/FlickrAuthApp/main.cpp Thu Aug 05 16:46:37 2010 +0530 @@ -0,0 +1,80 @@ +/**************************************************************************** +** +** Trolltech hereby grants a license to use the Qt/Eclipse Integration +** plug-in (the software contained herein), in binary form, solely for the +** purpose of creating code to be used with Trolltech's Qt software. +** +** Qt Designer is licensed under the terms of the GNU General Public +** License versions 2.0 and 3.0 ("GPL License"). Trolltech offers users the +** right to use certain no GPL licensed software under the terms of its GPL +** Exception version 1.2 (http://trolltech.com/products/qt/gplexception). +** +** THIS SOFTWARE IS PROVIDED BY TROLLTECH AND ITS CONTRIBUTORS (IF ANY) "AS +** IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +** TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +** PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER +** OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +** EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +** PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +** PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +** LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +** NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." +** +** Since we now have the GPL exception I think that the "special exception +** is no longer needed. The license text proposed above (other than the +** special exception portion of it) is the BSD license and we have added +** the BSD license as a permissible license under the exception. +** +****************************************************************************/ + +#include "AuthApp.h" + +#include +#include + +void debugOutput(QtMsgType type, const char *msg) + { + QFile logFile("c://data//FlickrLog.txt"); + Q_ASSERT(logFile.open( QIODevice::WriteOnly | QIODevice::Text | QIODevice::Append )); + QTextStream stream(&logFile); + + switch (type) + { + case QtDebugMsg: + stream<setTextVisible(false); +} + + +progressbar::~progressbar() +{ + +} diff -r b78fa4cdbf2b -r 106a4bfcb866 example/FlickrAuthApp/progressbar.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/FlickrAuthApp/progressbar.h Thu Aug 05 16:46:37 2010 +0530 @@ -0,0 +1,19 @@ +#ifndef PROGRESSBAR_H +#define PROGRESSBAR_H + +#include +#include "ui_progressbar.h" + +class progressbar : public QWidget +{ + Q_OBJECT + +public: + progressbar(QWidget *parent = 0); + ~progressbar(); + +private: + Ui::progressbarClass ui; +}; + +#endif // PROGRESSBAR_H diff -r b78fa4cdbf2b -r 106a4bfcb866 example/FlickrAuthApp/progressbar.ui --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/FlickrAuthApp/progressbar.ui Thu Aug 05 16:46:37 2010 +0530 @@ -0,0 +1,31 @@ + + progressbarClass + + + progressbar + + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Loading,Please wait.....</span></p></body></html> + + + + + + + 24 + + + + + + + + + diff -r b78fa4cdbf2b -r 106a4bfcb866 example/FlickrAuthApp/src/baseDialog.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/FlickrAuthApp/src/baseDialog.cpp Thu Aug 05 16:46:37 2010 +0530 @@ -0,0 +1,360 @@ +/** +* Copyright (c) 2010 Sasken Communication Technologies Ltd. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the "{License}" +* which accompanies this distribution, and is available +* at the URL "{LicenseUrl}". +* +* Initial Contributors: +* Narasimhulu Kavadapu, Sasken Communication Technologies Ltd - Initial contribution +* +* Contributors: +* +* Description: +* Base class of All dialogs +*/ + +#define EMULATORTESTING + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + #include +#include +#include +//#include +#include "baseDialog.h" +#include "sessionSP.h" +#include "errorCodes.h" + +static const QString kDefaultTitle = "Connect to Facebook"; +static const QString kStringBoundary = "3i2ndDfv2rTHiSisAbouNdArYfORhtTPEefj3q2f"; +static const QString kMinitokensuccessURL = "http://m.flickr.com/services/auth/"; +static const QString kInvalidUrl = "http://mlogin.yahoo.com/w/login"; + +static QNetworkAccessManager namanager; + +///////////////////////////////////////////////////////////////////////////////////////////////////////////// + +FBDialog::FBDialog() : iSession(FBSession::session()), /*iWebView ( this ),*/ iIgnorePageLoadCompleteEvent( false ) +{ + createControls(); +} + +FBDialog::FBDialog(FBSession* aSession) : iSession ( aSession ), /*iWebView ( this ) ,*/ iIgnorePageLoadCompleteEvent ( false ) +{ + createControls(); +} +void FBDialog::createControls() +{ + iWebView = new QWebView(this); + iWebView->page()->setNetworkAccessManager(&namanager); + + iWebView->page()->setLinkDelegationPolicy(QWebPage::DelegateAllLinks); + + layout = new QVBoxLayout(this); + + + progressbar = new QProgressBar(this); + + layout->addWidget(iWebView); + layout->addWidget(progressbar); + + setLayout(layout); + + progressbar->setOrientation(Qt::Horizontal); + + + connect( iWebView->page(), SIGNAL(linkClicked(const QUrl &)), + this, SLOT(linkClicked(const QUrl &))); + + connect ( iWebView->page(), SIGNAL(loadFinished(bool)), this, SLOT(loadFinished(bool))); + + connect ( iWebView->page(), SIGNAL(loadStarted()), this, SLOT ( loadStarted())); + + connect ( iWebView->page(), SIGNAL(loadProgress(int)), this, SLOT ( loadProgress(int))); + + //connect ( iWebView->page(), SIGNAL(urlChanged ( const QUrl & url )), this, SLOT (urlChanged ( const QUrl & url ) )); + + connect (iWebView->page()->networkAccessManager(),SIGNAL( authenticationRequired( QNetworkReply*, QAuthenticator*)),this,SLOT( slotAuthenticationRequired( QNetworkReply*, QAuthenticator*))); + connect (iWebView->page()->networkAccessManager(),SIGNAL( sslErrors( QNetworkReply*,QList&)),this,SLOT( slotsslErrors( QNetworkReply*,QList&)) ); + connect (iWebView->page()->networkAccessManager(),SIGNAL( proxyAuthenticationRequired(QNetworkProxy&, QAuthenticator*)),this,SLOT( slotproxyAuthenticationRequired(QNetworkProxy&, QAuthenticator*)) ); + +} +QString FBDialog::generateURL( const QString& aUrl, const QHash& aParams) const +{ + QString url ( aUrl ); + + QStringList pairs; + QHashIterator i(aParams); + + while (i.hasNext()) { + i.next(); + + QUrl url (i.value()); + QString pair = i.key() + "=" + url.toEncoded(); + pairs << pair.toUtf8(); + } + + if (pairs.count()) + { + url = url + "?" + pairs.join("&"); + } + + return url; + +} + +QByteArray FBDialog::generatePostBody (const QHash& aParams) const +{ + QByteArray body; + + if (!aParams.count()) + return body; + + + QString endLine = "\r\n--" + kStringBoundary + "\r\n", kStringBoundary; + + QString tmp = "--" + kStringBoundary + "\r\n"; + body.append(tmp.toUtf8()); + + + QHashIterator i(aParams); + while (i.hasNext()) { + i.next(); + + tmp = "Content-Disposition: form-data; name=\"" + i.key().toUtf8() + "\"\r\n\r\n" ; + body.append(tmp.toUtf8()); + body.append(i.value().toUtf8()); + body.append(endLine.toUtf8()); + } + + return body; +} + +void FBDialog::postDismissCleanup() +{ + //accept(); + // could also be reject()? +} + +void FBDialog::dismiss (bool /*aAnimated*/) { + dialogWillDisappear(); + iLoadingUrl.clear(); + + //todo: do some animations if aAnimated == true ! + postDismissCleanup(); +} + + +void FBDialog::dismissWithSuccess( bool aSuccess, bool aAnimated) +{ + if (aSuccess) { + emit dialogDidSucceed(); + } else { + emit dialogDidCancel(); + } + + dismiss(aAnimated); +} + +void FBDialog::dismissWithError (const FBError& aError) +{ + QMessageBox msgbox; + QString msg ("Error!Please try again!"); + msgbox.setText(msg); +} +void FBDialog::slotAuthenticationRequired( QNetworkReply* reply, QAuthenticator* authenticator ) + { + QMessageBox msgbox; + QString msg ("Error!Authentication Required"); + msgbox.setText(msg); + } +void FBDialog::slotsslErrors( QNetworkReply* reply, const QList& errors ) + { + QMessageBox msgbox; + QString msg ("Error!SSL Error"); + msgbox.setText(msg); + } +void FBDialog::slotproxyAuthenticationRequired( const QNetworkProxy& proxy, QAuthenticator* authenticator ) + { + QMessageBox msgbox; + QString msg ("Error!Proxy Authenticatio Required"); + msgbox.setText(msg); + } +void FBDialog::cancel() +{} + +void FBDialog::load() {} + +void FBDialog::show() +{ + + load(); + showMaximized(); + dialogWillAppear(); + +} + +void FBDialog::loadURL(const QString& aUrl, QNetworkAccessManager::Operation aMethod, const QHash& aGetParams, const QHash& aPostParams) +{ + //proxysettings(); + iIgnorePageLoadCompleteEvent = false; + + QNetworkCookieJar* cookieJar = iWebView->page()->networkAccessManager()->cookieJar(); + QByteArray body; + + // iLoadingUrl = aUrl; + iLoadingUrl = generateURL(aUrl, aGetParams); + + // This "test cookie" is required by login.php, or it complains that you need to enable JavaScript + QNetworkCookie testCookie ("test_cookie", "1"); + testCookie.setDomain ( "www.flickr.com" ); + testCookie.setPath ( "/" ); + + QList cookieList; + cookieList.append(testCookie); + + cookieJar->setCookiesFromUrl ( cookieList, QUrl(iLoadingUrl) ); + + QUrl url (iLoadingUrl); + QNetworkRequest request(aUrl); + + if (aMethod == QNetworkAccessManager::PostOperation) + { + const QString contentType = "multipart/form-data; boundary=" + kStringBoundary; + request.setHeader (QNetworkRequest::ContentTypeHeader, contentType); + body = generatePostBody (aPostParams); + } + + proxysettings(); + + + qDebug()<< "Check URL : " << iLoadingUrl; + + //iWebView->load ( request, aMethod, body); + iWebView->load(url); + qDebug() << "Loading url: " << iLoadingUrl; +} +void FBDialog::proxysettings() +{ +#ifdef EMULATORTESTING + qDebug()<<"proxysettings"; + + // Reading the keys, CSM Stubbed - START + QFile file("c://data//DoNotShare.txt"); + if (!file.open(QIODevice::ReadOnly)) + { + qDebug()<<"File to read the windows username and password could not be opened, returning!!!"; + return; + } + + QByteArray arr = file.readAll(); + QList list = arr.split(' '); + file.close(); + + QString username(list[0]); + QString password(list[1]); + + QString httpProxy = "10.1.0.214";//ipwproxy.sasken.com + QString httpPort = "3128"; + + QString httpUser =username;/* This could be taken thru an QDialog implmentation to remove the Hard coding */ + QString httpPass =password;/* This could be taken thru an QDialog implmentation to remove the Hard coding */ + + /*==Classes used from Network Module==*/ + QNetworkProxy proxy; + + proxy.setType(QNetworkProxy::HttpProxy); + proxy.setHostName(httpProxy); + proxy.setPort(httpPort.toInt()); + proxy.setUser(httpUser); + proxy.setPassword(httpPass); + + QNetworkProxy::setApplicationProxy(proxy); +#endif +} +void FBDialog::dialogWillAppear() {} + +void FBDialog::dialogWillDisappear() {} + +void FBDialog::dialogDidSucceed (const QUrl& /*aUrl*/) { + dismissWithSuccess(true,true); +} + +///////////////////////////////////////////////////////////////////////////////////////////////////////////// +void FBDialog::linkClicked ( const QUrl & url ) + { + + qDebug() << "Loading the url: " << url; + + proxysettings(); + iWebView->load(url); +} + +void FBDialog::loadStarted() +{ + qDebug() << "Load started: " << iWebView->url(); + progressbar->setVisible(true); +} +void FBDialog::loadProgress(int progress) +{ + progressbar->setValue(progress); +} +/*void FBDialog::urlChanged ( const QUrl & url ) + { + if(url.toString().contains(kInvalidUrl)) + { + QUrl newurl(iWebView->url().toString()); + qDebug()<<"url changed"<url().toString()<<"\n"; + iWebView->setUrl(newurl); + iWebView->load(iWebView->url().toString()); + } + }*/ +void FBDialog::GetSessionKey(const QUrl& aUrl) +{ + +} +void FBDialog::connectToGetFullToken() +{ + +} +void FBDialog::loadFinished ( bool ok ) +{ + qDebug() << "Load " << (ok ? "" : "un") << "successfull for: " << iWebView->url(); + progressbar->setVisible(false); + if (ok) + { + QString url = iWebView->url().toString(); + qDebug() << "Loaded URL " << url; + qDebug() << "To be compared URL " << kMinitokensuccessURL; + if(url.compare(kMinitokensuccessURL) == 0) + { + iWebView->setHidden(true); + QMessageBox msgbox; + QString msg ("Complete the Authorization?"); + msgbox.setText(msg); + msgbox.exec(); + + connectToGetFullToken(); + + } + } + else + { + if (iIgnorePageLoadCompleteEvent) + return; + + FBError err; + dismissWithError(err); + } +} diff -r b78fa4cdbf2b -r 106a4bfcb866 example/FlickrAuthApp/src/loginDialog.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/FlickrAuthApp/src/loginDialog.cpp Thu Aug 05 16:46:37 2010 +0530 @@ -0,0 +1,131 @@ +/** +* Copyright (c) 2010 Sasken Communication Technologies Ltd. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the "{License}" +* which accompanies this distribution, and is available +* at the URL "{LicenseUrl}". +* +* Initial Contributors: +* Narasimhulu Kavadapu, Sasken Communication Technologies Ltd - Initial contribution +* +* Contributors: +* +* Description: +* Login Dialog class of Authentication Application +*/ + +#include "authAppConstants.h" +#include "sessionSP.h" +#include "errorCodes.h" +#include "loginDialog.h" +#include + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// global + +static const QString kLoginURL = "http://www.flickr.com/services/auth/"; +//static const QString kLoginURL = "http://www.flickr.com/auth-72157623913597531"; + + +/////////////////////////////////////////////////////////////////////////////////////////////////// +void FBLoginDialog::connectToGetFullToken() +{ + if(iGetSessionRequest == NULL ){ + + iGetSessionRequest = FBRequest::requestWithSession(iSession); + + connect(iGetSessionRequest, SIGNAL(requestDidLoad(QVariant)), this, SLOT(requestDidLoad(QVariant))); + connect(iGetSessionRequest, SIGNAL(requestFailedWithNetworkError(QNetworkReply::NetworkError)), this, SLOT(requestFailedWithNetworkError(QNetworkReply::NetworkError))); + connect(iGetSessionRequest, SIGNAL(requestFailedWithFlickrError(FBError)), this, SLOT(requestFailedWithFlickrError(FBError))); + + } + + iGetSessionRequest->callforToken(); +} +void FBLoginDialog::connecttoGetFrob() +{ + qDebug()<<"Inside FBLoginDialog::connecttoGetFrob"; + iGetSessionRequest = FBRequest::requestWithSession(iSession); + + connect(iGetSessionRequest, SIGNAL(requestDidLoad(QVariant)), this, SLOT(requestDidLoad(QVariant))); + connect(iGetSessionRequest, SIGNAL(requestFailedWithNetworkError(QNetworkReply::NetworkError)), this, SLOT(requestFailedWithNetworkError(QNetworkReply::NetworkError))); + connect(iGetSessionRequest, SIGNAL(requestFailedWithFlickrError(FBError)), this, SLOT(requestFailedWithFacebookError(FBError))); + + Dictionary params; + + iGetSessionRequest->call("flickr.auth.getFrob", params); + +} +void FBLoginDialog::loadLoginPage() +{ + Dictionary getParams, postParams; + + getParams["api_key"] = iSession->apiKey(); + getParams["perms"] = "delete"; + getParams["frob"] = iSession->frobKey(); + + FBRequest* req = FBRequest::requestWithSession(iSession); + QString sig = req->generateSig(getParams); + + getParams["api_sig"] = sig; + + QString fullURL; + fullURL = kLoginURL /*+ "?" + "api_key=" + iSession->apiKey() + "&perms=delete&frob=" + iSession->frobKey() + "&api_sig=" + sig*/; + + loadURL(fullURL,QNetworkAccessManager::GetOperation, getParams, postParams); + +} +/////////////////////////////////////////////////////////////////////////////////////////////////// + +FBLoginDialog::FBLoginDialog() : FBDialog () {} + +FBLoginDialog::FBLoginDialog(FBSession* aSession) : FBDialog(aSession) {} + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// FBDialog + +void FBLoginDialog::load() +{ + loadLoginPage(); +} +/////////////////////////////////////////////////////////////////////////////////////////////////// +// slots for signals from FBRequest + +void FBLoginDialog::requestDidLoad(const QVariant& aResult) +{ + qDebug()<<"Inside FBLoginDialog::requestDidLoad"; + bool conversionError = false; + QVariantHash object = aResult.toHash(); + + QString frob = object.value("frob").toString(); + if(frob.length()){ + iSession->SaveFrobKey(frob); + show(); + } + qDebug()<<"frob = "<Savetoken(token); + } + + } +} + +void FBLoginDialog::requestFailedWithFlickrError (const FBError& aCode ) +{ + dismissWithError(aCode); +} + +void FBLoginDialog::requestFailedWithNetworkError( QNetworkReply::NetworkError aCode ) +{ + dismissWithError(aCode); +} diff -r b78fa4cdbf2b -r 106a4bfcb866 example/FlickrAuthApp/src/requestSP.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/FlickrAuthApp/src/requestSP.cpp Thu Aug 05 16:46:37 2010 +0530 @@ -0,0 +1,412 @@ +/** +* Copyright (c) 2010 Sasken Communication Technologies Ltd. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the "{License}" +* which accompanies this distribution, and is available +* at the URL "{LicenseUrl}". +* +* Initial Contributors: +* Narasimhulu Kavadapu, Sasken Communication Technologies Ltd - Initial contribution +* +* Contributors: +* +* Description: +* class to handle calls to rest Server API's +*/ + +#define EMULATORTESTING + +#include "requestSP.h" +#include "sessionSP.h" +#include "xmlParser.h" +#include "errorCodes.h" + +#include +#include +#include +#include +#include +#include + #include + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// global + +static const QString kAPIVersion = "1.0"; +static const QString kAPIFormat = "XML"; +static const QString kStringBoundary = "3i2ndDfv2rTHiSisAbouNdArYfORhtTPEefj3q2f"; + +static const double kTimeoutInterval = 180.0; + + +/////////////////////////////////////////////////////////////////////////////////////////////////// + +static bool caseInsensitiveLessThan(const QString &s1, const QString &s2) +{ + return s1.toLower() < s2.toLower(); +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Static class functions + +FBRequest* FBRequest::request() +{ + return FBRequest::requestWithSession(FBSession::session()); +} + +FBRequest* FBRequest::requestWithSession (FBSession* aSession) +{ + FBRequest* request = new FBRequest(aSession); + return request; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// instance public functions +FBRequest::FBRequest(FBSession* aSession) : iSession ( aSession ), iNetworkAccessManager ( this ) +{} + +const QDateTime& FBRequest::timeStamp() const +{ + return iTimestamp; +} + +void FBRequest::connect() +{ + qDebug()<<"Inside FBRequest::connect"; + emit requestLoading(); + + + + QString url ; + /*if (iMethod.length()) + url = iUrl; + else*/ + url = generateGetURL(); + + qDebug() << "Complete URL : " << url; + + QNetworkRequest request; + request.setUrl(QUrl(url)); + + /* from the Qt docs on QNetworkAccessManager: + QNetworkAccessManager by default does not have a set cache. + Qt provides a simple disk cache, QNetworkDiskCache, which can be used. + + However we will not use it.*/ + + request.setAttribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::AlwaysNetwork); + request.setAttribute(QNetworkRequest::CacheSaveControlAttribute, false); + + iTimestamp = QDateTime::currentDateTime(); + + if (iMethod.length()) + { + const QString contentType = "multipart/form-data; boundary=" + kStringBoundary; + request.setRawHeader("Content-Type", contentType.toUtf8()); + + /* connect all signals from iNetWorkAccessManager to this */ + QByteArray postBody ; + generatePostBody (postBody); + + pbar = new progressbar; + pbar->show(); + + #ifdef __WINSCW__ + proxysettings(); + #endif + QNetworkReply* reply = iNetworkAccessManager.get(request); + + QObject::connect(reply, SIGNAL(finished()), this, SLOT(networkReplyFinished())); + QObject::connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), + this, SLOT(networkReplyError(QNetworkReply::NetworkError))); + + } +} +void FBRequest::proxysettings() +{ +#ifdef EMULATORTESTING + qDebug()<<"proxysettings"; + + // Reading the keys, CSM Stubbed - START + QFile file("c://data//DoNotShare.txt"); + if (!file.open(QIODevice::ReadOnly)) + { + qDebug()<<"File to read the windows username and password could not be opened, returning!!!"; + return; + } + + QByteArray arr = file.readAll(); + QList list = arr.split(' '); + file.close(); + + QString username(list[0]); + QString password(list[1]); + + QString httpProxy = "10.1.0.214";//ipwproxy.sasken.com + QString httpPort = "3128"; + + QString httpUser =username;/* This could be taken thru an QDialog implmentation to remove the Hard coding */ + QString httpPass =password;/* This could be taken thru an QDialog implmentation to remove the Hard coding */ + + /*==Classes used from Network Module==*/ + QNetworkProxy proxy; + + proxy.setType(QNetworkProxy::HttpProxy); + proxy.setHostName(httpProxy); + proxy.setPort(httpPort.toInt()); + proxy.setUser(httpUser); + proxy.setPassword(httpPass); + + QNetworkProxy::setApplicationProxy(proxy); +#endif +} +/////////////////////////////////////////////////////////////////////////////////////////////////// +// instance private functions +QString FBRequest::md5(const QString& aData) +{ + QByteArray byteArray; + byteArray.insert(0, aData.toUtf8()); + + QByteArray md5Hash = QCryptographicHash::hash(byteArray,QCryptographicHash::Md5 ).toHex(); + QString returnString ( md5Hash ); + + return returnString; +} + +bool FBRequest::isSpecialMethod() const { + return ( iMethod.compare("facebook.auth.getSession", Qt::CaseInsensitive) == 0 + || iMethod.compare("facebook.auth.createToken", Qt::CaseInsensitive) == 0 ); +} + +QString FBRequest::urlForMethod (const QString& aMethod) const { + + return iSession->apiURL(); +} + +QString FBRequest::generateGetURL() const +{ + const QUrl url(iUrl); + const QString queryPrefix = url.hasQuery() ? "&" : "?"; + + QStringList pairs; + DictionaryIterator i(iParams); + + while (i.hasNext()) { + i.next(); + pairs << i.key().toUtf8() + "=" + i.value().toUtf8(); + } + + return iUrl + queryPrefix + pairs.join("&"); +} + +QString FBRequest::generateCallId() const { + QDateTime dateTime = QDateTime::currentDateTime(); + uint secs = dateTime.toTime_t(); + QString result = QString::number(secs, 10); + return result; +} + +QString FBRequest::generateSig(Dictionary Params) +{ + QString joined; + QStringList keys = Params.keys(); + + qSort(keys.begin(), keys.end(), caseInsensitiveLessThan); + + QListIterator i(keys); + + joined.append(iSession->apiSecret().toUtf8()); + + while (i.hasNext()) + { + const QString key = i.next(); + joined.append(key.toUtf8()); + //joined.append("="); + joined.append(Params.value(key).toUtf8()); + } + + return md5(joined); +} + +void FBRequest::generatePostBody( QByteArray& body ) +{ + QString endLine = "\r\n--" + kStringBoundary + "\r\n"; + body.append( "--" + kStringBoundary.toUtf8() + "\r\n" ) ; + + + DictionaryIterator i (iParams); + + while (i.hasNext()) + { + i.next(); + + body.append("Content-Disposition: form-data; name=\"" + i.key().toUtf8() + "\"\r\n\r\n" ); + body.append(i.value().toUtf8()); + body.append(endLine.toUtf8()); + } + + + if (iDataParam.size()) + { + if (iDataParamPicture) + { + body.append("Content-Disposition: form-data; filename=\"photo\"\r\n" ); + body.append("Content-Type: image/png\r\n\r\n" ); + } + else + { + body.append("Content-Disposition: form-data; filename=\"data\"\r\n"); + body.append("Content-Type: content/unknown\r\n\r\n"); + } + + body.append(iDataParam); + body.append(endLine.toUtf8()); + + } +} + +void FBRequest::handleResponseData( const QByteArray& aResponseData ) +{ + qDebug()<<"Inside FBRequest::handleResponseData"; + FBError error; + QVariant result = parseXMLResponse( aResponseData, error); + + qDebug() << "parsed result : " << result; + + if (error.code() != 0) + { + emit requestFailedWithFlickrError(error); + } + else + { + emit requestDidLoad(result); + } + + delete pbar; +} + +void FBRequest::post( const QString& aUrl, const Dictionary& aParams) +{ + iUrl = aUrl; + iParams = aParams; + + iSession->send(this); +} + +void FBRequest::cancel() +{ + +} + + +void FBRequest::call (const QString& aMethod, const Dictionary& aParams) +{ + qDebug()<<"Inside FBRequest::call"; + QByteArray dataParams; + callWithDataParams(aMethod, aParams, dataParams, false); + +} +void FBRequest::callforToken () +{ + + iUrl = iSession->apiURL(); + iMethod = "flickr.auth.getToken"; + + Dictionary params; + params["method"] = iMethod; + params["api_key"] = iSession->apiKey(); + params["frob"] = iSession->frobKey(); + + // XXX: workaround what seems to be a Qt bug with the extras-devel libraries. + QString signature = generateSig(params); + + params["api_sig"] = signature; + + iParams = params; + // XXX: end workaround. + + iSession->send(this); +} + +void FBRequest::callWithDataParams (const QString& aMethod, const Dictionary& aParams, const QByteArray& aDataParam, bool aDataParamPicture) +{ + qDebug()<<"Inside FBRequest::callWithDataParams"; + iUrl = urlForMethod(aMethod); + iMethod = aMethod; + iParams = aParams; + iDataParam = aDataParam; + iDataParamPicture = aDataParamPicture; + + + iParams["method"] = iMethod; + iParams["api_key"] = iSession->apiKey(); + + // XXX: workaround what seems to be a Qt bug with the extras-devel libraries. + QString signature = generateSig(iParams); + iParams["api_sig"] = signature; + // XXX: end workaround. + + iSession->send(this); +} + + +QVariant FBRequest::parseXMLResponse ( const QByteArray& aResponseData, FBError& aError) +{ + qDebug()<<"Inside FBRequest::parseXMLResponse"; + QXmlInputSource input; + input.setData(aResponseData); + + FBXMLHandler handler; + QXmlSimpleReader parser; + parser.setContentHandler(&handler); + bool result = parser.parse(&input); + + QVariant rootObject = handler.rootObject(); + + + if (handler.parseError() || !result) + { + aError.setCode( FBRESPONSE_PARSE_ERROR ); + aError.setDescription("parser was unable to parse the xml response from facebook server."); + + return QVariant(); + } + else if (handler.rootName().compare("error_response")==0) + { + QVariantHash errorDict = rootObject.toHash(); + + bool result; + int errorCode = errorDict.value("error_code").toInt(&result); + + aError.setCode( errorCode ); + aError.setDescription( errorDict.value("error_msg").toString() ); + + return rootObject; + } + else + { + return rootObject; + } + +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// instance provate slots +void FBRequest::networkReplyError ( QNetworkReply::NetworkError aCode ) +{ + emit requestFailedWithNetworkError(aCode ); +} + +void FBRequest::networkReplyFinished () +{ + qDebug()<<"Inside FBRequest::networkReplyFinished"; + QNetworkReply* reply = static_cast ( sender() ); + QByteArray responseData = reply->readAll(); + + qDebug() << "Response Data(QByteArray) : " << responseData; + QString str(responseData); + qDebug() << "Response Data(QString) : " << str; + handleResponseData ( responseData ); + +} diff -r b78fa4cdbf2b -r 106a4bfcb866 example/FlickrAuthApp/src/sessionSP.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/FlickrAuthApp/src/sessionSP.cpp Thu Aug 05 16:46:37 2010 +0530 @@ -0,0 +1,190 @@ +/** +* Copyright (c) 2010 Sasken Communication Technologies Ltd. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the "{License}" +* which accompanies this distribution, and is available +* at the URL "{LicenseUrl}". +* +* Initial Contributors: +* Narasimhulu Kavadapu, Sasken Communication Technologies Ltd - Initial contribution +* +* Contributors: +* +* Description: +* class to maintian session & all credential keys. +*/ + +#include "sessionSP.h" +#include "requestSP.h" +#include +#include +#include + +#include "keys.h" + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// global + +static const QString kAPIRestURL = "http://api.flickr.com/services/rest/"; + +static const int kMaxBurstRequests = 3; +static const int kBurstDuration = 2; + +static FBSession* sharedSession = NULL; + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// Static class functions +FBSession* FBSession::session() +{ + return sharedSession; +} + +void FBSession::setSession(FBSession* aSession) +{ + sharedSession = aSession; +} + + +FBSession* FBSession::sessionForApplication ( const QString& aAppKey, const QString& aAppSecret, const QString& aSessionProxy) +{ + FBSession* session = new FBSession ( aAppKey, aAppSecret, aSessionProxy ); + return session; +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// instance public functions +FBSession::FBSession( const QString& aAppKey, const QString& aAppSecret, const QString& aGetSessionProxy ) : + iApiKey (aAppKey), + iApiSecret ( aAppSecret ), + m_Client(new SmfCredMgrClient(this)) +{ + if (!sharedSession) + { + sharedSession = this; + } +} + +FBSession::~FBSession() +{ + if(m_Client){ + delete m_Client; + m_Client = NULL; + } +} + +const QString& FBSession::apiURL() const +{ + return kAPIRestURL; +} +void FBSession::SaveFrobKey (const QString& frob ) +{ + iFrobKey = frob; + //save(); +} +void FBSession::Savetoken (const QString& token ) +{ + qDebug()<<"Inside FBSession::Savetoken"; + qDebug()<<"token argument = "<AuthDataSet(CMRegToken,ExpiryTime,Params)) + { + QByteArray accessToken = Params.value("finalToken"); + emit sessionDidLogin( accessToken ); + return true; + } + return false; +} +void FBSession::logout() { + + iToken.clear(); + iFrobKey.clear(); + + unsave(); + + emit sessionDidLogout(); +} + +void FBSession::send (FBRequest* aRequest) { + qDebug()<<"Inside FBSession::send"; + performRequest (aRequest, true); +} + + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// instance private functions +void FBSession::save() +{ + qDebug()<<"Inside FBSession::save()"; + qDebug()<<"Auth token = "< UrlList; + UrlList.append(QUrl("http://api.flickr.com")); + + QStringList PluginList; + PluginList.append(QString("flickrcontactfetcherplugin.qtplugin")); + PluginList.append(QString("flickrgalleryplugin.qtplugin")); + + QString UID("0xE1D8C7D7"); + + //Currently Hardcoded with current time bcoz CM is not handling expiry time as '0' value + QDateTime ExpirationDate = QDateTime::currentDateTime(); + ExpirationDate.addYears(1); + + QString CMRegToken = m_Client->StoreAuthData(Params,ExpirationDate,UrlList,PluginList,UID,true); + + qDebug()<<"Reg token from CSM = "<connect(); + return true; +} diff -r b78fa4cdbf2b -r 106a4bfcb866 example/FlickrAuthApp/src/xmlParser.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/FlickrAuthApp/src/xmlParser.cpp Thu Aug 05 16:46:37 2010 +0530 @@ -0,0 +1,208 @@ +/** +* Copyright (c) 2010 Sasken Communication Technologies Ltd. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the "{License}" +* which accompanies this distribution, and is available +* at the URL "{LicenseUrl}". +* +* Initial Contributors: +* Narasimhulu Kavadapu, Sasken Communication Technologies Ltd - Initial contribution +* +* Contributors: +* +* Description: +* XML Parser class +*/ +#include "xmlParser.h" + +#include +/////////////////////////////////////////////////////////////////////////////////////////////////// +// instance public functions + +FBXMLHandler::FBXMLHandler() : iError(false) +{ + initWhiteSpaceHash(); +} + +FBXMLHandler::~FBXMLHandler() +{ + iWhiteSpaceAndNewLineCharSet.clear(); +} + +/////////////////////////////////////////////////////////////////////////////////////////////////// +// instance private functions + +void FBXMLHandler::initWhiteSpaceHash() +{ + iWhiteSpaceAndNewLineCharSet.insert(QChar(0x20), true); + iWhiteSpaceAndNewLineCharSet.insert(QChar(0x9), true); + iWhiteSpaceAndNewLineCharSet.insert(QChar(0xA), true); + iWhiteSpaceAndNewLineCharSet.insert(QChar(0xB), true); + iWhiteSpaceAndNewLineCharSet.insert(QChar(0xC), true); + iWhiteSpaceAndNewLineCharSet.insert(QChar(0xD), true); + iWhiteSpaceAndNewLineCharSet.insert(QChar(0x85), true); +} + +/* methods from QXmlErrorHandler */ +bool FBXMLHandler::error(const QXmlParseException& exception) +{ + iParseErrorMessage = exception.message(); + iError = true; + return false; +} + +bool FBXMLHandler::fatalError(const QXmlParseException& exception) +{ + iParseErrorMessage = exception.message(); + iError = true; + return false; +} + +/* methods from QXmlDefaultHandler */ +bool FBXMLHandler::startElement( const QString & /*namespaceURI*/, + const QString & localName, + const QString & /*qName*/, + const QXmlAttributes & atts) +{ + flushCharacters(); + + QVariant item ; + + if (atts.value("list").compare("true")==0) + { + item = QVariantList(); + } + + iStack.append(item); + iNameStack.append(localName); + + return true; +} + +bool FBXMLHandler::characters(const QString& aText) +{ + iChars.append(aText); + return true; +} + +bool FBXMLHandler::endElement( const QString & /*namespaceURI*/, + const QString & /*localName*/, + const QString & /*qName*/ ) +{ + flushCharacters(); + + QVariant c = iStack [iStack.count() - 1] ; + QString name = topName(); + + iStack.removeLast(); + iNameStack.removeLast(); + + if (!iStack.count()) + { + iRootObject = c; + iRootName = name; + } + else + { + QVariant tC = iStack[iStack.count() - 1] ; + if (tC.isNull()) + { + tC = QVariantHash(); + iStack.replace(iStack.count() - 1, tC); + } + + if (tC.type() == QVariant::List) + { + QVariantList list = tC.toList(); + list.append( c.toHash() ); + + iStack.replace( iStack.count() - 1 , list); + + } + else if (tC.type() == QVariant::Hash) + { + QVariantHash hash = tC.toHash(); + if (c.isNull()) + { + c = QString(""); + } + hash.insert( name, c ); + + iStack.replace( iStack.count() - 1 , hash); + } + } + + return true; +} + + +/* */ +const QString& FBXMLHandler::topName() const +{ + return iNameStack.last(); +} + +QVariant FBXMLHandler::topObject(bool /*aCreate*/) +{ + QVariant item ; + { + iStack.replace(iStack.count() - 1, item); + } + return item; +} + +QVariant FBXMLHandler::topContainer() +{ + if (iStack.count() < 2) + { + return QVariant(); + } + else + { + + QVariant item = iStack[iStack.count() - 2 ]; + { + iStack.replace( iStack.count() - 2 , item); + } + + return item; + } +} + +void FBXMLHandler::flushCharacters() +{ + for ( int i = 0; i < iChars.length(); i ++) + { + QChar uniChar = iChars.at(i); + + if (!iWhiteSpaceAndNewLineCharSet.contains(uniChar)) + { + + QVariant container; + if (iStack.count() >= 2) + { + container = iStack[iStack.count() - 2]; + if (container.isNull()) + { + container = QVariantHash(); + iStack.replace( iStack.count() - 2 , container); + } + } + + if (container.type() == QVariant::List) + { + QVariantHash object; + object.insert( topName(), iChars ); + iStack.replace (iStack.count() - 1, object); + } else { + QVariant object(iChars); + iStack.replace (iStack.count() - 1, object); + } + break; + } + + } + + iChars.clear(); +} diff -r b78fa4cdbf2b -r 106a4bfcb866 example/FlickrAuthApp/ui_AuthApp.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/FlickrAuthApp/ui_AuthApp.h Thu Aug 05 16:46:37 2010 +0530 @@ -0,0 +1,82 @@ +/******************************************************************************** +** Form generated from reading UI file 'AuthApp.ui' +** +** Created: Fri Jul 30 14:06:39 2010 +** by: Qt User Interface Compiler version 4.6.2 +** +** WARNING! All changes made in this file will be lost when recompiling UI file! +********************************************************************************/ + +#ifndef UI_AUTHAPP_H +#define UI_AUTHAPP_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Ui_AuthAppClass +{ +public: + QWidget *centralWidget; + QVBoxLayout *verticalLayout; + QPushButton *buttonForget; + QPushButton *pushButton; + QSpacerItem *verticalSpacer; + + void setupUi(QMainWindow *AuthAppClass) + { + if (AuthAppClass->objectName().isEmpty()) + AuthAppClass->setObjectName(QString::fromUtf8("AuthAppClass")); + AuthAppClass->resize(275, 310); + centralWidget = new QWidget(AuthAppClass); + centralWidget->setObjectName(QString::fromUtf8("centralWidget")); + verticalLayout = new QVBoxLayout(centralWidget); + verticalLayout->setSpacing(6); + verticalLayout->setContentsMargins(11, 11, 11, 11); + verticalLayout->setObjectName(QString::fromUtf8("verticalLayout")); + buttonForget = new QPushButton(centralWidget); + buttonForget->setObjectName(QString::fromUtf8("buttonForget")); + + verticalLayout->addWidget(buttonForget); + + pushButton = new QPushButton(centralWidget); + pushButton->setObjectName(QString::fromUtf8("pushButton")); + + verticalLayout->addWidget(pushButton); + + verticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding); + + verticalLayout->addItem(verticalSpacer); + + AuthAppClass->setCentralWidget(centralWidget); + + retranslateUi(AuthAppClass); + + QMetaObject::connectSlotsByName(AuthAppClass); + } // setupUi + + void retranslateUi(QMainWindow *AuthAppClass) + { + AuthAppClass->setWindowTitle(QApplication::translate("AuthAppClass", "MainWindow", 0, QApplication::UnicodeUTF8)); + buttonForget->setText(QApplication::translate("AuthAppClass", "Logout", 0, QApplication::UnicodeUTF8)); + pushButton->setText(QApplication::translate("AuthAppClass", "Login to Flickr", 0, QApplication::UnicodeUTF8)); + } // retranslateUi + +}; + +namespace Ui { + class AuthAppClass: public Ui_AuthAppClass {}; +} // namespace Ui + +QT_END_NAMESPACE + +#endif // UI_AUTHAPP_H diff -r b78fa4cdbf2b -r 106a4bfcb866 example/FlickrAuthApp/ui_progressbar.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/FlickrAuthApp/ui_progressbar.h Thu Aug 05 16:46:37 2010 +0530 @@ -0,0 +1,75 @@ +/******************************************************************************** +** Form generated from reading UI file 'progressbar.ui' +** +** Created: Fri Jul 30 14:06:35 2010 +** by: Qt User Interface Compiler version 4.6.2 +** +** WARNING! All changes made in this file will be lost when recompiling UI file! +********************************************************************************/ + +#ifndef UI_PROGRESSBAR_H +#define UI_PROGRESSBAR_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +QT_BEGIN_NAMESPACE + +class Ui_progressbarClass +{ +public: + QVBoxLayout *verticalLayout; + QLabel *label; + QProgressBar *progressBar; + + void setupUi(QWidget *progressbarClass) + { + if (progressbarClass->objectName().isEmpty()) + progressbarClass->setObjectName(QString::fromUtf8("progressbarClass")); + verticalLayout = new QVBoxLayout(progressbarClass); + verticalLayout->setSpacing(6); + verticalLayout->setContentsMargins(11, 11, 11, 11); + verticalLayout->setObjectName(QString::fromUtf8("verticalLayout")); + label = new QLabel(progressbarClass); + label->setObjectName(QString::fromUtf8("label")); + + verticalLayout->addWidget(label); + + progressBar = new QProgressBar(progressbarClass); + progressBar->setObjectName(QString::fromUtf8("progressBar")); + progressBar->setValue(24); + + verticalLayout->addWidget(progressBar); + + + retranslateUi(progressbarClass); + + QMetaObject::connectSlotsByName(progressbarClass); + } // setupUi + + void retranslateUi(QWidget *progressbarClass) + { + progressbarClass->setWindowTitle(QApplication::translate("progressbarClass", "progressbar", 0, QApplication::UnicodeUTF8)); + label->setText(QApplication::translate("progressbarClass", "\n" +"\n" +"

Loading,Please wait.....

", 0, QApplication::UnicodeUTF8)); + } // retranslateUi + +}; + +namespace Ui { + class progressbarClass: public Ui_progressbarClass {}; +} // namespace Ui + +QT_END_NAMESPACE + +#endif // UI_PROGRESSBAR_H diff -r b78fa4cdbf2b -r 106a4bfcb866 example/example.pro --- a/example/example.pro Thu Aug 05 16:35:33 2010 +0530 +++ b/example/example.pro Thu Aug 05 16:46:37 2010 +0530 @@ -1,7 +1,11 @@ TEMPLATE = subdirs - SUBDIRS = AuthApp \ + FlickrAuthApp \ + fbactivityfetcherplugin \ fbcontactfetcherplugin \ fbpostproviderplugin \ flickrcontactfetcherplugin \ - smfclientapp + flickrgalleryplugin \ + smfclientapp \ + DemoGUI +CONFIG += ordered \ No newline at end of file diff -r b78fa4cdbf2b -r 106a4bfcb866 example/fbactivityfetcherplugin/fbactivityfetcherplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/fbactivityfetcherplugin/fbactivityfetcherplugin.cpp Thu Aug 05 16:46:37 2010 +0530 @@ -0,0 +1,1002 @@ +/** + * Copyright (c) 2010 Sasken Communication Technologies Ltd. + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of the "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html" + * + * Initial Contributors: + * Chandradeep Gandhi, Sasken Communication Technologies Ltd - Initial contribution + * + * Contributors: + * Nalina Hariharan + * + * Description: + * The Plugin that fetches activities from the logged in user's facebook account + * + */ + +// Include files +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "fbactivityfetcherplugin.h" + +// Global and static global variables +static int chance = 0; +QString currentUserId; +SmfActivityEntry myEntry; +SmfContact currentAuthor; +QList currentObjectList; +SmfActivityObject currentObject; +bool forEntryXmlTag; +bool forActivityObjectXmlTag; + +/** + * Destructor + */ +FBActivityFetcherPlugin::~FBActivityFetcherPlugin( ) + { + if(m_provider) + delete m_provider; + } + + +/** + * Method called by plugins to generate a signature string from a base string + * @param aBaseString The base string + * @return The md5 hash of the base string + */ +QString FBActivityFetcherPlugin::generateSignature(const QString aBaseString) + { + qDebug()<<"Inside FBActivityFetcherPlugin::generateSignature()"; + + // Create md5 hash of the signature string + QByteArray byteArray; + byteArray.insert(0, aBaseString.toAscii()); + + QByteArray md5Hash = QCryptographicHash::hash(byteArray,QCryptographicHash::Md5 ).toHex(); + QString returnString (md5Hash); + return returnString; + } + + +/** + * Method to interpret the key sets obtained from credential manager + * @param aApiKey [out] The api key + * @param aApiSecret [out] The api secret + * @param aSessionKey [out] The session key + * @param aSessionSecret [out] The session secret + * @param aAppId [out] The application ID + */ +void FBActivityFetcherPlugin::fetchKeys( QString &aApiKey, + QString &aApiSecret, + QString &aSessionKey, + QString &aSessionSecret, + QString &aAppId) + { + qDebug()<<"Inside FBActivityFetcherPlugin::fetchKeys()"; + + qDebug()<<"Reg Token = "<m_smfRegToken; + qDebug()<<"Expiry Date as int = "<m_validity.toTime_t(); + + SmfAuthParams keys; + SmfPluginUtil util; + util.getAuthKeys(keys, m_provider->m_smfRegToken, + m_provider->m_validity, m_provider->m_pluginId); + + qDebug()<<"Number of key-value pairs = "<().guid(); + qDebug()<<"Friends facebook ID = "< &aFilters, + const int aPageNum, + const int aItemsPerPage ) + { + qDebug()<<"Inside FBActivityFetcherPlugin::filtered()"; + + Q_UNUSED(aRequest) + Q_UNUSED(aFilters) + Q_UNUSED(aPageNum) + Q_UNUSED(aItemsPerPage) + return SmfPluginErrServiceNotSupported; + } + +/** + * Customised method for SmfActivityFetcherPlugin interface + * @param aRequest [out] The request data to be sent to network + * @param aOperation The operation type (should be known between + * the client interface and the plugin) + * @param aData The data required to form the request (The type + * of data should be known between client and the plugin) + * @return SmfPluginError Plugin error if any, else SmfPluginErrNone + */ +SmfPluginError FBActivityFetcherPlugin::customRequest( SmfPluginRequestData &aRequest, + const int &aOperation, QByteArray *aData ) + { + Q_UNUSED(aRequest) + Q_UNUSED(aOperation) + Q_UNUSED(aData) + qDebug()<<"Inside FBActivityFetcherPlugin::customRequest()"; + return SmfPluginErrServiceNotSupported; + } + + +/** + * The first method to be called in the plugin that implements this interface. + * If this method is not called, plugin may not behave as expected. + */ +void FBActivityFetcherPlugin::initialize( ) + { + // Set the global value + forActivityObjectXmlTag = false; + forEntryXmlTag = false; + + // Create an instance of FBActivityProviderBase + m_provider = new FBActivityProviderBase; + m_provider->initialize(); + } + + +/** + * Method to get the provider information + * @return Instance of SmfProviderBase + */ +SmfProviderBase* FBActivityFetcherPlugin::getProviderInfo( ) + { + return m_provider; + } + + +/** + * Method to get the result for a network request. + * @param aOperation The type of operation to be requested + * @param aTransportResult The result of transport operation + * @param aResponse The QByteArray instance containing the network response. + * The plugins should delete this instance once they have read the + * data from it. + * @param aResult [out] An output parameter to the plugin manager.If the + * return value is SmfSendRequestAgain, QVariant will be of type + * SmfPluginRequestData. + * For SmfActivityFetcherPlugin: If last operation was selfActivities() or + * friendsActivities() or filtered(), aResult will be of type + * QList. + * @param aRetType [out] SmfPluginRetType + * @param aPageResult [out] The SmfResultPage structure variable + */ +SmfPluginError FBActivityFetcherPlugin::responseAvailable( + const SmfRequestTypeID aOperation, + const SmfTransportResult &aTransportResult, + QByteArray *aResponse, + QVariant* aResult, + SmfPluginRetType &aRetType, + SmfResultPage &aPageResult ) + { + Q_UNUSED(aPageResult) + qDebug()<<"Inside FBActivityFetcherPlugin::responseAvailable()"; + + SmfPluginError error = SmfPluginErrNetworkError; + + if( !aResponse || (0 == aResponse->size()) ) + { + qDebug()<<"Response is NULL or empty"; + aRetType = SmfRequestError; + return error; + } + + QByteArray response(*aResponse); + delete aResponse; + + QFile respFile("c://data//SmfPluginActivityResponse.txt"); + if(!respFile.open(QIODevice::WriteOnly)) + qDebug()<<"File to write the response could not be opened"; + else + { + respFile.write(response); + respFile.close(); + qDebug()<<"Writing FB response to a file named 'SmfPluginActivityResponse.txt'"; + } + qDebug()<<"FB response size = "< list; + QString errStr; + errStr.clear(); + + qDebug()<<"Xml parsing"; + + // For getting contacts from xml response + QXmlStreamReader xml(response); + while (!xml.atEnd()) + { + xml.readNext(); + + if (xml.tokenType() == QXmlStreamReader::StartElement) + { + if (xml.qualifiedName().toString() == "entry") + { + currentObjectList.clear(); + forEntryXmlTag = true; + } + else if (xml.qualifiedName().toString() == "title") + { + if(forEntryXmlTag) + { + SmfPost post; + post.setTitle(xml.readElementText()); + myEntry.setTitle(post); + qDebug()<<"entry title = "<(name); + currentAuthor.setValue("Name", var); + } + } + else if(xml.qualifiedName().toString() == "uri") + { + if(forEntryXmlTag) + { + QContactUrl url; + url.setUrl(xml.readElementText()); + QVariant var = QVariant::fromValue(url); + currentAuthor.setValue("Url", var); + myEntry.setAuthor(currentAuthor); + qDebug()<<"entry author name = "<().firstName(); + //qDebug()<<"entry author uri = "<().url(); + } + } + else if(xml.qualifiedName().toString() == "activity:verb") + { + if(forEntryXmlTag) + { + QString str(xml.readElementText()); + str.remove(' '); + str.remove('\n'); + SmfActivityVerb verb = convertActivityverb(str); + myEntry.setActionName(verb); + //qDebug()<<"entry actionname = "< +#include + +// Forward declarations +class FBActivityProviderBase; +class QVariant; + +/** + * The Plugin class that fetches activities from the logged in user's + * facebook account + */ +class FBActivityFetcherPlugin : public QObject, public SmfActivityFetcherPlugin + { + Q_OBJECT + Q_INTERFACES( SmfActivityFetcherPlugin SmfPluginBase ) + +public: + /** + * Destructor + */ + virtual ~FBActivityFetcherPlugin( ); + +public: // From SmfActivityFetcherPlugin interface + + /** + * Method to get the list of self activities, e.g. shown in own wall + * @param aRequest [out] The request data that plugin generates (to be sent to network) + * @param aPageNum[in] The page to be extracted + * @param aItemsPerPage[in] Number of items per page + * @return SmfPluginError Plugin error if any, else SmfPluginErrNone + */ + SmfPluginError selfActivities( SmfPluginRequestData &aRequest, + const int aPageNum = SMF_FIRST_PAGE, + const int aItemsPerPage = SMF_ITEMS_PER_PAGE ); + + /** + * Method to get the list of activities for other, e.g. shown in a friends wall + * @param aRequest [out] The request data plugin generated (to be sent to network) + * @param aContact [in] The contact containing the URI, name or id of the user + * @param aPageNum[in] The page to be extracted + * @param aItemsPerPage[in] Number of items per page + * @return SmfPluginError Plugin error if any, else SmfPluginErrNone + */ + SmfPluginError friendsActivities( SmfPluginRequestData &aRequest, + const SmfContact &aContact, + const int aPageNum = SMF_FIRST_PAGE, + const int aItemsPerPage = SMF_ITEMS_PER_PAGE ); + + /** + * Method to get list of self activities filtered by activity type, e.g. only photo updates in own wall + * @param aRequest [out] The request data plugin generated (to be sent to network) + * @param aFilters [in] The list of activity types to be included in result + * @param aPageNum[in] The page to be extracted + * @param aItemsPerPage[in] Number of items per page + * @return SmfPluginError Plugin error if any, else SmfPluginErrNone + */ + SmfPluginError filtered( SmfPluginRequestData &aRequest, + QList &aFilters, + const int aPageNum = SMF_FIRST_PAGE, + const int aItemsPerPage = SMF_ITEMS_PER_PAGE ); + + /** + * Customised method for SmfActivityFetcherPlugin interface + * @param aRequest [out] The request data to be sent to network + * @param aOperation The operation type (should be known between + * the client interface and the plugin) + * @param aData The data required to form the request (The type + * of data should be known between client and the plugin) + * @return SmfPluginError Plugin error if any, else SmfPluginErrNone + */ + SmfPluginError customRequest( SmfPluginRequestData &aRequest, + const int &aOperation, QByteArray *aData ); + +public: // From SmfPluginBase interface + /** + * The first method to be called in the plugin that implements this interface. + * If this method is not called, plugin may not behave as expected. + */ + void initialize( ); + + /** + * Method to get the provider information + * @return Instance of SmfProviderBase + */ + SmfProviderBase* getProviderInfo( ); + + /** + * Method to get the result for a network request. + * @param aOperation The type of operation to be requested + * @param aTransportResult The result of transport operation + * @param aResponse The QByteArray instance containing the network response. + * The plugins should delete this instance once they have read the + * data from it. + * @param aResult [out] An output parameter to the plugin manager.If the + * return value is SmfSendRequestAgain, QVariant will be of type + * SmfPluginRequestData. + * For SmfActivityFetcherPlugin: If last operation was selfActivities() or + * friendsActivities() or filtered(), aResult will be of type + * QList. + * @param aRetType [out] SmfPluginRetType + * @param aPageResult [out] The SmfResultPage structure variable + */ + SmfPluginError responseAvailable( + const SmfRequestTypeID aOperation, + const SmfTransportResult &aTransportResult, + QByteArray *aResponse, + QVariant* aResult, + SmfPluginRetType &aRetType, + SmfResultPage &aPageResult ); + +private: + /** + * Method called by plugins to generate a signature string from a base string + * @param aBaseString The base string + * @return The md5 hash of the base string + */ + QString generateSignature(const QString aBaseString); + + /** + * Method to get the user's facebook ID + * @param aRequest [out] The request data to be sent to network + * @return SmfPluginError Plugin error if any, else SmfPluginErrNone + */ + SmfPluginError getFacebookUserId( SmfPluginRequestData &aRequest ); + + /** + * Method to get the list of self activities, e.g. shown in own wall + * @param aRequest [out] The request data that plugin generates (to be sent to network) + * @param aPageNum[in] The page to be extracted + * @param aItemsPerPage[in] Number of items per page + * @return SmfPluginError Plugin error if any, else SmfPluginErrNone + */ + SmfPluginError getSelfActivities( SmfPluginRequestData &aRequest, + const int aPageNum = SMF_FIRST_PAGE, + const int aItemsPerPage = SMF_ITEMS_PER_PAGE ); + + /** + * Method to convert the Activity verb string obtained from facebook to the + * enum SmfActivityVerb + * @param verbStr The activity verb as a string + * @return The corresponding enum SmfActivityVerb + */ + SmfActivityVerb convertActivityverb( const QString& verbStr ); + + /** + * Method to convert the Activity object type string obtained from + * facebook to the enum SmfActivityObjectType + * @param objType The activity object type as a string + * @return The corresponding enum SmfActivityObjectType + */ + SmfActivityObjectType convertActivityObjectType( const QString& verbStr ); + + /** + * Method to interpret the key sets obtained from credential manager + * @param aApiKey [out] The api key + * @param aApiSecret [out] The api secret + * @param aSessionKey [out] The session key + * @param aSessionSecret [out] The session secret + * @param aAppId [out] The application ID + */ + void fetchKeys( QString &aApiKey, + QString &aApiSecret, + QString &aSessionKey, + QString &aSessionSecret, + QString &aAppId); + +private: + FBActivityProviderBase *m_provider; + }; + + + +/** + * The Plugin class that implements SmfProviderBase for this facebook plugin + */ +class FBActivityProviderBase : public QObject, public SmfProviderBase + { + Q_OBJECT + Q_INTERFACES( SmfProviderBase ) + +public: + /** + * Destructor + */ + virtual ~FBActivityProviderBase( ); + + /** + * Method to get the Localisable name of the service. + * @return The Localisable name of the service. + */ + QString serviceName( ) const; + + /** + * Method to get the Logo of the service + * @return The Logo of the service + */ + QImage serviceIcon( ) const; + + /** + * Method to get the Readable service description + * @return The Readable service description + */ + QString description( ) const; + + /** + * Method to get the Website of the service + * @return The Website of the service + */ + QUrl serviceUrl( ) const; + + /** + * Method to get the URL of the Application providing this service + * @return The URL of the Application providing this service + */ + QUrl applicationUrl( ) const; + + /** + * Method to get the Icon of the application + * @return The Icon of the application + */ + QImage applicationIcon( ) const; + + /** + * Method to get the list of interfaces that this provider support + * @return List of supported Interafces + */ + QList supportedInterfaces( ) const; + + /** + * Method to get the list of languages supported by this service provider + * @return a QStringList of languages supported by this service + * provider in 2 letter ISO 639-1 format. + */ + QStringList supportedLanguages( ) const; + + /** + * Method to get the Plugin specific ID + * @return The Plugin specific ID + */ + QString pluginId( ) const; + + /** + * Method to get the ID of the authentication application + * for this service + * @param aProgram The authentication application name + * @param aArguments List of arguments required for authentication app + * @param aMode Strting mode for authentication application + * @return The ID of the authentication application + */ + QString authenticationApp( QString &aProgram, QStringList & aArguments, + QIODevice::OpenModeFlag aMode = QIODevice::ReadWrite ) const; + + /** + * Method to get the unique registration ID provided by the + * Smf for authorised plugins + * @return The unique registration ID/token provided by the Smf for + * authorised plugins + */ + QString smfRegistrationId( ) const; + +private: + /** + * Method that initializes this class. This method should be called + * from the initialize() method of the FBActivityFetcherPlugin class + */ + void initialize(); + +private: + friend class FBActivityFetcherPlugin; + QString m_serviceName; + QImage m_serviceIcon; + QString m_description; + QUrl m_serviceUrl; + QUrl m_applicationUrl; + QImage m_applicationIcon; + QString m_pluginId; + QString m_authAppId; + QString m_smfRegToken; + QList m_supportedInterfaces; + QStringList m_supportedLangs; + QDateTime m_validity; + }; + +#endif /*_FBACTIVITYFETCHERPLUGIN_H*/ diff -r b78fa4cdbf2b -r 106a4bfcb866 example/fbactivityfetcherplugin/fbactivityfetcherplugin.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/fbactivityfetcherplugin/fbactivityfetcherplugin.pro Thu Aug 05 16:46:37 2010 +0530 @@ -0,0 +1,43 @@ +TEMPLATE = lib + +CONFIG += plugin \ + mobility + +MOBILITY += contacts + +QT += core \ + xml \ + network + +HEADERS = fbactivityfetcherplugin.h + +SOURCES = fbactivityfetcherplugin.cpp + +TARGET = $$qtLibraryTarget(fbactivityfetcherplugin) + +symbian: { + # Load predefined include paths (e.g. QT_PLUGINS_BASE_DIR) to be used in the pro-files + load(data_caging_paths) + + # EPOCALLOWDLLDATA have to set true because Qt macros has initialised global data + TARGET.EPOCALLOWDLLDATA = 1 + + # Defines plugin files into Symbian .pkg package + pluginDep.sources = fbactivityfetcherplugin.dll + pluginDep.path = $$QT_PLUGINS_BASE_DIR/smf/plugin/activity.fetcher + DEPLOYMENT += pluginDep + + TARGET.CAPABILITY = NetworkServices \ + ReadUserData \ + WriteUserData \ + LocalServices \ + UserEnvironment \ + ReadDeviceData \ + WriteDeviceData + + LIBS += -lsmfcommon +} + +target.path += $$[QT_INSTALL_PLUGINS]/smf/plugin/activity.fetcher + +INSTALLS += target \ No newline at end of file diff -r b78fa4cdbf2b -r 106a4bfcb866 example/fbactivityfetcherplugin/fbactivityfetcherplugin_installer.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/fbactivityfetcherplugin/fbactivityfetcherplugin_installer.pkg Thu Aug 05 16:46:37 2010 +0530 @@ -0,0 +1,30 @@ +; fbactivityfetcherplugin_installer.pkg generated by qmake at 2010-07-30T14:11:44 +; This file is generated by qmake and should not be modified by the user +; + +; Language +&EN + +; SIS header: name, uid, version +#{"fbactivityfetcherplugin installer"},(0xA000D7CE),1,0,0 + +; Localised Vendor name +%{"Vendor"} + +; Unique Vendor name +:"Vendor" + + +; Manual PKG pre-rules from PRO files +; Default HW/platform dependencies +[0x101F7961],0,0,0,{"S60ProductID"} +[0x102032BE],0,0,0,{"S60ProductID"} +[0x102752AE],0,0,0,{"S60ProductID"} +[0x1028315F],0,0,0,{"S60ProductID"} + +; Default dependency to Qt libraries +; Default dependency to QtMobility libraries + + +"D:/smf/MissingCode/smfrepo/example/fbactivityfetcherplugin/fbactivityfetcherplugin.sis" - "c:\adm\fbactivityfetcherplugin.sis" +@"D:/Qt/4.6.2/smartinstaller.sis",(0x2002CCCD) diff -r b78fa4cdbf2b -r 106a4bfcb866 example/fbactivityfetcherplugin/fbactivityfetcherplugin_template.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/fbactivityfetcherplugin/fbactivityfetcherplugin_template.pkg Thu Aug 05 16:46:37 2010 +0530 @@ -0,0 +1,34 @@ +; fbactivityfetcherplugin_template.pkg generated by qmake at 2010-07-30T14:11:44 +; This file is generated by qmake and should not be modified by the user +; + +; Language +&EN + +; SIS header: name, uid, version +#{"fbactivityfetcherplugin"},(0xEbecd096),1,0,0 + +; Localised Vendor name +%{"Vendor"} + +; Unique Vendor name +:"Vendor" + + +; Manual PKG pre-rules from PRO files +; Default HW/platform dependencies +[0x101F7961],0,0,0,{"S60ProductID"} +[0x102032BE],0,0,0,{"S60ProductID"} +[0x102752AE],0,0,0,{"S60ProductID"} +[0x1028315F],0,0,0,{"S60ProductID"} + +; Default dependency to Qt libraries +(0x2001E61C), 4, 6, 2, {"Qt"} +; Default dependency to QtMobility libraries +(0x2002AC89), 1, 0, 0, {"QtMobility"} + +; DEPLOYMENT +"d:/S60/devices/Nokia_Symbian3_SDK_v0.8/epoc32/release/$(PLATFORM)/$(TARGET)/fbactivityfetcherplugin.dll" - "!:\sys\bin\fbactivityfetcherplugin.dll" +"d:/smf/MissingCode/smfrepo/example/fbactivityfetcherplugin/qmakepluginstubs/fbactivityfetcherplugin.qtplugin" - "!:\resource\qt\plugins\smf\plugin\activity.fetcher\fbactivityfetcherplugin.qtplugin" + +; Manual PKG post-rules from PRO files diff -r b78fa4cdbf2b -r 106a4bfcb866 example/fbactivityfetcherplugin/plugin_commonU.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/fbactivityfetcherplugin/plugin_commonU.def Thu Aug 05 16:46:37 2010 +0530 @@ -0,0 +1,16 @@ +; ============================================================================== +; Generated by qmake (2.01a) (Qt 4.6.2) on: 2010-07-30T14:11:44 +; This file is generated by qmake and should not be modified by the +; user. +; Name : plugin_commonU.def +; Part of : fbactivityfetcherplugin +; Description : Fixes common plugin symbols to known ordinals +; Version : +; +; ============================================================================== + + +EXPORTS + qt_plugin_query_verification_data @ 1 NONAME + qt_plugin_instance @ 2 NONAME + diff -r b78fa4cdbf2b -r 106a4bfcb866 example/fbactivityfetcherplugin/qmakepluginstubs/fbactivityfetcherplugin.qtplugin --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/fbactivityfetcherplugin/qmakepluginstubs/fbactivityfetcherplugin.qtplugin Thu Aug 05 16:46:37 2010 +0530 @@ -0,0 +1,1 @@ +This file is a Qt plugin stub file. The real Qt plugin is located in \sys\bin. Created:2010-07-30T14:11:44 diff -r b78fa4cdbf2b -r 106a4bfcb866 example/fbcontactfetcherplugin/fbcontactfetcherplugin.cpp --- a/example/fbcontactfetcherplugin/fbcontactfetcherplugin.cpp Thu Aug 05 16:35:33 2010 +0530 +++ b/example/fbcontactfetcherplugin/fbcontactfetcherplugin.cpp Thu Aug 05 16:46:37 2010 +0530 @@ -25,6 +25,8 @@ #include #include #include +#include +#include #ifdef SMF_XMLPARSING #include #endif @@ -39,6 +41,9 @@ SmfContact contact; #endif +// Todo:- Macro added for limiting items fetched to recent 5 +// Remove after demo +#define SETLIMITOFFIVEFORSMFDEMO 1 /** * Destructor @@ -50,6 +55,54 @@ } /** + * Method to interpret the key sets obtained from credential manager + * @param aApiKey [out] The api key + * @param aApiSecret [out] The api secret + * @param aSessionKey [out] The session key + * @param aSessionSecret [out] The session secret + * @param aAppId [out] The application ID + */ +void FBContactFetcherPlugin::fetchKeys( QString &aApiKey, + QString &aApiSecret, + QString &aSessionKey, + QString &aSessionSecret ) + { + qDebug()<<"Inside FBContactFetcherPlugin::fetchKeys()"; + + qDebug()<<"Reg Token = "<m_smfRegToken; + qDebug()<<"Expiry Date as int = "<m_validity.toTime_t(); + + SmfAuthParams keys; + SmfPluginUtil util; + util.getAuthKeys(keys, m_provider->m_smfRegToken, + m_provider->m_validity, m_provider->m_pluginId); + + qDebug()<<"Number of key-value pairs = "< list = arr.split('\n'); - file.close(); - - QString apiKey(list[0]); - QString apiSecret(list[1]); - QString sessionKey(list[2]); - QString sessionSecret(list[3]); - - qDebug()<<"Api Key = "< list = arr.split('\n'); - file.close(); - - QString apiKey(list[0]); - QString apiSecret(list[1]); - QString sessionKey(list[2]); - QString sessionSecret(list[3]); - - qDebug()<<"Api Key = "<5) + uids.chop(1); + qDebug()<<"Limited to 5 uid string = "<initialize(); @@ -480,8 +504,21 @@ QByteArray response(*aResponse); delete aResponse; - qDebug()<<"FB response = "<parse(response, &ok); + SmfPluginUtil util; + QVariant result = util.parse(response, &ok); if (!ok) { - qDebug()<<"An error occurred during json parsing, error = "<errorString(); + qDebug()<<"An error occurred during json parsing, error = "<parse(response, &ok); + SmfPluginUtil util; + QVariant result = util.parse(response, &ok); if (!ok) { qDebug()<<"An error occurred during json parsing"; @@ -679,7 +720,11 @@ contact.setValue("Name",nameVar); QContactAvatar avatar; - QUrl url(map2["pic_square"].toString()); + QUrl url; + if(0 != map2["pic_square"].toString().size()) + url = map2["pic_square"].toString(); + else + url = QString("http://static.ak.fbcdn.net/rsrc.php/z5HB7/hash/ecyu2wwn.gif"); avatar.setImageUrl(url); QVariant avatarVar = QVariant::fromValue(avatar); contact.setValue("Avatar", avatarVar); @@ -689,6 +734,11 @@ QVariant guidVar = QVariant::fromValue(guid); contact.setValue("Guid", guidVar); + QContactPresence presence; + presence.setCustomMessage(map2["status"].toString()); + QVariant presVar = QVariant::fromValue(presence); + contact.setValue("Presence", presVar); + #if 0 // tesing SmfContact serialization QContactAddress address; @@ -1031,9 +1081,11 @@ m_description = "Facebook contact fetcher plugin description"; m_serviceUrl = QUrl(QString("http://api.facebook.com")); m_pluginId = "fbcontactfetcherplugin.qtplugin"; - m_authAppId = "Facebook AuthAppId"; - m_smfRegToken = "Facebook RegToken"; + m_authAppId = "0xEFE2FD23"; m_supportedInterfaces.append("org.symbian.smf.plugin.contact.fetcher/v0.2"); + QSettings iSettings; + m_smfRegToken = iSettings.value("FBCMRegToken").toString(); + m_validity = iSettings.value("FBExpiryTime").toDateTime(); } diff -r b78fa4cdbf2b -r 106a4bfcb866 example/fbcontactfetcherplugin/fbcontactfetcherplugin.h --- a/example/fbcontactfetcherplugin/fbcontactfetcherplugin.h Thu Aug 05 16:35:33 2010 +0530 +++ b/example/fbcontactfetcherplugin/fbcontactfetcherplugin.h Thu Aug 05 16:46:37 2010 +0530 @@ -21,13 +21,13 @@ #define _FBCONTACTFETCHERPLUGIN_H // Include files +#include #include -#include // Forward declarations class FBContactProviderBase; class QVariant; -class QNetworkReply; + /** * The Plugin class that fetches contacts from the logged in user's @@ -137,10 +137,8 @@ /** * The first method to be called in the plugin that implements this interface. * If this method is not called, plugin may not behave as expected. - * Plugins are expected to save the aUtil handle and use and when required. - * @param aUtil The instance of SmfPluginUtil */ - void initialize( SmfPluginUtil *aUtil ); + void initialize( ); /** * Method to get the provider information @@ -203,9 +201,20 @@ const int aPageNum, const int aItemsPerPage ); + /** + * Method to interpret the key sets obtained from credential manager + * @param aApiKey [out] The api key + * @param aApiSecret [out] The api secret + * @param aSessionKey [out] The session key + * @param aSessionSecret [out] The session secret + */ + void fetchKeys( QString &aApiKey, + QString &aApiSecret, + QString &aSessionKey, + QString &aSessionSecret ); + private: FBContactProviderBase *m_provider; - SmfPluginUtil *m_util; }; @@ -318,6 +327,7 @@ QString m_smfRegToken; QList m_supportedInterfaces; QStringList m_supportedLangs; + QDateTime m_validity; }; #endif /*_FBCONTACTFETCHERPLUGIN_H*/ diff -r b78fa4cdbf2b -r 106a4bfcb866 example/fbcontactfetcherplugin/fbcontactfetcherplugin.pro --- a/example/fbcontactfetcherplugin/fbcontactfetcherplugin.pro Thu Aug 05 16:35:33 2010 +0530 +++ b/example/fbcontactfetcherplugin/fbcontactfetcherplugin.pro Thu Aug 05 16:46:37 2010 +0530 @@ -36,7 +36,7 @@ ReadDeviceData \ WriteDeviceData - LIBS += -lsmfclient.dll + LIBS += -lsmfcommon } target.path += $$[QT_INSTALL_PLUGINS]/smf/plugin/contact.fetcher diff -r b78fa4cdbf2b -r 106a4bfcb866 example/fbcontactfetcherplugin/fbcontactfetcherplugin_installer.pkg --- a/example/fbcontactfetcherplugin/fbcontactfetcherplugin_installer.pkg Thu Aug 05 16:35:33 2010 +0530 +++ b/example/fbcontactfetcherplugin/fbcontactfetcherplugin_installer.pkg Thu Aug 05 16:46:37 2010 +0530 @@ -1,11 +1,10 @@ -; fbcontactfetcherplugin_installer.pkg generated by qmake at 2010-06-22T14:10:41 +; fbcontactfetcherplugin_installer.pkg generated by qmake at 2010-07-30T14:11:44 ; This file is generated by qmake and should not be modified by the user ; ; Language &EN - ; SIS header: name, uid, version #{"fbcontactfetcherplugin installer"},(0xA000D7CE),1,0,0 @@ -17,15 +16,15 @@ ; Manual PKG pre-rules from PRO files -; Default dependency to Qt libraries ; Default HW/platform dependencies [0x101F7961],0,0,0,{"S60ProductID"} [0x102032BE],0,0,0,{"S60ProductID"} [0x102752AE],0,0,0,{"S60ProductID"} [0x1028315F],0,0,0,{"S60ProductID"} +; Default dependency to Qt libraries ; Default dependency to QtMobility libraries -"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/SMFCode/smf_baseline_22june_latest/example/fbcontactfetcherplugin/fbcontactfetcherplugin.sis" - "c:\adm\fbcontactfetcherplugin.sis" -@"F:/Qt/4.6.3/smartinstaller.sis",(0x2002CCCD) +"D:/smf/MissingCode/smfrepo/example/fbcontactfetcherplugin/fbcontactfetcherplugin.sis" - "c:\adm\fbcontactfetcherplugin.sis" +@"D:/Qt/4.6.2/smartinstaller.sis",(0x2002CCCD) diff -r b78fa4cdbf2b -r 106a4bfcb866 example/fbcontactfetcherplugin/fbcontactfetcherplugin_template.pkg --- a/example/fbcontactfetcherplugin/fbcontactfetcherplugin_template.pkg Thu Aug 05 16:35:33 2010 +0530 +++ b/example/fbcontactfetcherplugin/fbcontactfetcherplugin_template.pkg Thu Aug 05 16:46:37 2010 +0530 @@ -1,13 +1,12 @@ -; fbcontactfetcherplugin_template.pkg generated by qmake at 2010-06-22T14:10:41 +; fbcontactfetcherplugin_template.pkg generated by qmake at 2010-07-30T14:11:44 ; This file is generated by qmake and should not be modified by the user ; ; Language &EN - ; SIS header: name, uid, version -#{"fbcontactfetcherplugin"},(0xEc03b6cf),1,0,0 +#{"fbcontactfetcherplugin"},(0xE8630234),1,0,0 ; Localised Vendor name %{"Vendor"} @@ -17,19 +16,19 @@ ; Manual PKG pre-rules from PRO files -; Default dependency to Qt libraries -(0x2001E61C), 4, 6, 3, {"Qt"} ; Default HW/platform dependencies [0x101F7961],0,0,0,{"S60ProductID"} [0x102032BE],0,0,0,{"S60ProductID"} [0x102752AE],0,0,0,{"S60ProductID"} [0x1028315F],0,0,0,{"S60ProductID"} +; Default dependency to Qt libraries +(0x2001E61C), 4, 6, 2, {"Qt"} ; Default dependency to QtMobility libraries (0x2002AC89), 1, 0, 0, {"QtMobility"} ; DEPLOYMENT -"/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/release/$(PLATFORM)/$(TARGET)/fbcontactfetcherplugin.dll" - "!:\sys\bin\fbcontactfetcherplugin.dll" -"/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/data/z/resource/qt/plugins/smf/plugin/contact.fetcher/fbcontactfetcherplugin.qtplugin" - "!:\resource\qt\plugins\smf\plugin\contact.fetcher\fbcontactfetcherplugin.qtplugin" +"d:/S60/devices/Nokia_Symbian3_SDK_v0.8/epoc32/release/$(PLATFORM)/$(TARGET)/fbcontactfetcherplugin.dll" - "!:\sys\bin\fbcontactfetcherplugin.dll" +"d:/smf/MissingCode/smfrepo/example/fbcontactfetcherplugin/qmakepluginstubs/fbcontactfetcherplugin.qtplugin" - "!:\resource\qt\plugins\smf\plugin\contact.fetcher\fbcontactfetcherplugin.qtplugin" ; Manual PKG post-rules from PRO files diff -r b78fa4cdbf2b -r 106a4bfcb866 example/fbcontactfetcherplugin/plugin_commonU.def --- a/example/fbcontactfetcherplugin/plugin_commonU.def Thu Aug 05 16:35:33 2010 +0530 +++ b/example/fbcontactfetcherplugin/plugin_commonU.def Thu Aug 05 16:46:37 2010 +0530 @@ -1,5 +1,5 @@ ; ============================================================================== -; Generated by qmake (2.01a) (Qt 4.6.3) on: 2010-06-22T14:10:41 +; Generated by qmake (2.01a) (Qt 4.6.2) on: 2010-07-30T14:11:44 ; This file is generated by qmake and should not be modified by the ; user. ; Name : plugin_commonU.def diff -r b78fa4cdbf2b -r 106a4bfcb866 example/fbcontactfetcherplugin/qmakepluginstubs/fbcontactfetcherplugin.qtplugin --- a/example/fbcontactfetcherplugin/qmakepluginstubs/fbcontactfetcherplugin.qtplugin Thu Aug 05 16:35:33 2010 +0530 +++ b/example/fbcontactfetcherplugin/qmakepluginstubs/fbcontactfetcherplugin.qtplugin Thu Aug 05 16:46:37 2010 +0530 @@ -1,1 +1,1 @@ -This file is a Qt plugin stub file. The real Qt plugin is located in /sys/bin. Created:2010-06-22T14:10:41 +This file is a Qt plugin stub file. The real Qt plugin is located in \sys\bin. Created:2010-07-30T14:11:44 diff -r b78fa4cdbf2b -r 106a4bfcb866 example/fbpostproviderplugin/ABLD.BAT --- a/example/fbpostproviderplugin/ABLD.BAT Thu Aug 05 16:35:33 2010 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -@ECHO OFF - -REM Bldmake-generated batch file - ABLD.BAT -REM ** DO NOT EDIT ** - -perl -S ABLD.PL "\CarbideWorkspace\smfserver_cleaned\example\fbpostproviderplugin\\" %1 %2 %3 %4 %5 %6 %7 %8 %9 -if errorlevel==1 goto CheckPerl -goto End - -:CheckPerl -perl -v >NUL -if errorlevel==1 echo Is Perl, version 5.003_07 or later, installed? -goto End - -:End diff -r b78fa4cdbf2b -r 106a4bfcb866 example/fbpostproviderplugin/Makefile --- a/example/fbpostproviderplugin/Makefile Thu Aug 05 16:35:33 2010 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,239 +0,0 @@ -# ============================================================================== -# Generated by qmake (2.01a) (Qt 4.6.3) on: Tue Jun 22 14:10:41 2010 -# This file is generated by qmake and should not be modified by the -# user. -# Name : Makefile -# Description : Wrapper Makefile for calling Symbian build tools -# -# ============================================================================== - - -MAKEFILE = Makefile -QMAKE = f:\Qt\4.6.3\bin\qmake -DEL_FILE = del -DEL_DIR = rmdir -MOVE = move -CHK_DIR_EXISTS = if not exist -MKDIR = mkdir -XCOPY = xcopy /d /f /h /r /y /i -ABLD = ABLD.BAT -DEBUG_PLATFORMS = winscw gcce armv5 armv6 -RELEASE_PLATFORMS = gcce armv5 armv6 -MAKE = make - -ifeq (WINS,$(findstring WINS, $(PLATFORM))) -ZDIR=$(EPOCROOT)epoc32\release\$(PLATFORM)\$(CFG)\Z -else -ZDIR=$(EPOCROOT)epoc32\data\z -endif - -DEFINES = -DSYMBIAN -DUNICODE -DQT_KEYPAD_NAVIGATION -DQT_SOFTKEYS_ENABLED -DQT_USE_MATH_H_FLOATS -DQT_PLUGIN -DQT_XML_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -INCPATH = -I"F:/Qt/4.6.3/include/QtCore" -I"F:/Qt/4.6.3/include/QtCore/tmp" -I"F:/Qt/4.6.3/include/QtNetwork" -I"F:/Qt/4.6.3/include/QtNetwork/tmp" -I"F:/Qt/4.6.3/include/QtGui" -I"F:/Qt/4.6.3/include/QtGui/tmp" -I"F:/Qt/4.6.3/include/QtXml" -I"F:/Qt/4.6.3/include/QtXml/tmp" -I"F:/Qt/4.6.3/include" -I"F:/Qt/4.6.3/include/tmp" -I"F:/Qt/4.6.3/include/QtContacts" -I"F:/Qt/4.6.3/include/QtContacts/tmp" -I"F:/Qt/4.6.3/include/QtLocation" -I"F:/Qt/4.6.3/include/QtLocation/tmp" -I"F:/Qt/4.6.3/mkspecs/common/symbian" -I"F:/Qt/4.6.3/mkspecs/common/symbian/tmp" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/include" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/include/stdapis" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/include/stdapis/sys" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/include/mw" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/include/platform/mw" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/include/platform" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/include/app" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/include/platform/app" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/include/platform/loc" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/include/platform/mw/loc" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/include/platform/app/loc" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/include/platform/loc/sc" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/include/platform/mw/loc/sc" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/include/platform/app/loc/sc" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/include/stdapis/stlportv5" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/SMFCode/smf_baseline_22june_latest/example/fbpostproviderplugin" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/SMFCode/smf_baseline_22june_latest/example/fbpostproviderplugin/tmp" -first: default -default: debug-winscw -all: debug release - -qmake: - $(QMAKE) -spec symbian-abld -o "bld.inf" "F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/SMFCode/smf_baseline_22june_latest/example/fbpostproviderplugin/fbpostproviderplugin.pro" - -bld.inf: - $(QMAKE) - -$(ABLD): bld.inf - bldmake bldfiles - -debug: $(ABLD) - $(ABLD) build winscw udeb - $(ABLD) build gcce udeb - $(ABLD) build armv5 udeb - $(ABLD) build armv6 udeb - -release: $(ABLD) - $(ABLD) build gcce urel - $(ABLD) build armv5 urel - $(ABLD) build armv6 urel - -debug-winscw: $(ABLD) - $(ABLD) build winscw udeb -debug-gcce: $(ABLD) - $(ABLD) build gcce udeb -debug-armv5: $(ABLD) - $(ABLD) build armv5 udeb -debug-armv6: $(ABLD) - $(ABLD) build armv6 udeb -release-gcce: $(ABLD) - $(ABLD) build gcce urel -release-armv5: $(ABLD) - $(ABLD) build armv5 urel -release-armv6: $(ABLD) - $(ABLD) build armv6 urel - -export: $(ABLD) - $(ABLD) export - -cleanexport: $(ABLD) - $(ABLD) cleanexport - -check: first - -mocclean: compiler_moc_header_clean compiler_moc_source_clean - -mocables: compiler_moc_header_make_all compiler_moc_source_make_all - -compiler_moc_header_make_all: moc_fbpostproviderplugin.cpp -compiler_moc_header_clean: - -$(DEL_FILE) moc_fbpostproviderplugin.cpp 2> NUL -moc_fbpostproviderplugin.cpp: fbpostproviderplugin.h - F:\Qt\4.6.3\bin\moc.exe $(DEFINES) $(INCPATH) -DSYMBIAN fbpostproviderplugin.h -o moc_fbpostproviderplugin.cpp - -compiler_rcc_make_all: -compiler_rcc_clean: -compiler_image_collection_make_all: qmake_image_collection.cpp -compiler_image_collection_clean: - -$(DEL_FILE) qmake_image_collection.cpp 2> NUL -compiler_moc_source_make_all: -compiler_moc_source_clean: -compiler_uic_make_all: -compiler_uic_clean: -compiler_yacc_decl_make_all: -compiler_yacc_decl_clean: -compiler_yacc_impl_make_all: -compiler_yacc_impl_clean: -compiler_lex_make_all: -compiler_lex_clean: -compiler_clean: compiler_moc_header_clean - -create_temps: - -@ if NOT EXIST "F:\Qt\4.6.3\include\QtCore\tmp" mkdir "F:\Qt\4.6.3\include\QtCore\tmp" - -@ if NOT EXIST "F:\Qt\4.6.3\include\QtNetwork\tmp" mkdir "F:\Qt\4.6.3\include\QtNetwork\tmp" - -@ if NOT EXIST "F:\Qt\4.6.3\include\QtGui\tmp" mkdir "F:\Qt\4.6.3\include\QtGui\tmp" - -@ if NOT EXIST "F:\Qt\4.6.3\include\QtXml\tmp" mkdir "F:\Qt\4.6.3\include\QtXml\tmp" - -@ if NOT EXIST "F:\Qt\4.6.3\include\tmp" mkdir "F:\Qt\4.6.3\include\tmp" - -@ if NOT EXIST "F:\Qt\4.6.3\include\QtContacts\tmp" mkdir "F:\Qt\4.6.3\include\QtContacts\tmp" - -@ if NOT EXIST "F:\Qt\4.6.3\include\QtLocation\tmp" mkdir "F:\Qt\4.6.3\include\QtLocation\tmp" - -@ if NOT EXIST "F:\Qt\4.6.3\mkspecs\common\symbian\tmp" mkdir "F:\Qt\4.6.3\mkspecs\common\symbian\tmp" - -@ if NOT EXIST "F:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\fbpostproviderplugin\tmp" mkdir "F:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\fbpostproviderplugin\tmp" - -extension_clean: compiler_clean - -@ if EXIST "F:\Qt\4.6.3\include\QtCore\tmp" rmdir /S /Q "F:\Qt\4.6.3\include\QtCore\tmp" - -@ if EXIST "F:\Qt\4.6.3\include\QtNetwork\tmp" rmdir /S /Q "F:\Qt\4.6.3\include\QtNetwork\tmp" - -@ if EXIST "F:\Qt\4.6.3\include\QtGui\tmp" rmdir /S /Q "F:\Qt\4.6.3\include\QtGui\tmp" - -@ if EXIST "F:\Qt\4.6.3\include\QtXml\tmp" rmdir /S /Q "F:\Qt\4.6.3\include\QtXml\tmp" - -@ if EXIST "F:\Qt\4.6.3\include\tmp" rmdir /S /Q "F:\Qt\4.6.3\include\tmp" - -@ if EXIST "F:\Qt\4.6.3\include\QtContacts\tmp" rmdir /S /Q "F:\Qt\4.6.3\include\QtContacts\tmp" - -@ if EXIST "F:\Qt\4.6.3\include\QtLocation\tmp" rmdir /S /Q "F:\Qt\4.6.3\include\QtLocation\tmp" - -@ if EXIST "F:\Qt\4.6.3\mkspecs\common\symbian\tmp" rmdir /S /Q "F:\Qt\4.6.3\mkspecs\common\symbian\tmp" - -@ if EXIST "F:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\fbpostproviderplugin\tmp" rmdir /S /Q "F:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\fbpostproviderplugin\tmp" - -pre_targetdeps: \ - generated_sources \ - all_source_deps - -generated_sources: \ - moc_fbpostproviderplugin.cpp - -all_source_deps: \ - fbpostproviderplugin.h - -finalize: - -winscw_deployment: - -echo Deploying changed files... - -$(XCOPY) "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\fbpostproviderplugin\qmakepluginstubs\fbpostproviderplugin.qtplugin" "\Nokia\devices\Nokia_Symbian3_SDK_v0.8\epoc32\winscw\c\resource\qt\plugins\smf\plugin\contact.posts\" - -winscw_deployment_clean: - -@ if EXIST "\Nokia\devices\Nokia_Symbian3_SDK_v0.8\epoc32\winscw\c\resource\qt\plugins\smf\plugin\contact.posts\fbpostproviderplugin.qtplugin" $(DEL_FILE) "\Nokia\devices\Nokia_Symbian3_SDK_v0.8\epoc32\winscw\c\resource\qt\plugins\smf\plugin\contact.posts\fbpostproviderplugin.qtplugin" - -deployment: - -echo Deploying changed files... - -$(XCOPY) "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\fbpostproviderplugin\qmakepluginstubs\fbpostproviderplugin.qtplugin" "\Nokia\devices\Nokia_Symbian3_SDK_v0.8\epoc32\data\z\resource\qt\plugins\smf\plugin\contact.posts\" - -deployment_clean: - -@ if EXIST "\Nokia\devices\Nokia_Symbian3_SDK_v0.8\epoc32\data\z\resource\qt\plugins\smf\plugin\contact.posts\fbpostproviderplugin.qtplugin" $(DEL_FILE) "\Nokia\devices\Nokia_Symbian3_SDK_v0.8\epoc32\data\z\resource\qt\plugins\smf\plugin\contact.posts\fbpostproviderplugin.qtplugin" - --include .make.cache - -sis: - $(if $(wildcard fbpostproviderplugin_template.pkg),$(if $(wildcard .make.cache),$(MAKE) -s -f $(MAKEFILE) ok_sis,$(if $(QT_SIS_TARGET),$(MAKE) -s -f $(MAKEFILE) ok_sis,$(MAKE) -s -f $(MAKEFILE) fail_sis_nocache)),$(MAKE) -s -f $(MAKEFILE) fail_sis_nopkg) - -ok_sis: - createpackage.bat $(QT_SIS_OPTIONS) fbpostproviderplugin_template.pkg $(QT_SIS_TARGET) $(QT_SIS_CERTIFICATE) $(QT_SIS_KEY) $(QT_SIS_PASSPHRASE) - -fbpostproviderplugin.sis: - $(MAKE) -s -f $(MAKEFILE) sis - -stub_sis: - $(if $(wildcard fbpostproviderplugin_template.pkg),$(if $(wildcard .make.cache),$(MAKE) -s -f $(MAKEFILE) ok_stub_sis,$(if $(QT_SIS_TARGET),$(MAKE) -s -f $(MAKEFILE) ok_stub_sis,$(MAKE) -s -f $(MAKEFILE) fail_sis_nocache)),$(MAKE) -s -f $(MAKEFILE) fail_sis_nopkg) - -ok_stub_sis: - createpackage.bat -s $(QT_SIS_OPTIONS) fbpostproviderplugin_template.pkg $(QT_SIS_TARGET) $(QT_SIS_CERTIFICATE) $(QT_SIS_KEY) $(QT_SIS_PASSPHRASE) - -installer_sis: fbpostproviderplugin.sis - $(if $(wildcard fbpostproviderplugin_installer.pkg),$(MAKE) -s -f $(MAKEFILE) ok_installer_sis,$(MAKE) -s -f $(MAKEFILE) fail_sis_nopkg) - -ok_installer_sis: - createpackage.bat $(QT_SIS_OPTIONS) fbpostproviderplugin_installer.pkg - $(QT_SIS_CERTIFICATE) $(QT_SIS_KEY) $(QT_SIS_PASSPHRASE) - -fail_sis_nopkg: - $(error PKG file does not exist, 'sis' and 'installer_sis' target are only supported for executables or projects with DEPLOYMENT statement) - -fail_sis_nocache: - $(error Project has to be built or QT_SIS_TARGET environment variable has to be set before calling 'SIS' target) - -store_build: - @echo # ============================================================================== > .make.cache - @echo # This file is generated by make and should not be modified by the user >> .make.cache - @echo # Name : .make.cache >> .make.cache - @echo # Part of : fbpostproviderplugin >> .make.cache - @echo # Description : This file is used to cache last build target for >> .make.cache - @echo # make sis target. >> .make.cache - @echo # Version : >> .make.cache - @echo # >> .make.cache - @echo # ============================================================================== >> .make.cache - @echo. >> .make.cache - @echo QT_SIS_TARGET ?= $(QT_SIS_TARGET) >> .make.cache - -dodistclean: - -@ if EXIST "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\fbpostproviderplugin\fbpostproviderplugin_template.pkg" $(DEL_FILE) "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\fbpostproviderplugin\fbpostproviderplugin_template.pkg" - -@ if EXIST "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\fbpostproviderplugin\qmakepluginstubs\fbpostproviderplugin.qtplugin" $(DEL_FILE) "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\fbpostproviderplugin\qmakepluginstubs\fbpostproviderplugin.qtplugin" - -@ if EXIST "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\fbpostproviderplugin\fbpostproviderplugin_installer.pkg" $(DEL_FILE) "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\fbpostproviderplugin\fbpostproviderplugin_installer.pkg" - -@ if EXIST "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\fbpostproviderplugin\Makefile" $(DEL_FILE) "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\fbpostproviderplugin\Makefile" - -@ if EXIST "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\fbpostproviderplugin\Makefile_0xEfa582ee.mk" $(DEL_FILE) "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\fbpostproviderplugin\Makefile_0xEfa582ee.mk" - -@ if EXIST "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\fbpostproviderplugin\fbpostproviderplugin_0xEfa582ee.mmp" $(DEL_FILE) "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\fbpostproviderplugin\fbpostproviderplugin_0xEfa582ee.mmp" - -@ if EXIST "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\fbpostproviderplugin\plugin_commonU.def" $(DEL_FILE) "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\fbpostproviderplugin\plugin_commonU.def" - -@ if EXIST "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\fbpostproviderplugin\.make.cache" $(DEL_FILE) "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\fbpostproviderplugin\.make.cache" - -@ if EXIST "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\fbpostproviderplugin\bld.inf" $(DEL_FILE) "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\fbpostproviderplugin\bld.inf" - -@ if EXIST "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\fbpostproviderplugin\qmakepluginstubs" $(DEL_DIR) "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\fbpostproviderplugin\qmakepluginstubs" - -distclean: clean dodistclean - -clean: $(ABLD) - -$(ABLD) reallyclean - -bldmake clean - -clean-debug: $(ABLD) - $(ABLD) reallyclean winscw udeb - $(ABLD) reallyclean gcce udeb - $(ABLD) reallyclean armv5 udeb - $(ABLD) reallyclean armv6 udeb - -clean-release: $(ABLD) - $(ABLD) reallyclean gcce urel - $(ABLD) reallyclean armv5 urel - $(ABLD) reallyclean armv6 urel - -clean-debug-winscw: $(ABLD) - $(ABLD) reallyclean winscw udeb -clean-debug-gcce: $(ABLD) - $(ABLD) reallyclean gcce udeb -clean-debug-armv5: $(ABLD) - $(ABLD) reallyclean armv5 udeb -clean-debug-armv6: $(ABLD) - $(ABLD) reallyclean armv6 udeb -clean-release-gcce: $(ABLD) - $(ABLD) reallyclean gcce urel -clean-release-armv5: $(ABLD) - $(ABLD) reallyclean armv5 urel -clean-release-armv6: $(ABLD) - $(ABLD) reallyclean armv6 urel - diff -r b78fa4cdbf2b -r 106a4bfcb866 example/fbpostproviderplugin/bld.inf --- a/example/fbpostproviderplugin/bld.inf Thu Aug 05 16:35:33 2010 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -// ============================================================================ -// * Makefile for building: fbpostproviderplugin -// * Generated by qmake (2.01a) (Qt 4.6.1) on: 2010-05-18T16:00:33 -// * This file is generated by qmake and should not be modified by the -// * user. -// * Project: fbpostproviderplugin.pro -// * Template: lib -// ============================================================================ - -#define BLD_INF_FBPOSTPROVIDERPLUGIN_F46A6C51 - - -prj_platforms - -WINSCW GCCE ARMV5 ARMV6 - - -prj_mmpfiles - -gnumakefile Makefile_0xEa2c8e07.mk -fbpostproviderplugin_0xEa2c8e07.mmp - -prj_extensions - diff -r b78fa4cdbf2b -r 106a4bfcb866 example/fbpostproviderplugin/fbpostproviderplugin.cpp --- a/example/fbpostproviderplugin/fbpostproviderplugin.cpp Thu Aug 05 16:35:33 2010 +0530 +++ b/example/fbpostproviderplugin/fbpostproviderplugin.cpp Thu Aug 05 16:46:37 2010 +0530 @@ -25,6 +25,8 @@ #include #include #include +#include +#include #ifdef SMF_XMLPARSING #include #endif @@ -39,6 +41,12 @@ QString currentId; #endif QMap idNameMap; +QMap idPicMap; + + +// Todo:- Macro added for limiting items fetched to recent 5 +// Remove after demo +#define SETLIMITOFFIVEFORSMFDEMO 1 /** * Method called by plugins to generate a signature string from a base string @@ -58,6 +66,54 @@ return returnString; } + +/** + * Method to interpret the key sets obtained from credential manager + * @param aApiKey [out] The api key + * @param aApiSecret [out] The api secret + * @param aSessionKey [out] The session key + * @param aSessionSecret [out] The session secret + */ +void FBPostProviderPlugin::fetchKeys( QString &aApiKey, + QString &aApiSecret, + QString &aSessionKey, + QString &aSessionSecret ) + { + qDebug()<<"Inside FBPostProviderPlugin::fetchKeys()"; + + qDebug()<<"Reg Token = "<m_smfRegToken; + qDebug()<<"Expiry Date as int = "<m_validity.toTime_t(); + + SmfAuthParams keys; + SmfPluginUtil util; + util.getAuthKeys(keys, m_provider->m_smfRegToken, + m_provider->m_validity, m_provider->m_pluginId); + + qDebug()<<"Number of key-value pairs = "< data; + data.append(f1); + data.append(f2); return data; } @@ -113,7 +172,7 @@ bool FBPostProviderPlugin::supportsAppearence ( ) const { qDebug()<<"Inside FBPostProviderPlugin::supportsAppearence()"; - return false; + return true; } /** @@ -129,14 +188,16 @@ const int aPageNum , const int aItemsPerPage ) { - Q_UNUSED(aUser) qDebug()<<"Inside FBPostProviderPlugin::retrieve()"; + if(0 != aUser->value("Guid").value().guid().size()) + chance = 1; + //// Currently considering for self contact , ie, omitting aUser if(0 == chance) return getFacebookUserId(aRequest); else - return getPosts(aRequest, aPageNum , aItemsPerPage); + return getPosts(aRequest, aUser, aPageNum , aItemsPerPage); } @@ -152,32 +213,12 @@ SmfPluginError error = SmfPluginErrUserNotLoggedIn; -#if 1 -// Reading the keys, CSM Stubbed - START - QFile file("c:\\data\\FacebookKeys.txt"); - if (!file.open(QIODevice::ReadOnly)) - { - qDebug()<<"File to read the keys could not be opened"; - return error; - } - - qDebug()<<"Key file read, going to parse the key values from file"; - - QByteArray arr = file.readAll(); - QList list = arr.split('\n'); - file.close(); - - QString apiKey(list[0]); - QString apiSecret(list[1]); - QString sessionKey(list[2]); - QString sessionSecret(list[3]); - - qDebug()<<"Api Key = "+apiKey; - qDebug()<<"Api Secret = "+apiSecret; - qDebug()<<"session Key = "+sessionKey; - qDebug()<<"session Secret = "+sessionSecret; -// Reading the keys, CSM Stubbed - END -#endif + // Get the key sets from SMF Plugin Utility class. + QString apiKey; + QString apiSecret; + QString sessionKey; + QString sessionSecret; + fetchKeys(apiKey, apiSecret, sessionKey, sessionSecret); // Get the current date and time and convert it to sec as a string QString call_id = QString::number(QDateTime::currentDateTime().toTime_t(), 10); @@ -226,16 +267,19 @@ /** * Method to get the user's posts * @param aRequest [out] The request data to be sent to network + * @param aUser The user's contact in this SP, omit for self contact * @param aPageNum The page to be extracted * @param aItemsPerPage Number of items per page * @return SmfPluginError Plugin error if any, else SmfPluginErrNone */ SmfPluginError FBPostProviderPlugin::getPosts( SmfPluginRequestData &aRequest, + const SmfContact *aUser, const int aPageNum , const int aItemsPerPage ) { qDebug()<<"Inside FBPostProviderPlugin::getPosts()"; + qDebug()<<"Required guid = "<value("Guid").value().guid(); qDebug()<<"aPageNum = "< list = arr.split('\n'); - file.close(); - - QString apiKey(list[0]); - QString apiSecret(list[1]); - QString sessionKey(list[2]); - QString sessionSecret(list[3]); - - qDebug()<<"Api Key = "+apiKey; - qDebug()<<"Api Secret = "+apiSecret; - qDebug()<<"session Key = "+sessionKey; - qDebug()<<"session Secret = "+sessionSecret; -// Reading the keys, CSM Stubbed - END -#endif + // Get the key sets from SMF Plugin Utility class. + QString apiKey; + QString apiSecret; + QString sessionKey; + QString sessionSecret; + fetchKeys(apiKey, apiSecret, sessionKey, sessionSecret); // Get the current date and time and convert it to sec as a string QString call_id = QString::number(QDateTime::currentDateTime().toTime_t(), 10); @@ -289,17 +313,23 @@ #else baseString.append("format=JSON"); #endif + +#ifdef SETLIMITOFFIVEFORSMFDEMO // Hard coding the number of posts fetched as recent 5 + qDebug()<<"Hardcoding pagenumber and itemperpage to fetch 5 recent posts"; + int val = 5; + baseString.append("limit="+QString::number(val)); +#else if(0 == aPageNum) - { - //baseString.append("limit="+QString::number((aItemsPerPage*(aPageNum+1)), 10)); - qDebug()<<"Hardcoding pagenumber and itemperpage to fetch 5 posts"; - int val = 5; - baseString.append("limit="+QString::number(val)); - } + baseString.append("limit="+QString::number((aItemsPerPage*(aPageNum+1)), 10)); else baseString.append("limit="+QString::number((aItemsPerPage*aPageNum), 10)); +#endif + baseString.append("method=stream.get"); baseString.append("session_key="+sessionKey); + if(0 != aUser->value("Guid").value().guid().size()) + baseString.append("source_ids="+aUser->value("Guid").value().guid()); + else baseString.append("source_ids="+uid); baseString.append("ss=1"); baseString.append("v=1.0"); @@ -314,17 +344,23 @@ #else url.addQueryItem("format", "JSON"); #endif + +#ifdef SETLIMITOFFIVEFORSMFDEMO // Hard coding the number of posts fetched as recent 5 + qDebug()<<"Hardcoding pagenumber and itemperpage to fetch 5 recent posts"; + val = 5; + url.addQueryItem("limit", QString::number(val)); +#else if(0 == aPageNum) - { -// url.addQueryItem("limit", QString::number((aItemsPerPage*(aPageNum+1)), 10)); - qDebug()<<"Hardcoding pagenumber and itemperpage to fetch 5 posts"; - int val = 5; - url.addQueryItem("limit", QString::number(val)); - } + url.addQueryItem("limit", QString::number((aItemsPerPage*(aPageNum+1)), 10)); else url.addQueryItem("limit", QString::number((aItemsPerPage*aPageNum), 10)); +#endif + url.addQueryItem("method", "stream.get"); url.addQueryItem("session_key", sessionKey); + if(0 != aUser->value("Guid").value().guid().size()) + url.addQueryItem("source_ids",aUser->value("Guid").value().guid()); + else url.addQueryItem("source_ids",uid); url.addQueryItem("ss", "1"); url.addQueryItem("v", "1.0"); @@ -406,32 +442,12 @@ qDebug()<<"Valid arguments"; -#if 1 -// Reading the keys, CSM Stubbed - START - QFile file("c:\\data\\FacebookKeys.txt"); - if (!file.open(QIODevice::ReadOnly)) - { - qDebug()<<"File to read the keys could not be opened"; - return SmfPluginErrUserNotLoggedIn; - } - - qDebug()<<"Key file read, going to parse the key values from file"; - - QByteArray arr = file.readAll(); - QList list = arr.split('\n'); - file.close(); - - QString apiKey(list[0]); - QString apiSecret(list[1]); - QString sessionKey(list[2]); - QString sessionSecret(list[3]); - - qDebug()<<"Api Key = "<parse(response, &ok); + SmfPluginUtil util; + QVariant result = util.parse(response, &ok); if (!ok) { - qDebug()<<"An error occurred during json parsing, error = "<errorString(); + qDebug()<<"An error occurred during json parsing, error = "<parse(response, &ok).toMap(); + SmfPluginUtil util; + QVariantMap result = util.parse(response, &ok).toMap(); if (!ok) { qDebug()<<"An error occurred during json parsing"; @@ -873,7 +899,9 @@ QVariantMap map2 = iter2.next().toMap(); qDebug()<<"owner's id = "<().guid())); + avatar.setImageUrl(url); + qDebug()<<"Profile Image Url = "<(avatar); + contact.setValue("Avatar", urlVar); + list[i].setOwner(contact); } } @@ -936,7 +971,8 @@ } #else bool ok; - QVariantMap result = m_util->parse(response, &ok).toMap(); + SmfPluginUtil util; + QVariantMap result = util.parse(response, &ok).toMap(); if (!ok) { qDebug()<<"Response cannot be parsed"; @@ -1106,12 +1142,14 @@ void FBProviderBase::initialize() { m_serviceName = "Facebook"; - m_description = "Facebook plugin description"; + m_description = "Facebook post plugin description"; m_serviceUrl = QUrl(QString("http://api.facebook.com")); m_pluginId = "fbpostproviderplugin.qtplugin"; - m_authAppId = "Facebook AuthAppId"; - m_smfRegToken = "Facebook RegToken"; + m_authAppId = "0xEFE2FD23"; m_supportedInterfaces.append("org.symbian.smf.plugin.contact.posts/v0.2"); + QSettings iSettings; + m_smfRegToken = iSettings.value("FBCMRegToken").toString(); + m_validity = iSettings.value("FBExpiryTime").toDateTime(); } diff -r b78fa4cdbf2b -r 106a4bfcb866 example/fbpostproviderplugin/fbpostproviderplugin.h --- a/example/fbpostproviderplugin/fbpostproviderplugin.h Thu Aug 05 16:35:33 2010 +0530 +++ b/example/fbpostproviderplugin/fbpostproviderplugin.h Thu Aug 05 16:46:37 2010 +0530 @@ -21,13 +21,12 @@ #define _FBPOSTPROVIDERPLUGIN_H // Include files +#include #include -#include // Forward declarations class FBProviderBase; class QVariant; -class QNetworkReply; /** @@ -179,10 +178,8 @@ /** * The first method to be called in the plugin that implements this interface. * If this method is not called, plugin may not behave as expected. - * Plugins are expected to save the aUtil handle and use and when required. - * @param aUtil The instance of SmfPluginUtil */ - void initialize( SmfPluginUtil *aUtil ); + void initialize( ); /** * Method to get the provider information @@ -233,17 +230,30 @@ /** * Method to get the user's posts * @param aRequest [out] The request data to be sent to network + * @param aUser The user's contact in this SP, omit for self contact * @param aPageNum The page to be extracted * @param aItemsPerPage Number of items per page * @return SmfPluginError Plugin error if any, else SmfPluginErrNone */ SmfPluginError getPosts( SmfPluginRequestData &aRequest, + const SmfContact *aUser, const int aPageNum , const int aItemsPerPage ); + /** + * Method to interpret the key sets obtained from credential manager + * @param aApiKey [out] The api key + * @param aApiSecret [out] The api secret + * @param aSessionKey [out] The session key + * @param aSessionSecret [out] The session secret + */ + void fetchKeys( QString &aApiKey, + QString &aApiSecret, + QString &aSessionKey, + QString &aSessionSecret ); + private: FBProviderBase *m_provider; - SmfPluginUtil *m_util; }; @@ -355,6 +365,7 @@ QString m_smfRegToken; QList m_supportedInterfaces; QStringList m_supportedLangs; + QDateTime m_validity; }; #endif /*_FBPOSTPROVIDERPLUGIN_H*/ diff -r b78fa4cdbf2b -r 106a4bfcb866 example/fbpostproviderplugin/fbpostproviderplugin.pro --- a/example/fbpostproviderplugin/fbpostproviderplugin.pro Thu Aug 05 16:35:33 2010 +0530 +++ b/example/fbpostproviderplugin/fbpostproviderplugin.pro Thu Aug 05 16:46:37 2010 +0530 @@ -36,7 +36,7 @@ ReadDeviceData \ WriteDeviceData - LIBS += -lsmfclient.dll + LIBS += -lsmfcommon } target.path += $$[QT_INSTALL_PLUGINS]/smf/plugin/contact.posts diff -r b78fa4cdbf2b -r 106a4bfcb866 example/fbpostproviderplugin/fbpostproviderplugin_installer.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/fbpostproviderplugin/fbpostproviderplugin_installer.pkg Thu Aug 05 16:46:37 2010 +0530 @@ -0,0 +1,30 @@ +; fbpostproviderplugin_installer.pkg generated by qmake at 2010-07-30T14:11:44 +; This file is generated by qmake and should not be modified by the user +; + +; Language +&EN + +; SIS header: name, uid, version +#{"fbpostproviderplugin installer"},(0xA000D7CE),1,0,0 + +; Localised Vendor name +%{"Vendor"} + +; Unique Vendor name +:"Vendor" + + +; Manual PKG pre-rules from PRO files +; Default HW/platform dependencies +[0x101F7961],0,0,0,{"S60ProductID"} +[0x102032BE],0,0,0,{"S60ProductID"} +[0x102752AE],0,0,0,{"S60ProductID"} +[0x1028315F],0,0,0,{"S60ProductID"} + +; Default dependency to Qt libraries +; Default dependency to QtMobility libraries + + +"D:/smf/MissingCode/smfrepo/example/fbpostproviderplugin/fbpostproviderplugin.sis" - "c:\adm\fbpostproviderplugin.sis" +@"D:/Qt/4.6.2/smartinstaller.sis",(0x2002CCCD) diff -r b78fa4cdbf2b -r 106a4bfcb866 example/fbpostproviderplugin/fbpostproviderplugin_template.pkg --- a/example/fbpostproviderplugin/fbpostproviderplugin_template.pkg Thu Aug 05 16:35:33 2010 +0530 +++ b/example/fbpostproviderplugin/fbpostproviderplugin_template.pkg Thu Aug 05 16:46:37 2010 +0530 @@ -1,13 +1,12 @@ -; fbpostproviderplugin_template.pkg generated by qmake at 2010-06-22T14:10:41 +; fbpostproviderplugin_template.pkg generated by qmake at 2010-07-30T14:11:44 ; This file is generated by qmake and should not be modified by the user ; ; Language &EN - ; SIS header: name, uid, version -#{"fbpostproviderplugin"},(0xEfa582ee),1,0,0 +#{"fbpostproviderplugin"},(0xEb57b616),1,0,0 ; Localised Vendor name %{"Vendor"} @@ -17,19 +16,19 @@ ; Manual PKG pre-rules from PRO files -; Default dependency to Qt libraries -(0x2001E61C), 4, 6, 3, {"Qt"} ; Default HW/platform dependencies [0x101F7961],0,0,0,{"S60ProductID"} [0x102032BE],0,0,0,{"S60ProductID"} [0x102752AE],0,0,0,{"S60ProductID"} [0x1028315F],0,0,0,{"S60ProductID"} +; Default dependency to Qt libraries +(0x2001E61C), 4, 6, 2, {"Qt"} ; Default dependency to QtMobility libraries (0x2002AC89), 1, 0, 0, {"QtMobility"} ; DEPLOYMENT -"/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/release/$(PLATFORM)/$(TARGET)/fbpostproviderplugin.dll" - "!:\sys\bin\fbpostproviderplugin.dll" -"/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/data/z/resource/qt/plugins/smf/plugin/contact.posts/fbpostproviderplugin.qtplugin" - "!:\resource\qt\plugins\smf\plugin\contact.posts\fbpostproviderplugin.qtplugin" +"d:/S60/devices/Nokia_Symbian3_SDK_v0.8/epoc32/release/$(PLATFORM)/$(TARGET)/fbpostproviderplugin.dll" - "!:\sys\bin\fbpostproviderplugin.dll" +"d:/smf/MissingCode/smfrepo/example/fbpostproviderplugin/qmakepluginstubs/fbpostproviderplugin.qtplugin" - "!:\resource\qt\plugins\smf\plugin\contact.posts\fbpostproviderplugin.qtplugin" ; Manual PKG post-rules from PRO files diff -r b78fa4cdbf2b -r 106a4bfcb866 example/fbpostproviderplugin/plugin_commonU.def --- a/example/fbpostproviderplugin/plugin_commonU.def Thu Aug 05 16:35:33 2010 +0530 +++ b/example/fbpostproviderplugin/plugin_commonU.def Thu Aug 05 16:46:37 2010 +0530 @@ -1,5 +1,5 @@ ; ============================================================================== -; Generated by qmake (2.01a) (Qt 4.6.3) on: 2010-06-22T14:10:41 +; Generated by qmake (2.01a) (Qt 4.6.2) on: 2010-07-30T14:11:44 ; This file is generated by qmake and should not be modified by the ; user. ; Name : plugin_commonU.def diff -r b78fa4cdbf2b -r 106a4bfcb866 example/fbpostproviderplugin/qmakepluginstubs/fbpostproviderplugin.qtplugin --- a/example/fbpostproviderplugin/qmakepluginstubs/fbpostproviderplugin.qtplugin Thu Aug 05 16:35:33 2010 +0530 +++ b/example/fbpostproviderplugin/qmakepluginstubs/fbpostproviderplugin.qtplugin Thu Aug 05 16:46:37 2010 +0530 @@ -1,1 +1,1 @@ -This file is a Qt plugin stub file. The real Qt plugin is located in /sys/bin. Created:2010-06-22T14:10:41 +This file is a Qt plugin stub file. The real Qt plugin is located in \sys\bin. Created:2010-07-30T14:11:44 diff -r b78fa4cdbf2b -r 106a4bfcb866 example/flickrcontactfetcherplugin/ABLD.BAT --- a/example/flickrcontactfetcherplugin/ABLD.BAT Thu Aug 05 16:35:33 2010 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -@ECHO OFF - -REM Bldmake-generated batch file - ABLD.BAT -REM ** DO NOT EDIT ** - -perl -S ABLD.PL "\CarbideWorkspace\smfserver_cleaned\example\flickrcontactfetcherplugin\\" %1 %2 %3 %4 %5 %6 %7 %8 %9 -if errorlevel==1 goto CheckPerl -goto End - -:CheckPerl -perl -v >NUL -if errorlevel==1 echo Is Perl, version 5.003_07 or later, installed? -goto End - -:End diff -r b78fa4cdbf2b -r 106a4bfcb866 example/flickrcontactfetcherplugin/Makefile --- a/example/flickrcontactfetcherplugin/Makefile Thu Aug 05 16:35:33 2010 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,239 +0,0 @@ -# ============================================================================== -# Generated by qmake (2.01a) (Qt 4.6.3) on: Tue Jun 22 14:10:41 2010 -# This file is generated by qmake and should not be modified by the -# user. -# Name : Makefile -# Description : Wrapper Makefile for calling Symbian build tools -# -# ============================================================================== - - -MAKEFILE = Makefile -QMAKE = f:\Qt\4.6.3\bin\qmake -DEL_FILE = del -DEL_DIR = rmdir -MOVE = move -CHK_DIR_EXISTS = if not exist -MKDIR = mkdir -XCOPY = xcopy /d /f /h /r /y /i -ABLD = ABLD.BAT -DEBUG_PLATFORMS = winscw gcce armv5 armv6 -RELEASE_PLATFORMS = gcce armv5 armv6 -MAKE = make - -ifeq (WINS,$(findstring WINS, $(PLATFORM))) -ZDIR=$(EPOCROOT)epoc32\release\$(PLATFORM)\$(CFG)\Z -else -ZDIR=$(EPOCROOT)epoc32\data\z -endif - -DEFINES = -DSYMBIAN -DUNICODE -DQT_KEYPAD_NAVIGATION -DQT_SOFTKEYS_ENABLED -DQT_USE_MATH_H_FLOATS -DQT_PLUGIN -DQT_XML_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -INCPATH = -I"F:/Qt/4.6.3/include/QtCore" -I"F:/Qt/4.6.3/include/QtCore/tmp" -I"F:/Qt/4.6.3/include/QtNetwork" -I"F:/Qt/4.6.3/include/QtNetwork/tmp" -I"F:/Qt/4.6.3/include/QtGui" -I"F:/Qt/4.6.3/include/QtGui/tmp" -I"F:/Qt/4.6.3/include/QtXml" -I"F:/Qt/4.6.3/include/QtXml/tmp" -I"F:/Qt/4.6.3/include" -I"F:/Qt/4.6.3/include/tmp" -I"F:/Qt/4.6.3/include/QtContacts" -I"F:/Qt/4.6.3/include/QtContacts/tmp" -I"F:/Qt/4.6.3/include/QtLocation" -I"F:/Qt/4.6.3/include/QtLocation/tmp" -I"F:/Qt/4.6.3/mkspecs/common/symbian" -I"F:/Qt/4.6.3/mkspecs/common/symbian/tmp" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/include" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/include/stdapis" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/include/stdapis/sys" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/include/mw" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/include/platform/mw" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/include/platform" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/include/app" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/include/platform/app" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/include/platform/loc" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/include/platform/mw/loc" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/include/platform/app/loc" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/include/platform/loc/sc" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/include/platform/mw/loc/sc" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/include/platform/app/loc/sc" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/include/stdapis/stlportv5" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/SMFCode/smf_baseline_22june_latest/example/flickrcontactfetcherplugin" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/SMFCode/smf_baseline_22june_latest/example/flickrcontactfetcherplugin/tmp" -first: default -default: debug-winscw -all: debug release - -qmake: - $(QMAKE) -spec symbian-abld -o "bld.inf" "F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/SMFCode/smf_baseline_22june_latest/example/flickrcontactfetcherplugin/flickrcontactfetcherplugin.pro" - -bld.inf: - $(QMAKE) - -$(ABLD): bld.inf - bldmake bldfiles - -debug: $(ABLD) - $(ABLD) build winscw udeb - $(ABLD) build gcce udeb - $(ABLD) build armv5 udeb - $(ABLD) build armv6 udeb - -release: $(ABLD) - $(ABLD) build gcce urel - $(ABLD) build armv5 urel - $(ABLD) build armv6 urel - -debug-winscw: $(ABLD) - $(ABLD) build winscw udeb -debug-gcce: $(ABLD) - $(ABLD) build gcce udeb -debug-armv5: $(ABLD) - $(ABLD) build armv5 udeb -debug-armv6: $(ABLD) - $(ABLD) build armv6 udeb -release-gcce: $(ABLD) - $(ABLD) build gcce urel -release-armv5: $(ABLD) - $(ABLD) build armv5 urel -release-armv6: $(ABLD) - $(ABLD) build armv6 urel - -export: $(ABLD) - $(ABLD) export - -cleanexport: $(ABLD) - $(ABLD) cleanexport - -check: first - -mocclean: compiler_moc_header_clean compiler_moc_source_clean - -mocables: compiler_moc_header_make_all compiler_moc_source_make_all - -compiler_moc_header_make_all: moc_flickrcontactfetcherplugin.cpp -compiler_moc_header_clean: - -$(DEL_FILE) moc_flickrcontactfetcherplugin.cpp 2> NUL -moc_flickrcontactfetcherplugin.cpp: flickrcontactfetcherplugin.h - F:\Qt\4.6.3\bin\moc.exe $(DEFINES) $(INCPATH) -DSYMBIAN flickrcontactfetcherplugin.h -o moc_flickrcontactfetcherplugin.cpp - -compiler_rcc_make_all: -compiler_rcc_clean: -compiler_image_collection_make_all: qmake_image_collection.cpp -compiler_image_collection_clean: - -$(DEL_FILE) qmake_image_collection.cpp 2> NUL -compiler_moc_source_make_all: -compiler_moc_source_clean: -compiler_uic_make_all: -compiler_uic_clean: -compiler_yacc_decl_make_all: -compiler_yacc_decl_clean: -compiler_yacc_impl_make_all: -compiler_yacc_impl_clean: -compiler_lex_make_all: -compiler_lex_clean: -compiler_clean: compiler_moc_header_clean - -create_temps: - -@ if NOT EXIST "F:\Qt\4.6.3\include\QtCore\tmp" mkdir "F:\Qt\4.6.3\include\QtCore\tmp" - -@ if NOT EXIST "F:\Qt\4.6.3\include\QtNetwork\tmp" mkdir "F:\Qt\4.6.3\include\QtNetwork\tmp" - -@ if NOT EXIST "F:\Qt\4.6.3\include\QtGui\tmp" mkdir "F:\Qt\4.6.3\include\QtGui\tmp" - -@ if NOT EXIST "F:\Qt\4.6.3\include\QtXml\tmp" mkdir "F:\Qt\4.6.3\include\QtXml\tmp" - -@ if NOT EXIST "F:\Qt\4.6.3\include\tmp" mkdir "F:\Qt\4.6.3\include\tmp" - -@ if NOT EXIST "F:\Qt\4.6.3\include\QtContacts\tmp" mkdir "F:\Qt\4.6.3\include\QtContacts\tmp" - -@ if NOT EXIST "F:\Qt\4.6.3\include\QtLocation\tmp" mkdir "F:\Qt\4.6.3\include\QtLocation\tmp" - -@ if NOT EXIST "F:\Qt\4.6.3\mkspecs\common\symbian\tmp" mkdir "F:\Qt\4.6.3\mkspecs\common\symbian\tmp" - -@ if NOT EXIST "F:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\flickrcontactfetcherplugin\tmp" mkdir "F:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\flickrcontactfetcherplugin\tmp" - -extension_clean: compiler_clean - -@ if EXIST "F:\Qt\4.6.3\include\QtCore\tmp" rmdir /S /Q "F:\Qt\4.6.3\include\QtCore\tmp" - -@ if EXIST "F:\Qt\4.6.3\include\QtNetwork\tmp" rmdir /S /Q "F:\Qt\4.6.3\include\QtNetwork\tmp" - -@ if EXIST "F:\Qt\4.6.3\include\QtGui\tmp" rmdir /S /Q "F:\Qt\4.6.3\include\QtGui\tmp" - -@ if EXIST "F:\Qt\4.6.3\include\QtXml\tmp" rmdir /S /Q "F:\Qt\4.6.3\include\QtXml\tmp" - -@ if EXIST "F:\Qt\4.6.3\include\tmp" rmdir /S /Q "F:\Qt\4.6.3\include\tmp" - -@ if EXIST "F:\Qt\4.6.3\include\QtContacts\tmp" rmdir /S /Q "F:\Qt\4.6.3\include\QtContacts\tmp" - -@ if EXIST "F:\Qt\4.6.3\include\QtLocation\tmp" rmdir /S /Q "F:\Qt\4.6.3\include\QtLocation\tmp" - -@ if EXIST "F:\Qt\4.6.3\mkspecs\common\symbian\tmp" rmdir /S /Q "F:\Qt\4.6.3\mkspecs\common\symbian\tmp" - -@ if EXIST "F:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\flickrcontactfetcherplugin\tmp" rmdir /S /Q "F:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\flickrcontactfetcherplugin\tmp" - -pre_targetdeps: \ - generated_sources \ - all_source_deps - -generated_sources: \ - moc_flickrcontactfetcherplugin.cpp - -all_source_deps: \ - flickrcontactfetcherplugin.h - -finalize: - -winscw_deployment: - -echo Deploying changed files... - -$(XCOPY) "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\flickrcontactfetcherplugin\qmakepluginstubs\flickrcontactfetcherplugin.qtplugin" "\Nokia\devices\Nokia_Symbian3_SDK_v0.8\epoc32\winscw\c\resource\qt\plugins\smf\plugin\contact.fetcher\" - -winscw_deployment_clean: - -@ if EXIST "\Nokia\devices\Nokia_Symbian3_SDK_v0.8\epoc32\winscw\c\resource\qt\plugins\smf\plugin\contact.fetcher\flickrcontactfetcherplugin.qtplugin" $(DEL_FILE) "\Nokia\devices\Nokia_Symbian3_SDK_v0.8\epoc32\winscw\c\resource\qt\plugins\smf\plugin\contact.fetcher\flickrcontactfetcherplugin.qtplugin" - -deployment: - -echo Deploying changed files... - -$(XCOPY) "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\flickrcontactfetcherplugin\qmakepluginstubs\flickrcontactfetcherplugin.qtplugin" "\Nokia\devices\Nokia_Symbian3_SDK_v0.8\epoc32\data\z\resource\qt\plugins\smf\plugin\contact.fetcher\" - -deployment_clean: - -@ if EXIST "\Nokia\devices\Nokia_Symbian3_SDK_v0.8\epoc32\data\z\resource\qt\plugins\smf\plugin\contact.fetcher\flickrcontactfetcherplugin.qtplugin" $(DEL_FILE) "\Nokia\devices\Nokia_Symbian3_SDK_v0.8\epoc32\data\z\resource\qt\plugins\smf\plugin\contact.fetcher\flickrcontactfetcherplugin.qtplugin" - --include .make.cache - -sis: - $(if $(wildcard flickrcontactfetcherplugin_template.pkg),$(if $(wildcard .make.cache),$(MAKE) -s -f $(MAKEFILE) ok_sis,$(if $(QT_SIS_TARGET),$(MAKE) -s -f $(MAKEFILE) ok_sis,$(MAKE) -s -f $(MAKEFILE) fail_sis_nocache)),$(MAKE) -s -f $(MAKEFILE) fail_sis_nopkg) - -ok_sis: - createpackage.bat $(QT_SIS_OPTIONS) flickrcontactfetcherplugin_template.pkg $(QT_SIS_TARGET) $(QT_SIS_CERTIFICATE) $(QT_SIS_KEY) $(QT_SIS_PASSPHRASE) - -flickrcontactfetcherplugin.sis: - $(MAKE) -s -f $(MAKEFILE) sis - -stub_sis: - $(if $(wildcard flickrcontactfetcherplugin_template.pkg),$(if $(wildcard .make.cache),$(MAKE) -s -f $(MAKEFILE) ok_stub_sis,$(if $(QT_SIS_TARGET),$(MAKE) -s -f $(MAKEFILE) ok_stub_sis,$(MAKE) -s -f $(MAKEFILE) fail_sis_nocache)),$(MAKE) -s -f $(MAKEFILE) fail_sis_nopkg) - -ok_stub_sis: - createpackage.bat -s $(QT_SIS_OPTIONS) flickrcontactfetcherplugin_template.pkg $(QT_SIS_TARGET) $(QT_SIS_CERTIFICATE) $(QT_SIS_KEY) $(QT_SIS_PASSPHRASE) - -installer_sis: flickrcontactfetcherplugin.sis - $(if $(wildcard flickrcontactfetcherplugin_installer.pkg),$(MAKE) -s -f $(MAKEFILE) ok_installer_sis,$(MAKE) -s -f $(MAKEFILE) fail_sis_nopkg) - -ok_installer_sis: - createpackage.bat $(QT_SIS_OPTIONS) flickrcontactfetcherplugin_installer.pkg - $(QT_SIS_CERTIFICATE) $(QT_SIS_KEY) $(QT_SIS_PASSPHRASE) - -fail_sis_nopkg: - $(error PKG file does not exist, 'sis' and 'installer_sis' target are only supported for executables or projects with DEPLOYMENT statement) - -fail_sis_nocache: - $(error Project has to be built or QT_SIS_TARGET environment variable has to be set before calling 'SIS' target) - -store_build: - @echo # ============================================================================== > .make.cache - @echo # This file is generated by make and should not be modified by the user >> .make.cache - @echo # Name : .make.cache >> .make.cache - @echo # Part of : flickrcontactfetcherplugin >> .make.cache - @echo # Description : This file is used to cache last build target for >> .make.cache - @echo # make sis target. >> .make.cache - @echo # Version : >> .make.cache - @echo # >> .make.cache - @echo # ============================================================================== >> .make.cache - @echo. >> .make.cache - @echo QT_SIS_TARGET ?= $(QT_SIS_TARGET) >> .make.cache - -dodistclean: - -@ if EXIST "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\flickrcontactfetcherplugin\flickrcontactfetcherplugin_template.pkg" $(DEL_FILE) "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\flickrcontactfetcherplugin\flickrcontactfetcherplugin_template.pkg" - -@ if EXIST "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\flickrcontactfetcherplugin\qmakepluginstubs\flickrcontactfetcherplugin.qtplugin" $(DEL_FILE) "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\flickrcontactfetcherplugin\qmakepluginstubs\flickrcontactfetcherplugin.qtplugin" - -@ if EXIST "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\flickrcontactfetcherplugin\flickrcontactfetcherplugin_installer.pkg" $(DEL_FILE) "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\flickrcontactfetcherplugin\flickrcontactfetcherplugin_installer.pkg" - -@ if EXIST "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\flickrcontactfetcherplugin\Makefile" $(DEL_FILE) "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\flickrcontactfetcherplugin\Makefile" - -@ if EXIST "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\flickrcontactfetcherplugin\Makefile_0xE1f540a6.mk" $(DEL_FILE) "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\flickrcontactfetcherplugin\Makefile_0xE1f540a6.mk" - -@ if EXIST "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\flickrcontactfetcherplugin\flickrcontactfetcherplugin_0xE1f540a6.mmp" $(DEL_FILE) "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\flickrcontactfetcherplugin\flickrcontactfetcherplugin_0xE1f540a6.mmp" - -@ if EXIST "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\flickrcontactfetcherplugin\plugin_commonU.def" $(DEL_FILE) "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\flickrcontactfetcherplugin\plugin_commonU.def" - -@ if EXIST "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\flickrcontactfetcherplugin\.make.cache" $(DEL_FILE) "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\flickrcontactfetcherplugin\.make.cache" - -@ if EXIST "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\flickrcontactfetcherplugin\bld.inf" $(DEL_FILE) "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\flickrcontactfetcherplugin\bld.inf" - -@ if EXIST "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\flickrcontactfetcherplugin\qmakepluginstubs" $(DEL_DIR) "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\flickrcontactfetcherplugin\qmakepluginstubs" - -distclean: clean dodistclean - -clean: $(ABLD) - -$(ABLD) reallyclean - -bldmake clean - -clean-debug: $(ABLD) - $(ABLD) reallyclean winscw udeb - $(ABLD) reallyclean gcce udeb - $(ABLD) reallyclean armv5 udeb - $(ABLD) reallyclean armv6 udeb - -clean-release: $(ABLD) - $(ABLD) reallyclean gcce urel - $(ABLD) reallyclean armv5 urel - $(ABLD) reallyclean armv6 urel - -clean-debug-winscw: $(ABLD) - $(ABLD) reallyclean winscw udeb -clean-debug-gcce: $(ABLD) - $(ABLD) reallyclean gcce udeb -clean-debug-armv5: $(ABLD) - $(ABLD) reallyclean armv5 udeb -clean-debug-armv6: $(ABLD) - $(ABLD) reallyclean armv6 udeb -clean-release-gcce: $(ABLD) - $(ABLD) reallyclean gcce urel -clean-release-armv5: $(ABLD) - $(ABLD) reallyclean armv5 urel -clean-release-armv6: $(ABLD) - $(ABLD) reallyclean armv6 urel - diff -r b78fa4cdbf2b -r 106a4bfcb866 example/flickrcontactfetcherplugin/bld.inf --- a/example/flickrcontactfetcherplugin/bld.inf Thu Aug 05 16:35:33 2010 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -// ============================================================================ -// * Makefile for building: flickrcontactfetcherplugin -// * Generated by qmake (2.01a) (Qt 4.6.1) on: 2010-05-18T16:01:40 -// * This file is generated by qmake and should not be modified by the -// * user. -// * Project: flickrcontactfetcherplugin.pro -// * Template: lib -// ============================================================================ - -#define BLD_INF_FLICKRCONTACTFETCHERPLUGIN_0E012629 - - -prj_platforms - -WINSCW GCCE ARMV5 ARMV6 - - -prj_mmpfiles - -gnumakefile Makefile_0xE341a8b4.mk -flickrcontactfetcherplugin_0xE341a8b4.mmp - -prj_extensions - diff -r b78fa4cdbf2b -r 106a4bfcb866 example/flickrcontactfetcherplugin/flickrcontactfetcherplugin.cpp --- a/example/flickrcontactfetcherplugin/flickrcontactfetcherplugin.cpp Thu Aug 05 16:35:33 2010 +0530 +++ b/example/flickrcontactfetcherplugin/flickrcontactfetcherplugin.cpp Thu Aug 05 16:46:37 2010 +0530 @@ -25,6 +25,8 @@ #include #include #include +#include +#include #ifdef SMF_XMLPARSING #include #endif @@ -41,6 +43,46 @@ } /** + * Method to interpret the key sets obtained from credential manager + * @param aApiKey [out] The api key + * @param aApiSecret [out] The api secret + * @param aAuthToken [out] The auth token provided by Flickr + */ +void FlickrContactFetcherPlugin::fetchKeys( QString &aApiKey, + QString &aApiSecret, + QString &aAuthToken ) + { + qDebug()<<"Inside FlickrContactFetcherPlugin::fetchKeys()"; + + qDebug()<<"Reg Token = "<m_smfRegToken; + qDebug()<<"Expiry Date as int = "<m_validity.toTime_t(); + + SmfAuthParams keys; + SmfPluginUtil util; + util.getAuthKeys(keys, m_provider->m_smfRegToken, + m_provider->m_validity, m_provider->m_pluginId); + + qDebug()<<"Number of key-value pairs = "< list = arr.split('\n'); - file.close(); - - QString apiKey(list[0]); - QString apiSecret(list[1]); - QString authToken(list[2]); - - qDebug()<<"Api Key = "<setValue(list); @@ -414,6 +445,7 @@ qDebug()<<"path_alias = "< #include -#include // Forward declarations class FlickrProviderBase; class QVariant; -class QNetworkReply; /** @@ -137,10 +136,8 @@ /** * The first method to be called in the plugin that implements this interface. * If this method is not called, plugin may not behave as expected. - * Plugins are expected to save the aUtil handle and use and when required. - * @param aUtil The instance of SmfPluginUtil */ - void initialize( SmfPluginUtil *aUtil ); + void initialize( ); /** * Method to get the provider information @@ -180,10 +177,19 @@ * @return The md5 hash of the base string */ QString generateSignature( const QString aBaseString ); + + /** + * Method to interpret the key sets obtained from credential manager + * @param aApiKey [out] The api key + * @param aApiSecret [out] The api secret + * @param aAuthToken [out] The auth token provided by Flickr + */ + void fetchKeys( QString &aApiKey, + QString &aApiSecret, + QString &aAuthToken ); private: FlickrProviderBase *m_provider; - SmfPluginUtil *m_util; }; @@ -295,6 +301,7 @@ QString m_smfRegToken; QList m_supportedInterfaces; QStringList m_supportedLangs; + QDateTime m_validity; }; #endif /*_FLICKRCONTACTFETCHERPLUGIN_H*/ diff -r b78fa4cdbf2b -r 106a4bfcb866 example/flickrcontactfetcherplugin/flickrcontactfetcherplugin.pkg --- a/example/flickrcontactfetcherplugin/flickrcontactfetcherplugin.pkg Thu Aug 05 16:35:33 2010 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -; flickrcontactfetcherplugin.pkg generated by qmake at 2010-04-29T11:33:57 -; This file is generated by qmake and should not be modified by the user -; - -; Language -&EN - -; SIS header: name, uid, version -#{"flickrcontactfetcherplugin"},(0xE6cb7163),1,0,0 - -; Localised Vendor name -%{"Vendor"} - -; Unique Vendor name -:"Vendor" - -; Manual PKG pre-rules from PRO files -; Default HW/platform dependencies -[0x101F7961],0,0,0,{"S60ProductID"} -[0x102032BE],0,0,0,{"S60ProductID"} -[0x102752AE],0,0,0,{"S60ProductID"} -[0x1028315F],0,0,0,{"S60ProductID"} - -; Default dependency to Qt libraries -(0x2001E61C), 4, 6, 1, {"Qt"} -; Default dependency to QtMobility libraries -(0x2002AC89), 0, 2, 0, {"QtMobility"} - -; DEPLOYMENT -"/S60/devices/S60_5th_Edition_SDK_v0.9/epoc32/release/$(PLATFORM)/$(TARGET)/flickrcontactfetcherplugin.dll" - "!:\sys\bin\flickrcontactfetcherplugin.dll" -"/CarbideWorkspace/svnrepo/example/flickrcontactfetcherplugin/qmakepluginstubs/flickrcontactfetcherplugin.qtplugin" - "!:\resource\qt\plugins\smf\plugin\contact\flickrcontactfetcherplugin.qtplugin" - -; Manual PKG post-rules from PRO files diff -r b78fa4cdbf2b -r 106a4bfcb866 example/flickrcontactfetcherplugin/flickrcontactfetcherplugin.pro --- a/example/flickrcontactfetcherplugin/flickrcontactfetcherplugin.pro Thu Aug 05 16:35:33 2010 +0530 +++ b/example/flickrcontactfetcherplugin/flickrcontactfetcherplugin.pro Thu Aug 05 16:46:37 2010 +0530 @@ -38,7 +38,7 @@ ReadDeviceData \ WriteDeviceData - LIBS += -lsmfclient.dll + LIBS += -lsmfcommon } target.path += $$[QT_INSTALL_PLUGINS]/smf/plugin/contact.fetcher diff -r b78fa4cdbf2b -r 106a4bfcb866 example/flickrcontactfetcherplugin/flickrcontactfetcherplugin_installer.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/flickrcontactfetcherplugin/flickrcontactfetcherplugin_installer.pkg Thu Aug 05 16:46:37 2010 +0530 @@ -0,0 +1,30 @@ +; flickrcontactfetcherplugin_installer.pkg generated by qmake at 2010-07-30T14:11:44 +; This file is generated by qmake and should not be modified by the user +; + +; Language +&EN + +; SIS header: name, uid, version +#{"flickrcontactfetcherplugin installer"},(0xA000D7CE),1,0,0 + +; Localised Vendor name +%{"Vendor"} + +; Unique Vendor name +:"Vendor" + + +; Manual PKG pre-rules from PRO files +; Default HW/platform dependencies +[0x101F7961],0,0,0,{"S60ProductID"} +[0x102032BE],0,0,0,{"S60ProductID"} +[0x102752AE],0,0,0,{"S60ProductID"} +[0x1028315F],0,0,0,{"S60ProductID"} + +; Default dependency to Qt libraries +; Default dependency to QtMobility libraries + + +"D:/smf/MissingCode/smfrepo/example/flickrcontactfetcherplugin/flickrcontactfetcherplugin.sis" - "c:\adm\flickrcontactfetcherplugin.sis" +@"D:/Qt/4.6.2/smartinstaller.sis",(0x2002CCCD) diff -r b78fa4cdbf2b -r 106a4bfcb866 example/flickrcontactfetcherplugin/flickrcontactfetcherplugin_template.pkg --- a/example/flickrcontactfetcherplugin/flickrcontactfetcherplugin_template.pkg Thu Aug 05 16:35:33 2010 +0530 +++ b/example/flickrcontactfetcherplugin/flickrcontactfetcherplugin_template.pkg Thu Aug 05 16:46:37 2010 +0530 @@ -1,13 +1,12 @@ -; flickrcontactfetcherplugin_template.pkg generated by qmake at 2010-06-22T14:10:41 +; flickrcontactfetcherplugin_template.pkg generated by qmake at 2010-07-30T14:11:44 ; This file is generated by qmake and should not be modified by the user ; ; Language &EN - ; SIS header: name, uid, version -#{"flickrcontactfetcherplugin"},(0xE1f540a6),1,0,0 +#{"flickrcontactfetcherplugin"},(0xE5d0d77b),1,0,0 ; Localised Vendor name %{"Vendor"} @@ -17,19 +16,19 @@ ; Manual PKG pre-rules from PRO files -; Default dependency to Qt libraries -(0x2001E61C), 4, 6, 3, {"Qt"} ; Default HW/platform dependencies [0x101F7961],0,0,0,{"S60ProductID"} [0x102032BE],0,0,0,{"S60ProductID"} [0x102752AE],0,0,0,{"S60ProductID"} [0x1028315F],0,0,0,{"S60ProductID"} +; Default dependency to Qt libraries +(0x2001E61C), 4, 6, 2, {"Qt"} ; Default dependency to QtMobility libraries (0x2002AC89), 1, 0, 0, {"QtMobility"} ; DEPLOYMENT -"/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/release/$(PLATFORM)/$(TARGET)/flickrcontactfetcherplugin.dll" - "!:\sys\bin\flickrcontactfetcherplugin.dll" -"/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/data/z/resource/qt/plugins/smf/plugin/contact.fetcher/flickrcontactfetcherplugin.qtplugin" - "!:\resource\qt\plugins\smf\plugin\contact.fetcher\flickrcontactfetcherplugin.qtplugin" +"d:/S60/devices/Nokia_Symbian3_SDK_v0.8/epoc32/release/$(PLATFORM)/$(TARGET)/flickrcontactfetcherplugin.dll" - "!:\sys\bin\flickrcontactfetcherplugin.dll" +"d:/smf/MissingCode/smfrepo/example/flickrcontactfetcherplugin/qmakepluginstubs/flickrcontactfetcherplugin.qtplugin" - "!:\resource\qt\plugins\smf\plugin\contact.fetcher\flickrcontactfetcherplugin.qtplugin" ; Manual PKG post-rules from PRO files diff -r b78fa4cdbf2b -r 106a4bfcb866 example/flickrcontactfetcherplugin/plugin_commonU.def --- a/example/flickrcontactfetcherplugin/plugin_commonU.def Thu Aug 05 16:35:33 2010 +0530 +++ b/example/flickrcontactfetcherplugin/plugin_commonU.def Thu Aug 05 16:46:37 2010 +0530 @@ -1,5 +1,5 @@ ; ============================================================================== -; Generated by qmake (2.01a) (Qt 4.6.3) on: 2010-06-22T14:10:41 +; Generated by qmake (2.01a) (Qt 4.6.2) on: 2010-07-30T14:11:44 ; This file is generated by qmake and should not be modified by the ; user. ; Name : plugin_commonU.def diff -r b78fa4cdbf2b -r 106a4bfcb866 example/flickrcontactfetcherplugin/qmakepluginstubs/flickrcontactfetcherplugin.qtplugin --- a/example/flickrcontactfetcherplugin/qmakepluginstubs/flickrcontactfetcherplugin.qtplugin Thu Aug 05 16:35:33 2010 +0530 +++ b/example/flickrcontactfetcherplugin/qmakepluginstubs/flickrcontactfetcherplugin.qtplugin Thu Aug 05 16:46:37 2010 +0530 @@ -1,1 +1,1 @@ -This file is a Qt plugin stub file. The real Qt plugin is located in /sys/bin. Created:2010-06-22T14:10:41 +This file is a Qt plugin stub file. The real Qt plugin is located in \sys\bin. Created:2010-07-30T14:11:44 diff -r b78fa4cdbf2b -r 106a4bfcb866 example/flickrgalleryplugin/flickrgalleryplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/flickrgalleryplugin/flickrgalleryplugin.cpp Thu Aug 05 16:46:37 2010 +0530 @@ -0,0 +1,1396 @@ +/** + * Copyright (c) 2010 Sasken Communication Technologies Ltd. + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of the "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html" + * + * Initial Contributors: + * Chandradeep Gandhi, Sasken Communication Technologies Ltd - Initial contribution + * + * Contributors: + * Sangeetha Prasad, Nalina Hariharan + * + * Description: + * The Plugin that fetches gallery related items from the logged in user's flickr account + * + */ + +// Include files +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "flickrgalleryplugin.h" + +static int count = 1; +static int chance = 0; // 0 = for pics from album, 1 = pics not in any album +static int listIndex = 0;// For Mutliple Load +QByteArray payload; +QByteArray boundary("---ThIsIsAsAmPleBouNDaRyStrInGFrOmNaliNa---"); + +// Todo:- Macro added for limiting items fetched to recent 5 +// Remove after demo +#define SETLIMITOFFIVEFORSMFDEMO 1 + +/** + * Method to interpret the key sets obtained from credential manager + * @param aApiKey [out] The api key + * @param aApiSecret [out] The api secret + * @param aAuthToken [out] The auth token provided by Flickr + */ +void FlickrGalleryPlugin::fetchKeys( QString &aApiKey, + QString &aApiSecret, + QString &aAuthToken ) + { + qDebug()<<"Inside FlickrGalleryPlugin::fetchKeys()"; + + qDebug()<<"Reg Token = "<m_smfRegToken; + qDebug()<<"Expiry Date as int = "<m_validity.toTime_t(); + + SmfAuthParams keys; + SmfPluginUtil util; + util.getAuthKeys(keys, m_provider->m_smfRegToken, + m_provider->m_validity, m_provider->m_pluginId); + + qDebug()<<"Number of key-value pairs = "<value("Guid").value().guid(); + qDebug()<<"Flickr user's ID for fetching photos = "< &aImages, + const SmfPictureAlbum* aAlbum ) + { + SmfPluginError error = SmfPluginErrUserNotLoggedIn; + qDebug()<<("\r\n multiple Uploaded Pictures.....= "+QString::number(aImages.count(),10)); + Q_UNUSED(aAlbum) + // Get the key sets from SMF Plugin Utility class. + QString apiKey; + QString apiSecret; + QString authToken; + fetchKeys(apiKey, apiSecret, authToken ); + + count =aImages.count(); + + + QByteArray boundary("---ThIsIsAsAmPleBouNDaRyStrInGFrOmSaNgEeTa---"); + QDataStream stream(&payload, QIODevice::WriteOnly); + int bytes = 0; + + // Create the api_key field + QByteArray keyField = constructField("api_key",apiKey,boundary,"");//,apiKey,boundary); + bytes = stream.writeRawData(keyField.data(), keyField.length()); + qDebug()<<("Bytes written for API key field = "+QString::number(bytes, 10)); + + // Create the auth_token field + QByteArray tokenField = constructField ( "auth_token", authToken, boundary,""); + bytes = stream.writeRawData(tokenField.data(), tokenField.length()); + qDebug()<<("Bytes written for Auth token field = "+QString::number(bytes, 10)); + + //Create the API signature string + QString baseString; + baseString.append(apiSecret); + baseString.append("api_key"+apiKey); + baseString.append("auth_token"+authToken); + //baseString.append("formatjson"); //not working this format + baseString = generateSignature(baseString); + + //extract the smfpicture object + SmfPicture aImage=aImages[listIndex]; + + //Create the signature field + QByteArray sigField = constructField ("api_sig", baseString, boundary,"" ); + bytes = stream.writeRawData(sigField.data(), sigField.length()); + + qDebug()<<("QImage String = "+aImage.url().toString()); + + //Create the file header field + QByteArray fileField = constructField ( "photo", "", boundary, aImage.url().toString()); + bytes = stream.writeRawData(fileField.data(), fileField.length()); + + + //QByteArray pic ; + QImage image=aImage.picture(); + + //for checking only + int byte=image.numBytes(); + qDebug()<<("Bytes written for QImage = "+QString::number(byte,10)); + + //For finding the format of Image file (eg. c:\\data\\image.jpg); + QString fileName=aImage.url().toString(); + int last = fileName.lastIndexOf(".",-1); + qDebug()<<("last QImage = "+QString::number(last,10)); + QString Format=fileName.right(fileName.size()-last-1); //-1 for removing "." from .jpg + qDebug()<<("Format of QImage = "+Format); + + + QByteArray pic; + QBuffer buffer(&pic); + buffer.open(QIODevice::WriteOnly); + image.save(&buffer,Format.toLatin1(),-1); // writes image into format given by Format + + qDebug()<<("Number of bytes in the picture = "+QString::number(buffer.size(), 10)); + + // Add the file content to the stream + if (pic.size()) + { + bytes = stream.writeRawData ( pic.data(), pic.length() ); + qDebug()<<("Bytes written for File content field = "+QString::number(bytes, 10)); + } + qDebug()<<("Before Url string is : "+QString(payload)); + + // Create the end field + QByteArray endField; + endField.append ( "\r\n--" ); + endField.append ( boundary ); + endField.append ( "--\r\n\r\n" ); + bytes = stream.writeRawData(endField.data(), endField.length()); + qDebug()<<("Bytes written for end field = "+QString::number(bytes, 10)); + + //Create the url + QUrl url("http://api.flickr.com/services/upload/"); + //url.addQueryItem("format","json"); //Not working + + + //Create the request, set the url + aRequest.iNetworkRequest.setUrl(url); + + aRequest.iNetworkRequest.setRawHeader("Content-Type", "multipart/form-data; boundary="+boundary); + aRequest.iNetworkRequest.setRawHeader("Host", "api.flickr.com"); + aRequest.iRequestType = SmfPictureUpload; + aRequest.iPostData=new QBuffer(&payload); + + + aRequest.iHttpOperationType = QNetworkAccessManager::PostOperation; + error = SmfPluginErrNone; + return error; + } + + /** + * Method to post comment on a picture is available + * @param aRequest [out] The request data to be sent to network + * @param aImage The image on which comment is to be posted + * @param aComment The comment to be posted + * @return SmfPluginError Plugin error if any, else SmfPluginErrNone + */ +SmfPluginError FlickrGalleryPlugin::postComment( SmfPluginRequestData &aRequest, + const SmfPicture &aImage, + const SmfComment &aComment ) + { + qDebug()<<"Inside FlickrGalleryPlugin::postComment()"; + + SmfPluginError error = SmfPluginErrInvalidArguments; + + if( 0 == aImage.id().size() || (0 == aComment.text().size()) ) + { + qDebug()<<"Invalid arguments"; + return error; + } + + // Get the key sets from SMF Plugin Utility class. + QString apiKey; + QString apiSecret; + QString authToken; + fetchKeys(apiKey, apiSecret, authToken ); + + // Create the API signature string + QString baseString; + baseString.append(apiSecret); + baseString.append("api_key"+apiKey); + baseString.append("auth_token"+authToken); + baseString.append("comment_text"+aComment.text()); + baseString.append("formatjson"); + baseString.append("methodflickr.photos.comments.addComment"); + baseString.append("photo_id"+aImage.id()); + + // Create the url + QUrl url("http://api.flickr.com/services/rest/?"); + url.addQueryItem("api_key", apiKey); + url.addQueryItem("auth_token", authToken); + url.addQueryItem("comment_text", aComment.text()); + url.addQueryItem("format","json"); + url.addQueryItem("method", "flickr.photos.comments.addComment"); + url.addQueryItem("photo_id",aImage.id()); + url.addQueryItem("api_sig", generateSignature(baseString)); + + // Create the request, set the url + aRequest.iNetworkRequest.setUrl(url); + aRequest.iRequestType = SmfPicturePostComment; + aRequest.iPostData = NULL; + aRequest.iHttpOperationType = QNetworkAccessManager::GetOperation; + error = SmfPluginErrNone; + + qDebug()<<"Url string is : "<initialize(); + } + +/** + * Method to get the provider information + * @return Instance of SmfProviderBase + */ +SmfProviderBase* FlickrGalleryPlugin::getProviderInfo( ) + { + return m_provider; + } + +/** + * Method to get the result for a network request. + * @param aOperation The type of operation to be requested + * @param aTransportResult The result of transport operation + * @param aResponse The QByteArray instance containing the network response. + * The plugins should delete this instance once they have read the + * data from it. + * @param aResult [out] An output parameter to the plugin manager.If the + * return value is SmfSendRequestAgain, QVariant will be of type + * SmfPluginRequestData. + * For SmfGalleryPlugin: If last operation was albums, aResult will be of + * type QList. If the last operation was pictures(), aResult + * will be of type QList. If last operation was description(), + * aResult will be of type QString. If last operation was upload() or + * postComment(), aResult will be of type bool. + * @param aRetType [out] SmfPluginRetType + * @param aPageResult [out] The SmfResultPage structure variable + */ +SmfPluginError FlickrGalleryPlugin::responseAvailable( + const SmfRequestTypeID aOperation, + const SmfTransportResult &aTransportResult, + QByteArray *aResponse, + QVariant* aResult, + SmfPluginRetType &aRetType, + SmfResultPage &aPageResult ) + { + + qDebug()<<"Inside FlickrGalleryPlugin::responseAvailable()"; + Q_UNUSED(aPageResult) + SmfPluginError error = SmfPluginErrNetworkError; + + if( !aResponse || (0 == aResponse->size()) ) + { + qDebug()<<"Response is NULL or empty"; + aRetType = SmfRequestError; + return error; + } + + QByteArray response(*aResponse); + delete aResponse; + + QFile respFile("c://data//SmfPluginFlickrResponse.txt"); + if(!respFile.open(QIODevice::WriteOnly)) + { + qDebug()<<"File to write the response could not be opened, so writing to this file"; + qDebug()<<"Flickr response = "< albumList; + QString errStr; + errStr.clear(); + + // Remove the "jsonFlickrApi(" from starting of the response and ")" from its end + response.remove(0, 14); + response.chop(1); + + bool ok; + SmfPluginUtil util; + QVariantMap result = util.parse(response, &ok).toMap(); + if (!ok) + { + qDebug()<<"An error occurred during json parsing"; + aRetType = SmfRequestError; + return SmfPluginErrParsingFailed; + } + + + if(response.contains(QByteArray("fail"))) + { + errStr.append(result["message"].toString()); + } + else + { + QVariantMap map1 = result["photosets"].toMap(); + + QList list1 = map1["photoset"].toList(); + QListIterator iter(list1); + while(iter.hasNext()) + { + SmfPictureAlbum album; + + QVariantMap map2 = iter.next().toMap(); + + // Set the album's title + QVariantMap map3 = map2["title"].toMap(); + album.setTitle(map3["_content"].toString()); + qDebug()<<"title = "< picList; + QString errStr; + errStr.clear(); + + // Remove the "jsonFlickrApi(" from starting of the response and ")" from its end + response.remove(0, 14); + response.chop(1); + + bool ok; + SmfPluginUtil util; + QVariantMap result = util.parse(response, &ok).toMap(); + if (!ok) + { + qDebug()<<"An error occurred during json parsing"; + aRetType = SmfRequestError; + return SmfPluginErrParsingFailed; + } + + + if(response.contains(QByteArray("fail"))) + { + errStr.append(result["message"].toString()); + } + else + { + QVariantMap map1; + if(0 == chance) + map1 = result["photoset"].toMap(); + else + map1 = result["photos"].toMap(); + + QList list1 = map1["photo"].toList(); + QListIterator iter(list1); + while(iter.hasNext()) + { + SmfPicture pic; + + QVariantMap map2 = iter.next().toMap(); + + // Set the pic's id + pic.setId(map2["id"].toString()); + + // Set the pic's description + QVariantMap map3 = map2["description"].toMap(); + pic.setDescription(map3["_content"].toString()); + + // Set the pic's title + pic.setTitle(map2["title"].toString()); + qDebug()<<"title = "<setValue(uploaded); + aRetType = SmfRequestComplete; + error = SmfPluginErrNone; + } +#endif + } + else if (SmfPicturePostComment == aOperation) + { + qDebug()<<"Response for adding comment on a photo"; + + bool commentPosted = false; + QString errStr; + errStr.clear(); + + // Remove the "jsonFlickrApi(" from starting of the response and ")" from its end + response.remove(0, 14); + response.chop(1); + + bool ok; + SmfPluginUtil util; + QVariantMap result = util.parse(response, &ok).toMap(); + if (!ok) + { + qDebug()<<"An error occurred during json parsing"; + aRetType = SmfRequestError; + return SmfPluginErrParsingFailed; + } + + if(response.contains(QByteArray("fail"))) + { + errStr.append(result["message"].toString()); + } + else + { + qDebug()<<"Comment posted on the photo"; + commentPosted = true; + } + + if(errStr.size()) + { + qDebug()<<"Response error found = "<setValue(errStr); + } + else + { + qDebug()<<"comment posted ? "<setValue(commentPosted); + aRetType = SmfRequestComplete; + error = SmfPluginErrNone; + } + } + else + { + qDebug()<<"Service unsupported, currently only SmfContactRetrievePosts and SmfContactPostDirected!!!"; + aRetType = SmfRequestError; + error = SmfPluginErrServiceNotSupported; + } + } + + else if(SmfTransportOpOperationCanceledError == aTransportResult) + { + qDebug()<<"Operation Cancelled !!!"; + error = SmfPluginErrCancelComplete; + aRetType = SmfRequestComplete; + } + + else + { + qDebug()<<"Transport Error !!!"; + error = SmfPluginErrNetworkError; + aRetType = SmfRequestError; + } + + return error; + + + + + + + + + + + + + + + + + +#if 0 + qDebug()<<("FlickrGalleryPlugin::responseAvailable"); + Q_UNUSED(aPageResult) + SmfPluginError error = SmfPluginErrNetworkError; + + if( !aResponse || (0 == aResponse->size()) ) + { + qDebug()<<("Response is NULL or empty"); + aRetType = SmfRequestError; + return error; + } + + QByteArray response(*aResponse); + delete aResponse; + + //Write the response to a file + QFile file("c:\\data\\flickrresponse.txt"); + qDebug()<<("response data written to c:\\data\\flickrresponse.txt"); + + if (!file.open(QIODevice::Append | QIODevice::Text)); + file.write(response); + file.close(); + + qDebug()<<("Gallery response size = "+QString::number(response.size(), 10)); + + QList list; + + if(SmfTransportOpNoError == aTransportResult) + { + qDebug()<<("No transport error"); + QVariantMap map1; + bool resType=response.startsWith("setValue(result); + aRetType = SmfRequestComplete; + error = SmfPluginErrNone; + + } + else if (SmfPictureMultiUpload == aOperation) + { + bool result; + qDebug()<<("SmfPictureUpload"); + QXmlStreamReader xml(response); + while (!xml.atEnd()) + { + xml.readNext(); + if (xml.tokenType() == QXmlStreamReader::StartElement) + { + qDebug()<<("inside tag"); + //If the tag is contact + if (xml.name() == "photoid") + { + qDebug()<<("photoid tag found"); + result=TRUE; + } + else + result=FALSE; + }//end If + }//endWhile; + + aResult->setValue(result); + if (listIndex < count) + { + + listIndex=listIndex+1; + error = SmfPluginErrNone; + aRetType = SmfSendRequestAgain; + + + } + else + { + //Final result sent + count=1; //clear counter + aRetType = SmfRequestComplete; + error = SmfPluginErrNone; + } + + } + else + { + qDebug()<<("Service unsupported!!!"); + aRetType = SmfRequestError; + error = SmfPluginErrServiceNotSupported; + } + }//end if of if(SmfTransportOpNoError == aTransportResult) + + else if(SmfTransportOpOperationCanceledError == aTransportResult) + { + qDebug()<<("Operation Cancelled !!!"); + error = SmfPluginErrCancelComplete; + aRetType = SmfRequestComplete; + } + + else + { + qDebug()<<("Transport Error !!!"); + error = SmfPluginErrNetworkError; + aRetType = SmfRequestError; + } + return error; +#endif + + } + + +/** + * Destructor + */ +FlickrProviderBase::~FlickrProviderBase( ) + { + } + +/** + * Method to get the Localisable name of the service. + * @return The Localisable name of the service. + */ +QString FlickrProviderBase::serviceName( ) const + { + return m_serviceName; + } + +/** + * Method to get the Logo of the service + * @return The Logo of the service + */ +QImage FlickrProviderBase::serviceIcon( ) const + { + return m_serviceIcon; + } + +/** + * Method to get the Readable service description + * @return The Readable service description + */ +QString FlickrProviderBase::description( ) const + { + return m_description; + } + +/** + * Method to get the Website of the service + * @return The Website of the service + */ +QUrl FlickrProviderBase::serviceUrl( ) const + { + return m_serviceUrl; + } + +/** + * Method to get the URL of the Application providing this service + * @return The URL of the Application providing this service + */ +QUrl FlickrProviderBase::applicationUrl( ) const + { + return m_applicationUrl; + } + +/** + * Method to get the Icon of the application + * @return The Icon of the application + */ +QImage FlickrProviderBase::applicationIcon( ) const + { + return m_applicationIcon; + } + +/** +* Method to get the list of interfaces that this provider support +* @return List of supported Interafces +*/ +QList FlickrProviderBase::supportedInterfaces( ) const + { + return m_supportedInterfaces; + } + +/** +* Method to get the list of languages supported by this service provider +* @return a QStringList of languages supported by this service +* provider in 2 letter ISO 639-1 format. +*/ +QStringList FlickrProviderBase::supportedLanguages( ) const + { + return m_supportedLangs; + } + +/** + * Method to get the Plugin specific ID + * @return The Plugin specific ID + */ +QString FlickrProviderBase::pluginId( ) const + { + return m_pluginId; + } + +/** + * Method to get the ID of the authentication application + * for this service + * @param aProgram The authentication application name + * @param aArguments List of arguments required for authentication app + * @param aMode Strting mode for authentication application + * @return The ID of the authentication application + */ +QString FlickrProviderBase::authenticationApp( QString &aProgram, + QStringList & aArguments, + QIODevice::OpenModeFlag aMode ) const + { + Q_UNUSED(aProgram) + Q_UNUSED(aArguments) + Q_UNUSED(aMode) + return m_authAppId; + } + +/** + * Method to get the unique registration ID provided by the + * Smf for authorised plugins + * @return The unique registration ID/token provided by the Smf for + * authorised plugins + */ +QString FlickrProviderBase::smfRegistrationId( ) const + { + return m_smfRegToken; + } + +void FlickrProviderBase::initialize() + { + m_serviceName = "Flickr"; + m_description = "Flickr gallery plugin description"; + m_serviceUrl = QUrl(QString("http://api.flickr.com")); + m_pluginId = "flickrgalleryplugin.qtplugin"; + m_authAppId = "0xE1D8C7D7"; + m_supportedInterfaces.append("org.symbian.smf.plugin.gallery/v0.2"); + QSettings iSettings; + m_smfRegToken = iSettings.value("CMFlickrRegToken").toString(); + m_validity = iSettings.value("FlckrExpiryTime").toDateTime(); + } + + +/* + * Export Macro + * plugin name : flickrGalleryplugin + * plugin class : FlickrGalleryPlugin + */ +Q_EXPORT_PLUGIN2( flickrgalleryplugin, FlickrGalleryPlugin ) diff -r b78fa4cdbf2b -r 106a4bfcb866 example/flickrgalleryplugin/flickrgalleryplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/flickrgalleryplugin/flickrgalleryplugin.h Thu Aug 05 16:46:37 2010 +0530 @@ -0,0 +1,313 @@ +/** + * Copyright (c) 2010 Sasken Communication Technologies Ltd. + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of the "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html" + * + * Initial Contributors: + * Chandradeep Gandhi, Sasken Communication Technologies Ltd - Initial contribution + * + * Contributors: + * Sangeetha Prasad, Nalina Hariharan + * + * Description: + * The Plugin that fetches gallery related items from the logged in user's flickr account + * + */ + +#ifndef FLICKRGALLERYPLUGIN_H_ +#define FLICKRGALLERYPLUGIN_H_ + +// Include files +#include +#include +#include + +// Forward declarations +class FlickrProviderBase; +class QVariant; + + +/** + * The Plugin that fetches gallery related items from the logged + * in user's flickr account + */ +class FlickrGalleryPlugin : public QObject, public SmfGalleryPlugin +{ + Q_OBJECT + Q_INTERFACES( SmfGalleryPlugin SmfPluginBase ) + +public: + /** + * Destructor + */ + virtual ~FlickrGalleryPlugin(); + +public: // From FlickrGalleryPlugin + + /** + * Method to get a list of albums + * @param aRequest [out] The request data to be sent to network + * @param aNames The subject or any keywords to be used to filter albums with that name + * @param aUser The user whose albums are requested + * @param aPageNum The page to be extracted + * @param aItemsPerPage Number of items per page + * @return SmfPluginError Plugin error if any, else SmfPluginErrNone + */ + SmfPluginError albums( SmfPluginRequestData &aRequest, + const QStringList &aNames, + const SmfContact *aUser, + const int aPageNum = SMF_FIRST_PAGE, + const int aItemsPerPage = SMF_ITEMS_PER_PAGE ); + + /** + * Method to get a list of pictures + * @param aRequest [out] The request data to be sent to network + * @param aAlbums The album(s) whose pictures are being requested + * @param aPageNum The page to be extracted + * @param aItemsPerPage Number of items per page + * @return SmfPluginError Plugin error if any, else SmfPluginErrNone + */ + SmfPluginError pictures( SmfPluginRequestData &aRequest, + const SmfPictureAlbumList &aAlbums, + const int aPageNum = SMF_FIRST_PAGE, + const int aItemsPerPage = SMF_ITEMS_PER_PAGE ); + + /** + * Method to get a description + * @param aRequest [out] The request data to be sent to network + * @param aImage The image abot which the description is required + * @return SmfPluginError Plugin error if any, else SmfPluginErrNone + */ + SmfPluginError description( SmfPluginRequestData &aRequest, + const SmfPicture &aImage ); + + /** + * Method to upload a picture + * @param aRequest [out] The request data to be sent to network + * @param aImage The image to be uploaded + * @param aAlbum the optional destination album name + * @return SmfPluginError Plugin error if any, else SmfPluginErrNone + */ + SmfPluginError upload( SmfPluginRequestData &aRequest, + const SmfPicture &aImage, + const SmfPictureAlbum* aAlbum = NULL ); + + + /** + * Method to upload a list of pictures + * @param aRequest [out] The request data to be sent to network + * @param aImages The list of images to be uploaded + * @param aAlbum the optional destination album name + * @return SmfPluginError Plugin error if any, else SmfPluginErrNone + */ + SmfPluginError upload( SmfPluginRequestData &aRequest, + const QList &aImages, + const SmfPictureAlbum* aAlbum = NULL ); + + /** + * Method to post comment on a picture is available + * @param aRequest [out] The request data to be sent to network + * @param aImage The image on which comment is to be posted + * @param aComment The comment to be posted + * @return SmfPluginError Plugin error if any, else SmfPluginErrNone + */ + SmfPluginError postComment( SmfPluginRequestData &aRequest, + const SmfPicture &aImage, + const SmfComment &aComment ); + + + /** + * Customised method for SMFGalleryPlugin interface + * @param aRequest [out] The request data to be sent to network + * @param aOperation The operation type (should be known between + * the client interface and the plugin) + * @param aData The data required to form the request (The type + * of data should be known between client and the plugin) + * @return SmfPluginError Plugin error if any, else SmfPluginErrNone + */ + SmfPluginError customRequest( SmfPluginRequestData &aRequest, + const int &aOperation, + QByteArray *aData ); + +public: // From SmfPluginBase + /** + * The first method to be called in the plugin that implements this interface. + * If this method is not called, plugin may not behave as expected. + */ + void initialize( ); + + /** + * Method to get the provider information + * @return Instance of SmfProviderBase + */ + SmfProviderBase* getProviderInfo( ); + + /** + * Method to get the result for a network request. + * @param aOperation The type of operation to be requested + * @param aTransportResult The result of transport operation + * @param aResponse The QByteArray instance containing the network response. + * The plugins should delete this instance once they have read the + * data from it. + * @param aResult [out] An output parameter to the plugin manager.If the + * return value is SmfSendRequestAgain, QVariant will be of type + * SmfPluginRequestData. + * For SmfGalleryPlugin: If last operation was albums, aResult will be of + * type QList. If the last operation was pictures(), aResult + * will be of type QList. If last operation was description(), + * aResult will be of type QString. If last operation was upload() or + * postComment(), aResult will be of type bool. + * @param aRetType [out] SmfPluginRetType + * @param aPageResult [out] The SmfResultPage structure variable + */ + SmfPluginError responseAvailable( + const SmfRequestTypeID aOperation, + const SmfTransportResult &aTransportResult, + QByteArray *aResponse, + QVariant* aResult, + SmfPluginRetType &aRetType, + SmfResultPage &aPageResult ); + + /** + * Method to construct individual fields for photo upload + * @param aName The name argument + * @param aContent The content of this field + * @param aBoundary The boundary string (need to be unique in the payload data) + * @param aFilename The filename if for photo field + * @return The field data constructed by this method + */ + QByteArray constructField( const QString &aName, + const QString &aContent, + const QByteArray &aBoundary, + const QString &aFilename = QString() ); + +private: + /** + * Method called by plugins to generate a signature string from a base string + * @param aBaseString The base string + * @return The md5 hash of the base string + */ + QString generateSignature( const QString aBaseString ); + + /** + * Method to interpret the key sets obtained from credential manager + * @param aApiKey [out] The api key + * @param aApiSecret [out] The api secret + * @param aAuthToken [out] The auth token provided by Flickr + */ + void fetchKeys( QString &aApiKey, + QString &aApiSecret, + QString &aAuthToken ); + +private: + FlickrProviderBase *m_provider; + + }; + +/** + * The Plugin class that implements SmfProviderBase for this flickr plugin + */ +class FlickrProviderBase : public QObject, public SmfProviderBase + { + Q_OBJECT + Q_INTERFACES( SmfProviderBase ) + +public: + virtual ~FlickrProviderBase( ); + + /** + * Method to get the Localisable name of the service. + * @return The Localisable name of the service. + */ + QString serviceName( ) const; + + /** + * Method to get the Logo of the service + * @return The Logo of the service + */ + QImage serviceIcon( ) const; + + /** + * Method to get the Readable service description + * @return The Readable service description + */ + QString description( ) const; + + /** + * Method to get the Website of the service + * @return The Website of the service + */ + QUrl serviceUrl( ) const; + + /** + * Method to get the URL of the Application providing this service + * @return The URL of the Application providing this service + */ + QUrl applicationUrl( ) const; + + /** + * Method to get the Icon of the application + * @return The Icon of the application + */ + QImage applicationIcon( ) const; + + /** + * Method to get the list of interfaces that this provider support + * @return List of supported Interafces + */ + QList supportedInterfaces( ) const; + + /** + * Method to get the list of languages supported by this service provider + * @return a QStringList of languages supported by this service + * provider in 2 letter ISO 639-1 format. + */ + QStringList supportedLanguages( ) const; + + /** + * Method to get the Plugin specific ID + * @return The Plugin specific ID + */ + QString pluginId( ) const; + + /** + * Method to get the ID of the authentication application + * for this service + * @param aProgram The authentication application name + * @param aArguments List of arguments required for authentication app + * @param aMode Strting mode for authentication application + * @return The ID of the authentication application + */ + QString authenticationApp( QString &aProgram, QStringList & aArguments, + QIODevice::OpenModeFlag aMode = QIODevice::ReadWrite ) const; + + /** + * Method to get the unique registration ID provided by the + * Smf for authorised plugins + * @return The unique registration ID/token provided by the Smf for + * authorised plugins + */ + QString smfRegistrationId( ) const; + +private: + friend class FlickrGalleryPlugin; + void initialize(); + QString m_serviceName; + QImage m_serviceIcon; + QString m_description; + QUrl m_serviceUrl; + QUrl m_applicationUrl; + QImage m_applicationIcon; + QString m_pluginId; + QString m_authAppId; + QString m_smfRegToken; + QList m_supportedInterfaces; + QStringList m_supportedLangs; + QDateTime m_validity; + }; + + +#endif /* FLICKRGALLERYPLUGIN_H_ */ diff -r b78fa4cdbf2b -r 106a4bfcb866 example/flickrgalleryplugin/flickrgalleryplugin.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/flickrgalleryplugin/flickrgalleryplugin.pro Thu Aug 05 16:46:37 2010 +0530 @@ -0,0 +1,44 @@ +TEMPLATE = lib + +CONFIG += plugin \ + mobility + +MOBILITY += contacts\ + location + +QT += core \ + xml \ + network + +HEADERS = flickrgalleryplugin.h + +SOURCES = flickrgalleryplugin.cpp + +TARGET = $$qtLibraryTarget(flickrgalleryplugin) + +symbian: { + # Load predefined include paths (e.g. QT_PLUGINS_BASE_DIR) to be used in the pro-files + load(data_caging_paths) + + # EPOCALLOWDLLDATA have to set true because Qt macros has initialised global data + TARGET.EPOCALLOWDLLDATA = 1 + + # Defines plugin files into Symbian .pkg package + pluginDep.sources = flickrgalleryplugin.dll + pluginDep.path = $$QT_PLUGINS_BASE_DIR/smf/plugin/gallery + DEPLOYMENT += pluginDep + + TARGET.CAPABILITY = NetworkServices \ + ReadUserData \ + WriteUserData \ + LocalServices \ + UserEnvironment \ + ReadDeviceData \ + WriteDeviceData + + LIBS += -lsmfcommon +} + +target.path += $$[QT_INSTALL_PLUGINS]/smf/plugin/gallery + +INSTALLS += target \ No newline at end of file diff -r b78fa4cdbf2b -r 106a4bfcb866 example/flickrgalleryplugin/flickrgalleryplugin_installer.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/flickrgalleryplugin/flickrgalleryplugin_installer.pkg Thu Aug 05 16:46:37 2010 +0530 @@ -0,0 +1,30 @@ +; flickrgalleryplugin_installer.pkg generated by qmake at 2010-07-30T14:11:44 +; This file is generated by qmake and should not be modified by the user +; + +; Language +&EN + +; SIS header: name, uid, version +#{"flickrgalleryplugin installer"},(0xA000D7CE),1,0,0 + +; Localised Vendor name +%{"Vendor"} + +; Unique Vendor name +:"Vendor" + + +; Manual PKG pre-rules from PRO files +; Default HW/platform dependencies +[0x101F7961],0,0,0,{"S60ProductID"} +[0x102032BE],0,0,0,{"S60ProductID"} +[0x102752AE],0,0,0,{"S60ProductID"} +[0x1028315F],0,0,0,{"S60ProductID"} + +; Default dependency to Qt libraries +; Default dependency to QtMobility libraries + + +"D:/smf/MissingCode/smfrepo/example/flickrgalleryplugin/flickrgalleryplugin.sis" - "c:\adm\flickrgalleryplugin.sis" +@"D:/Qt/4.6.2/smartinstaller.sis",(0x2002CCCD) diff -r b78fa4cdbf2b -r 106a4bfcb866 example/flickrgalleryplugin/flickrgalleryplugin_template.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/flickrgalleryplugin/flickrgalleryplugin_template.pkg Thu Aug 05 16:46:37 2010 +0530 @@ -0,0 +1,34 @@ +; flickrgalleryplugin_template.pkg generated by qmake at 2010-07-30T14:11:44 +; This file is generated by qmake and should not be modified by the user +; + +; Language +&EN + +; SIS header: name, uid, version +#{"flickrgalleryplugin"},(0xE758f47c),1,0,0 + +; Localised Vendor name +%{"Vendor"} + +; Unique Vendor name +:"Vendor" + + +; Manual PKG pre-rules from PRO files +; Default HW/platform dependencies +[0x101F7961],0,0,0,{"S60ProductID"} +[0x102032BE],0,0,0,{"S60ProductID"} +[0x102752AE],0,0,0,{"S60ProductID"} +[0x1028315F],0,0,0,{"S60ProductID"} + +; Default dependency to Qt libraries +(0x2001E61C), 4, 6, 2, {"Qt"} +; Default dependency to QtMobility libraries +(0x2002AC89), 1, 0, 0, {"QtMobility"} + +; DEPLOYMENT +"d:/S60/devices/Nokia_Symbian3_SDK_v0.8/epoc32/release/$(PLATFORM)/$(TARGET)/flickrgalleryplugin.dll" - "!:\sys\bin\flickrgalleryplugin.dll" +"d:/smf/MissingCode/smfrepo/example/flickrgalleryplugin/qmakepluginstubs/flickrgalleryplugin.qtplugin" - "!:\resource\qt\plugins\smf\plugin\gallery\flickrgalleryplugin.qtplugin" + +; Manual PKG post-rules from PRO files diff -r b78fa4cdbf2b -r 106a4bfcb866 example/flickrgalleryplugin/plugin_commonU.def --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/flickrgalleryplugin/plugin_commonU.def Thu Aug 05 16:46:37 2010 +0530 @@ -0,0 +1,16 @@ +; ============================================================================== +; Generated by qmake (2.01a) (Qt 4.6.2) on: 2010-07-30T14:11:44 +; This file is generated by qmake and should not be modified by the +; user. +; Name : plugin_commonU.def +; Part of : flickrgalleryplugin +; Description : Fixes common plugin symbols to known ordinals +; Version : +; +; ============================================================================== + + +EXPORTS + qt_plugin_query_verification_data @ 1 NONAME + qt_plugin_instance @ 2 NONAME + diff -r b78fa4cdbf2b -r 106a4bfcb866 example/flickrgalleryplugin/qmakepluginstubs/flickrgalleryplugin.qtplugin --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/flickrgalleryplugin/qmakepluginstubs/flickrgalleryplugin.qtplugin Thu Aug 05 16:46:37 2010 +0530 @@ -0,0 +1,1 @@ +This file is a Qt plugin stub file. The real Qt plugin is located in \sys\bin. Created:2010-07-30T14:11:44 diff -r b78fa4cdbf2b -r 106a4bfcb866 example/smfclientapp/ABLD.BAT --- a/example/smfclientapp/ABLD.BAT Thu Aug 05 16:35:33 2010 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -@ECHO OFF - -REM Bldmake-generated batch file - ABLD.BAT -REM ** DO NOT EDIT ** - -perl -S ABLD.PL "\CarbideWorkspace\smfserver_cleaned\example\smfclientapp\\" %1 %2 %3 %4 %5 %6 %7 %8 %9 -if errorlevel==1 goto CheckPerl -goto End - -:CheckPerl -perl -v >NUL -if errorlevel==1 echo Is Perl, version 5.003_07 or later, installed? -goto End - -:End diff -r b78fa4cdbf2b -r 106a4bfcb866 example/smfclientapp/Makefile --- a/example/smfclientapp/Makefile Thu Aug 05 16:35:33 2010 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,275 +0,0 @@ -# ============================================================================== -# Generated by qmake (2.01a) (Qt 4.6.3) on: Tue Jun 22 14:45:30 2010 -# This file is generated by qmake and should not be modified by the -# user. -# Name : Makefile -# Description : Wrapper Makefile for calling Symbian build tools -# -# ============================================================================== - - -MAKEFILE = Makefile -QMAKE = f:\Qt\4.6.3\bin\qmake -DEL_FILE = del -DEL_DIR = rmdir -MOVE = move -CHK_DIR_EXISTS = if not exist -MKDIR = mkdir -XCOPY = xcopy /d /f /h /r /y /i -ABLD = ABLD.BAT -DEBUG_PLATFORMS = winscw gcce armv5 armv6 -RELEASE_PLATFORMS = gcce armv5 armv6 -MAKE = make - -ifeq (WINS,$(findstring WINS, $(PLATFORM))) -ZDIR=$(EPOCROOT)epoc32\release\$(PLATFORM)\$(CFG)\Z -else -ZDIR=$(EPOCROOT)epoc32\data\z -endif - -DEFINES = -DSYMBIAN -DUNICODE -DQT_KEYPAD_NAVIGATION -DQT_SOFTKEYS_ENABLED -DQT_USE_MATH_H_FLOATS -DWRITE_LOG -DQT_WEBKIT_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -INCPATH = -I"F:/Qt/4.6.3/include/QtCore" -I"F:/Qt/4.6.3/include/QtCore/tmp" -I"F:/Qt/4.6.3/include/QtNetwork" -I"F:/Qt/4.6.3/include/QtNetwork/tmp" -I"F:/Qt/4.6.3/include/QtGui" -I"F:/Qt/4.6.3/include/QtGui/tmp" -I"F:/Qt/4.6.3/include/QtWebKit" -I"F:/Qt/4.6.3/include/QtWebKit/tmp" -I"F:/Qt/4.6.3/include" -I"F:/Qt/4.6.3/include/tmp" -I"F:/Qt/4.6.3/include/QtContacts" -I"F:/Qt/4.6.3/include/QtContacts/tmp" -I"F:/Qt/4.6.3/include/QtLocation" -I"F:/Qt/4.6.3/include/QtLocation/tmp" -I"F:/Qt/4.6.3/mkspecs/common/symbian" -I"F:/Qt/4.6.3/mkspecs/common/symbian/tmp" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/include" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/include/stdapis" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/include/stdapis/sys" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/include/mw" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/include/platform/mw" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/include/platform" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/include/app" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/include/platform/app" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/include/platform/loc" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/include/platform/mw/loc" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/include/platform/app/loc" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/include/platform/loc/sc" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/include/platform/mw/loc/sc" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/include/platform/app/loc/sc" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/include/stdapis/stlportv5" -I"F:/Qt/4.6.3/include/QtXmlPatterns" -I"F:/Qt/4.6.3/include/QtXmlPatterns/tmp" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/SMFCode/smf_baseline_22june_latest/example/smfclientapp" -I"F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/SMFCode/smf_baseline_22june_latest/example/smfclientapp/tmp" -first: default -default: debug-winscw -all: debug release - -qmake: - $(QMAKE) -spec symbian-abld -o "bld.inf" "F:/Nokia/devices/Nokia_Symbian3_SDK_v0.8/SMFCode/smf_baseline_22june_latest/example/smfclientapp/smfclientapp.pro" - -bld.inf: - $(QMAKE) - -$(ABLD): bld.inf - bldmake bldfiles - -debug: $(ABLD) - $(ABLD) build winscw udeb - $(ABLD) build gcce udeb - $(ABLD) build armv5 udeb - $(ABLD) build armv6 udeb - -release: $(ABLD) - $(ABLD) build gcce urel - $(ABLD) build armv5 urel - $(ABLD) build armv6 urel - -debug-winscw: $(ABLD) - $(ABLD) build winscw udeb -debug-gcce: $(ABLD) - $(ABLD) build gcce udeb -debug-armv5: $(ABLD) - $(ABLD) build armv5 udeb -debug-armv6: $(ABLD) - $(ABLD) build armv6 udeb -release-gcce: $(ABLD) - $(ABLD) build gcce urel -release-armv5: $(ABLD) - $(ABLD) build armv5 urel -release-armv6: $(ABLD) - $(ABLD) build armv6 urel - -export: $(ABLD) - $(ABLD) export - -cleanexport: $(ABLD) - $(ABLD) cleanexport - -check: first - -mocclean: compiler_moc_header_clean compiler_moc_source_clean - -mocables: compiler_moc_header_make_all compiler_moc_source_make_all - -compiler_moc_header_make_all: moc_posttestui.cpp moc_displaywidget.cpp moc_testscreen.cpp moc_smfclientapp.cpp -compiler_moc_header_clean: - -$(DEL_FILE) moc_posttestui.cpp moc_displaywidget.cpp moc_testscreen.cpp moc_smfclientapp.cpp 2> NUL -moc_posttestui.cpp: ui_posttestui.h \ - posttestui.h - F:\Qt\4.6.3\bin\moc.exe $(DEFINES) $(INCPATH) -DSYMBIAN posttestui.h -o moc_posttestui.cpp - -moc_displaywidget.cpp: ui_displaywidget.h \ - displaywidget.h - F:\Qt\4.6.3\bin\moc.exe $(DEFINES) $(INCPATH) -DSYMBIAN displaywidget.h -o moc_displaywidget.cpp - -moc_testscreen.cpp: ui_SmfClientApp.h \ - testscreen.h - F:\Qt\4.6.3\bin\moc.exe $(DEFINES) $(INCPATH) -DSYMBIAN testscreen.h -o moc_testscreen.cpp - -moc_smfclientapp.cpp: ui_SmfClientApp.h \ - smfclientapp.h - F:\Qt\4.6.3\bin\moc.exe $(DEFINES) $(INCPATH) -DSYMBIAN smfclientapp.h -o moc_smfclientapp.cpp - -compiler_rcc_make_all: -compiler_rcc_clean: -compiler_image_collection_make_all: qmake_image_collection.cpp -compiler_image_collection_clean: - -$(DEL_FILE) qmake_image_collection.cpp 2> NUL -compiler_moc_source_make_all: -compiler_moc_source_clean: -compiler_uic_make_all: ui_posttestui.h ui_displaywidget.h ui_smfclientapp.h -compiler_uic_clean: - -$(DEL_FILE) ui_posttestui.h ui_displaywidget.h ui_smfclientapp.h 2> NUL -ui_posttestui.h: posttestui.ui - f:\Qt\4.6.3\bin\uic.exe posttestui.ui -o ui_posttestui.h - -ui_displaywidget.h: displaywidget.ui - f:\Qt\4.6.3\bin\uic.exe displaywidget.ui -o ui_displaywidget.h - -ui_smfclientapp.h: smfclientapp.ui - f:\Qt\4.6.3\bin\uic.exe smfclientapp.ui -o ui_smfclientapp.h - -compiler_yacc_decl_make_all: -compiler_yacc_decl_clean: -compiler_yacc_impl_make_all: -compiler_yacc_impl_clean: -compiler_lex_make_all: -compiler_lex_clean: -compiler_clean: compiler_moc_header_clean compiler_uic_clean - -create_temps: - -@ if NOT EXIST "F:\Qt\4.6.3\include\QtCore\tmp" mkdir "F:\Qt\4.6.3\include\QtCore\tmp" - -@ if NOT EXIST "F:\Qt\4.6.3\include\QtNetwork\tmp" mkdir "F:\Qt\4.6.3\include\QtNetwork\tmp" - -@ if NOT EXIST "F:\Qt\4.6.3\include\QtGui\tmp" mkdir "F:\Qt\4.6.3\include\QtGui\tmp" - -@ if NOT EXIST "F:\Qt\4.6.3\include\QtWebKit\tmp" mkdir "F:\Qt\4.6.3\include\QtWebKit\tmp" - -@ if NOT EXIST "F:\Qt\4.6.3\include\tmp" mkdir "F:\Qt\4.6.3\include\tmp" - -@ if NOT EXIST "F:\Qt\4.6.3\include\QtContacts\tmp" mkdir "F:\Qt\4.6.3\include\QtContacts\tmp" - -@ if NOT EXIST "F:\Qt\4.6.3\include\QtLocation\tmp" mkdir "F:\Qt\4.6.3\include\QtLocation\tmp" - -@ if NOT EXIST "F:\Qt\4.6.3\mkspecs\common\symbian\tmp" mkdir "F:\Qt\4.6.3\mkspecs\common\symbian\tmp" - -@ if NOT EXIST "F:\Qt\4.6.3\include\QtXmlPatterns\tmp" mkdir "F:\Qt\4.6.3\include\QtXmlPatterns\tmp" - -@ if NOT EXIST "F:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\smfclientapp\tmp" mkdir "F:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\smfclientapp\tmp" - -extension_clean: compiler_clean - -@ if EXIST "F:\Qt\4.6.3\include\QtCore\tmp" rmdir /S /Q "F:\Qt\4.6.3\include\QtCore\tmp" - -@ if EXIST "F:\Qt\4.6.3\include\QtNetwork\tmp" rmdir /S /Q "F:\Qt\4.6.3\include\QtNetwork\tmp" - -@ if EXIST "F:\Qt\4.6.3\include\QtGui\tmp" rmdir /S /Q "F:\Qt\4.6.3\include\QtGui\tmp" - -@ if EXIST "F:\Qt\4.6.3\include\QtWebKit\tmp" rmdir /S /Q "F:\Qt\4.6.3\include\QtWebKit\tmp" - -@ if EXIST "F:\Qt\4.6.3\include\tmp" rmdir /S /Q "F:\Qt\4.6.3\include\tmp" - -@ if EXIST "F:\Qt\4.6.3\include\QtContacts\tmp" rmdir /S /Q "F:\Qt\4.6.3\include\QtContacts\tmp" - -@ if EXIST "F:\Qt\4.6.3\include\QtLocation\tmp" rmdir /S /Q "F:\Qt\4.6.3\include\QtLocation\tmp" - -@ if EXIST "F:\Qt\4.6.3\mkspecs\common\symbian\tmp" rmdir /S /Q "F:\Qt\4.6.3\mkspecs\common\symbian\tmp" - -@ if EXIST "F:\Qt\4.6.3\include\QtXmlPatterns\tmp" rmdir /S /Q "F:\Qt\4.6.3\include\QtXmlPatterns\tmp" - -@ if EXIST "F:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\smfclientapp\tmp" rmdir /S /Q "F:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\smfclientapp\tmp" - -pre_targetdeps: \ - generated_sources \ - all_source_deps \ - ui_posttestui.h \ - ui_displaywidget.h \ - ui_smfclientapp.h - -generated_sources: \ - moc_posttestui.cpp \ - moc_displaywidget.cpp \ - moc_testscreen.cpp \ - moc_smfclientapp.cpp - -all_source_deps: \ - posttestui.h \ - ui_posttestui.h \ - displaywidget.h \ - ui_displaywidget.h \ - testscreen.h \ - ui_SmfClientApp.h \ - SmfClientApp.h - -finalize: - -winscw_deployment: - -winscw_deployment_clean: - -deployment: - -deployment_clean: - --include .make.cache - -sis: - $(if $(wildcard smfclientapp_template.pkg),$(if $(wildcard .make.cache),$(MAKE) -s -f $(MAKEFILE) ok_sis,$(if $(QT_SIS_TARGET),$(MAKE) -s -f $(MAKEFILE) ok_sis,$(MAKE) -s -f $(MAKEFILE) fail_sis_nocache)),$(MAKE) -s -f $(MAKEFILE) fail_sis_nopkg) - -ok_sis: - createpackage.bat $(QT_SIS_OPTIONS) smfclientapp_template.pkg $(QT_SIS_TARGET) $(QT_SIS_CERTIFICATE) $(QT_SIS_KEY) $(QT_SIS_PASSPHRASE) - -smfclientapp.sis: - $(MAKE) -s -f $(MAKEFILE) sis - -stub_sis: - $(if $(wildcard smfclientapp_template.pkg),$(if $(wildcard .make.cache),$(MAKE) -s -f $(MAKEFILE) ok_stub_sis,$(if $(QT_SIS_TARGET),$(MAKE) -s -f $(MAKEFILE) ok_stub_sis,$(MAKE) -s -f $(MAKEFILE) fail_sis_nocache)),$(MAKE) -s -f $(MAKEFILE) fail_sis_nopkg) - -ok_stub_sis: - createpackage.bat -s $(QT_SIS_OPTIONS) smfclientapp_template.pkg $(QT_SIS_TARGET) $(QT_SIS_CERTIFICATE) $(QT_SIS_KEY) $(QT_SIS_PASSPHRASE) - -installer_sis: smfclientapp.sis - $(if $(wildcard smfclientapp_installer.pkg),$(MAKE) -s -f $(MAKEFILE) ok_installer_sis,$(MAKE) -s -f $(MAKEFILE) fail_sis_nopkg) - -ok_installer_sis: - createpackage.bat $(QT_SIS_OPTIONS) smfclientapp_installer.pkg - $(QT_SIS_CERTIFICATE) $(QT_SIS_KEY) $(QT_SIS_PASSPHRASE) - -fail_sis_nopkg: - $(error PKG file does not exist, 'sis' and 'installer_sis' target are only supported for executables or projects with DEPLOYMENT statement) - -fail_sis_nocache: - $(error Project has to be built or QT_SIS_TARGET environment variable has to be set before calling 'SIS' target) - -store_build: - @echo # ============================================================================== > .make.cache - @echo # This file is generated by make and should not be modified by the user >> .make.cache - @echo # Name : .make.cache >> .make.cache - @echo # Part of : smfclientapp >> .make.cache - @echo # Description : This file is used to cache last build target for >> .make.cache - @echo # make sis target. >> .make.cache - @echo # Version : >> .make.cache - @echo # >> .make.cache - @echo # ============================================================================== >> .make.cache - @echo. >> .make.cache - @echo QT_SIS_TARGET ?= $(QT_SIS_TARGET) >> .make.cache - -dodistclean: - -@ if EXIST "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\smfclientapp\smfclientapp_template.pkg" $(DEL_FILE) "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\smfclientapp\smfclientapp_template.pkg" - -@ if EXIST "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\smfclientapp\smfclientapp_installer.pkg" $(DEL_FILE) "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\smfclientapp\smfclientapp_installer.pkg" - -@ if EXIST "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\smfclientapp\Makefile" $(DEL_FILE) "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\smfclientapp\Makefile" - -@ if EXIST "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\smfclientapp\Makefile_0xE08059D6.mk" $(DEL_FILE) "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\smfclientapp\Makefile_0xE08059D6.mk" - -@ if EXIST "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\smfclientapp\smfclientapp_0xE08059D6.mmp" $(DEL_FILE) "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\smfclientapp\smfclientapp_0xE08059D6.mmp" - -@ if EXIST "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\smfclientapp\smfclientapp_reg.rss" $(DEL_FILE) "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\smfclientapp\smfclientapp_reg.rss" - -@ if EXIST "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\smfclientapp\smfclientapp.rss" $(DEL_FILE) "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\smfclientapp\smfclientapp.rss" - -@ if EXIST "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\smfclientapp\smfclientapp.loc" $(DEL_FILE) "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\smfclientapp\smfclientapp.loc" - -@ if EXIST "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\smfclientapp\.make.cache" $(DEL_FILE) "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\smfclientapp\.make.cache" - -@ if EXIST "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\smfclientapp\bld.inf" $(DEL_FILE) "f:\Nokia\devices\Nokia_Symbian3_SDK_v0.8\SMFCode\smf_baseline_22june_latest\example\smfclientapp\bld.inf" - -distclean: clean dodistclean - -clean: $(ABLD) - -$(ABLD) reallyclean - -bldmake clean - -clean-debug: $(ABLD) - $(ABLD) reallyclean winscw udeb - $(ABLD) reallyclean gcce udeb - $(ABLD) reallyclean armv5 udeb - $(ABLD) reallyclean armv6 udeb - -clean-release: $(ABLD) - $(ABLD) reallyclean gcce urel - $(ABLD) reallyclean armv5 urel - $(ABLD) reallyclean armv6 urel - -clean-debug-winscw: $(ABLD) - $(ABLD) reallyclean winscw udeb -clean-debug-gcce: $(ABLD) - $(ABLD) reallyclean gcce udeb -clean-debug-armv5: $(ABLD) - $(ABLD) reallyclean armv5 udeb -clean-debug-armv6: $(ABLD) - $(ABLD) reallyclean armv6 udeb -clean-release-gcce: $(ABLD) - $(ABLD) reallyclean gcce urel -clean-release-armv5: $(ABLD) - $(ABLD) reallyclean armv5 urel -clean-release-armv6: $(ABLD) - $(ABLD) reallyclean armv6 urel - -run: - -call /Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/release/winscw/udeb/smfclientapp.exe $(QT_RUN_OPTIONS) -runonphone: sis - runonphone $(QT_RUN_ON_PHONE_OPTIONS) --sis smfclientapp.sis smfclientapp.exe $(QT_RUN_OPTIONS) - diff -r b78fa4cdbf2b -r 106a4bfcb866 example/smfclientapp/bld.inf --- a/example/smfclientapp/bld.inf Thu Aug 05 16:35:33 2010 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +0,0 @@ -// ============================================================================ -// * Makefile for building: smfclientapp -// * Generated by qmake (2.01a) (Qt 4.6.1) on: 2010-05-18T15:54:38 -// * This file is generated by qmake and should not be modified by the -// * user. -// * Project: smfclientapp.pro -// * Template: app -// ============================================================================ - -#define BLD_INF_SMFCLIENTAPP_FA72E4FA - - -prj_platforms - -WINSCW GCCE ARMV5 ARMV6 - - -prj_mmpfiles - -gnumakefile Makefile_0xE08059D4.mk -smfclientapp_0xE08059D4.mmp - -prj_extensions - diff -r b78fa4cdbf2b -r 106a4bfcb866 example/smfclientapp/displaywidget.cpp --- a/example/smfclientapp/displaywidget.cpp Thu Aug 05 16:35:33 2010 +0530 +++ b/example/smfclientapp/displaywidget.cpp Thu Aug 05 16:46:37 2010 +0530 @@ -147,6 +147,7 @@ } void DisplayWidget::showPosts(SmfPostList* postlist, SmfError error, SmfResultPage resultPage) { + Q_UNUSED(resultPage) writeLog("TestScreen::showPosts"); ui.listWidget->clear(); ui.listWidget->setVerticalScrollBar(ui.verticalScrollBar_list); diff -r b78fa4cdbf2b -r 106a4bfcb866 example/smfclientapp/smfclientapp.loc --- a/example/smfclientapp/smfclientapp.loc Thu Aug 05 16:35:33 2010 +0530 +++ b/example/smfclientapp/smfclientapp.loc Thu Aug 05 16:46:37 2010 +0530 @@ -1,5 +1,5 @@ // ============================================================================ -// * Generated by qmake (2.01a) (Qt 4.6.3) on: 2010-06-22T14:45:30 +// * Generated by qmake (2.01a) (Qt 4.6.2) on: 2010-07-30T14:11:44 // * This file is generated by qmake and should not be modified by the // * user. // ============================================================================ diff -r b78fa4cdbf2b -r 106a4bfcb866 example/smfclientapp/smfclientapp.pkg --- a/example/smfclientapp/smfclientapp.pkg Thu Aug 05 16:35:33 2010 +0530 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,36 +0,0 @@ -; smfclientapp.pkg generated by qmake at 2010-04-29T11:34:18 -; This file is generated by qmake and should not be modified by the user -; - -; Language -&EN - -; SIS header: name, uid, version -#{"smfclientapp"},(0xE08059D4),1,0,0 - -; Localised Vendor name -%{"Vendor"} - -; Unique Vendor name -:"Vendor" - -; Manual PKG pre-rules from PRO files -; Default HW/platform dependencies -[0x101F7961],0,0,0,{"S60ProductID"} -[0x102032BE],0,0,0,{"S60ProductID"} -[0x102752AE],0,0,0,{"S60ProductID"} -[0x1028315F],0,0,0,{"S60ProductID"} - -; Default dependency to Qt libraries -(0x2001E61C), 4, 6, 1, {"Qt"} -; Dependency to Qt Webkit -(0x200267C2), 4, 6, 1, {"QtWebKit"} -; Default dependency to QtMobility libraries -(0x2002AC89), 0, 2, 0, {"QtMobility"} - -; Executable and default resource files -"/S60/devices/S60_5th_Edition_SDK_v0.9/epoc32/release/$(PLATFORM)/$(TARGET)/smfclientapp.exe" - "!:\sys\bin\smfclientapp.exe" -"/S60/devices/S60_5th_Edition_SDK_v0.9/epoc32/data/z/resource/apps/smfclientapp.rsc" - "!:\resource\apps\smfclientapp.rsc" -"/S60/devices/S60_5th_Edition_SDK_v0.9/epoc32/data/z/private/10003a3f/import/apps/smfclientapp_reg.rsc" - "!:\private\10003a3f\import\apps\smfclientapp_reg.rsc" - -; Manual PKG post-rules from PRO files diff -r b78fa4cdbf2b -r 106a4bfcb866 example/smfclientapp/smfclientapp.pro --- a/example/smfclientapp/smfclientapp.pro Thu Aug 05 16:35:33 2010 +0530 +++ b/example/smfclientapp/smfclientapp.pro Thu Aug 05 16:46:37 2010 +0530 @@ -1,7 +1,6 @@ TEMPLATE = app TARGET = smfclientapp -DEFINES += WRITE_LOG #\ - #OLDER_QT_MOBILITY +DEFINES += WRITE_LOG QT += core \ gui \ network \ @@ -24,7 +23,7 @@ smfclientapp.ui RESOURCES += symbian:TARGET.UID3 = 0xE08059D6 -symbian:LIBS += -lsmfclient.dll +symbian:LIBS += -lsmfclient -lsmfcommon symbian:TARGET.CAPABILITY = ReadUserData \ WriteUserData \ LocalServices \ diff -r b78fa4cdbf2b -r 106a4bfcb866 example/smfclientapp/smfclientapp.rss --- a/example/smfclientapp/smfclientapp.rss Thu Aug 05 16:35:33 2010 +0530 +++ b/example/smfclientapp/smfclientapp.rss Thu Aug 05 16:46:37 2010 +0530 @@ -1,5 +1,5 @@ // ============================================================================ -// * Generated by qmake (2.01a) (Qt 4.6.3) on: 2010-06-22T14:45:30 +// * Generated by qmake (2.01a) (Qt 4.6.2) on: 2010-07-30T14:11:44 // * This file is generated by qmake and should not be modified by the // * user. // ============================================================================ diff -r b78fa4cdbf2b -r 106a4bfcb866 example/smfclientapp/smfclientapp_installer.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/smfclientapp/smfclientapp_installer.pkg Thu Aug 05 16:46:37 2010 +0530 @@ -0,0 +1,31 @@ +; smfclientapp_installer.pkg generated by qmake at 2010-07-30T14:11:44 +; This file is generated by qmake and should not be modified by the user +; + +; Language +&EN + +; SIS header: name, uid, version +#{"smfclientapp installer"},(0xA000D7CE),1,0,0 + +; Localised Vendor name +%{"Vendor"} + +; Unique Vendor name +:"Vendor" + + +; Manual PKG pre-rules from PRO files +; Default HW/platform dependencies +[0x101F7961],0,0,0,{"S60ProductID"} +[0x102032BE],0,0,0,{"S60ProductID"} +[0x102752AE],0,0,0,{"S60ProductID"} +[0x1028315F],0,0,0,{"S60ProductID"} + +; Default dependency to Qt libraries +; Dependency to Qt Webkit +; Default dependency to QtMobility libraries + + +"D:/smf/MissingCode/smfrepo/example/smfclientapp/smfclientapp.sis" - "c:\adm\smfclientapp.sis" +@"D:/Qt/4.6.2/smartinstaller.sis",(0x2002CCCD) diff -r b78fa4cdbf2b -r 106a4bfcb866 example/smfclientapp/smfclientapp_reg.rss --- a/example/smfclientapp/smfclientapp_reg.rss Thu Aug 05 16:35:33 2010 +0530 +++ b/example/smfclientapp/smfclientapp_reg.rss Thu Aug 05 16:46:37 2010 +0530 @@ -1,5 +1,5 @@ // ============================================================================ -// * Generated by qmake (2.01a) (Qt 4.6.3) on: 2010-06-22T14:45:30 +// * Generated by qmake (2.01a) (Qt 4.6.2) on: 2010-07-30T14:11:44 // * This file is generated by qmake and should not be modified by the // * user. // ============================================================================ diff -r b78fa4cdbf2b -r 106a4bfcb866 example/smfclientapp/smfclientapp_template.pkg --- a/example/smfclientapp/smfclientapp_template.pkg Thu Aug 05 16:35:33 2010 +0530 +++ b/example/smfclientapp/smfclientapp_template.pkg Thu Aug 05 16:46:37 2010 +0530 @@ -1,11 +1,10 @@ -; smfclientapp_template.pkg generated by qmake at 2010-06-22T14:45:30 +; smfclientapp_template.pkg generated by qmake at 2010-07-30T14:11:44 ; This file is generated by qmake and should not be modified by the user ; ; Language &EN - ; SIS header: name, uid, version #{"smfclientapp"},(0xE08059D6),1,0,0 @@ -17,22 +16,22 @@ ; Manual PKG pre-rules from PRO files -; Dependency to Qt Webkit -(0x200267C2), 4, 6, 3, {"QtWebKit"} -; Default dependency to Qt libraries -(0x2001E61C), 4, 6, 3, {"Qt"} ; Default HW/platform dependencies [0x101F7961],0,0,0,{"S60ProductID"} [0x102032BE],0,0,0,{"S60ProductID"} [0x102752AE],0,0,0,{"S60ProductID"} [0x1028315F],0,0,0,{"S60ProductID"} +; Default dependency to Qt libraries +(0x2001E61C), 4, 6, 2, {"Qt"} +; Dependency to Qt Webkit +(0x200267C2), 4, 6, 2, {"QtWebKit"} ; Default dependency to QtMobility libraries (0x2002AC89), 1, 0, 0, {"QtMobility"} ; Executable and default resource files -"/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/release/$(PLATFORM)/$(TARGET)/smfclientapp.exe" - "!:\sys\bin\smfclientapp.exe" -"/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/data/z/resource/apps/smfclientapp.rsc" - "!:\resource\apps\smfclientapp.rsc" -"/Nokia/devices/Nokia_Symbian3_SDK_v0.8/epoc32/data/z/private/10003a3f/import/apps/smfclientapp_reg.rsc" - "!:\private\10003a3f\import\apps\smfclientapp_reg.rsc" +"/S60/devices/Nokia_Symbian3_SDK_v0.8/epoc32/release/$(PLATFORM)/$(TARGET)/smfclientapp.exe" - "!:\sys\bin\smfclientapp.exe" +"/S60/devices/Nokia_Symbian3_SDK_v0.8/epoc32/data/z/resource/apps/smfclientapp.rsc" - "!:\resource\apps\smfclientapp.rsc" +"/S60/devices/Nokia_Symbian3_SDK_v0.8/epoc32/data/z/private/10003a3f/import/apps/smfclientapp_reg.rsc" - "!:\private\10003a3f\import\apps\smfclientapp_reg.rsc" ; Manual PKG post-rules from PRO files diff -r b78fa4cdbf2b -r 106a4bfcb866 example/smfclientapp/testscreen.cpp --- a/example/smfclientapp/testscreen.cpp Thu Aug 05 16:35:33 2010 +0530 +++ b/example/smfclientapp/testscreen.cpp Thu Aug 05 16:46:37 2010 +0530 @@ -163,6 +163,7 @@ } void TestScreen::showPosts(SmfPostList* postlist, SmfError error, SmfResultPage resultPage) { + Q_UNUSED(resultPage) writeLog("TestScreen::showPosts"); ui.listWidget->clear(); writeLog("TestScreen::showPosts count="); diff -r b78fa4cdbf2b -r 106a4bfcb866 example/smfclientapp/ui_displaywidget.h --- a/example/smfclientapp/ui_displaywidget.h Thu Aug 05 16:35:33 2010 +0530 +++ b/example/smfclientapp/ui_displaywidget.h Thu Aug 05 16:46:37 2010 +0530 @@ -1,8 +1,8 @@ /******************************************************************************** ** Form generated from reading UI file 'displaywidget.ui' ** -** Created: Tue Jun 22 13:45:34 2010 -** by: Qt User Interface Compiler version 4.6.3 +** Created: Fri Jul 30 14:06:51 2010 +** by: Qt User Interface Compiler version 4.6.2 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ diff -r b78fa4cdbf2b -r 106a4bfcb866 example/smfclientapp/ui_posttestui.h --- a/example/smfclientapp/ui_posttestui.h Thu Aug 05 16:35:33 2010 +0530 +++ b/example/smfclientapp/ui_posttestui.h Thu Aug 05 16:46:37 2010 +0530 @@ -1,8 +1,8 @@ /******************************************************************************** ** Form generated from reading UI file 'posttestui.ui' ** -** Created: Tue Jun 22 13:45:31 2010 -** by: Qt User Interface Compiler version 4.6.3 +** Created: Fri Jul 30 14:06:50 2010 +** by: Qt User Interface Compiler version 4.6.2 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/ diff -r b78fa4cdbf2b -r 106a4bfcb866 example/smfclientapp/ui_smfclientapp.h --- a/example/smfclientapp/ui_smfclientapp.h Thu Aug 05 16:35:33 2010 +0530 +++ b/example/smfclientapp/ui_smfclientapp.h Thu Aug 05 16:46:37 2010 +0530 @@ -1,8 +1,8 @@ /******************************************************************************** ** Form generated from reading UI file 'smfclientapp.ui' ** -** Created: Tue Jun 22 13:45:36 2010 -** by: Qt User Interface Compiler version 4.6.3 +** Created: Fri Jul 30 14:06:53 2010 +** by: Qt User Interface Compiler version 4.6.2 ** ** WARNING! All changes made in this file will be lost when recompiling UI file! ********************************************************************************/