example/clientapi/example_usage.cpp
author cgandhi <chandradeep.gandhi@sasken.com>
Thu, 22 Apr 2010 15:18:37 +0530
changeset 5 edb9dc8273d9
parent 3 0446eb7b28aa
permissions -rw-r--r--
Adding support for easy fetching of social happenings (activity streams)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
     1
#include "smfglobal.h"
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
     2
#include "smfclient.h"
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
     3
#include "smfprovider.h"
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
     4
#include "smfgallery.h"
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
     5
#include "smfcontact.h"
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
     6
#include "smfpostprovider.h"
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
     7
#include "smfcontactfetcher.h"
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
     8
#include "smfmusic.h"
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
     9
#include "smfpicture.h"
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    10
#include "smftrackinfo.h"
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    11
#include "smfmusicprofile.h"
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    12
#include "smflyrics.h"
5
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
    13
#include "smfactions.h"
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
    14
#include "smfactivityfetcher.h"
2
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    15
#include <qalgorithms.h>
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    16
#include "qtcontacts.h"
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    17
#include <qdatastream.h>
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    18
#include <QSharedData>
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    19
#include <smfclientglobal.h>
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    20
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    21
using namespace QtMobility;
0
5d2360e70d9f Application level use cases to illustrate the goal of SMF. Pushing the draft header files for SMF client and one sample application cpp
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    22
2
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    23
class MyAppView //: public QAbstractItemView
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    24
	{
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    25
public:
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    26
	void add(QImage pic);
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    27
	void add(SmfTrackInfo trackInfo);
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    28
	void add(QContact qc);
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    29
	void setPicture(QImage image);
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    30
	void setTitle(QString cap);	
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    31
	void setIcon(QImage image);
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    32
	void setDescription(QString desc);
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    33
	void setProvider(SmfProvider p);
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    34
	void setLyricsData(SmfLyrics l);
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    35
	};
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    36
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    37
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    38
class MyApplication :public QObject
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    39
	{
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    40
	Q_OBJECT
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    41
	
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    42
public slots:
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    43
	void displayGallery();
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    44
	void showPicsSlot(SmfPictureList* pics, QString err);
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    45
	void uploadPicture(QImage* picture, QList<SmfGallery> galleries);
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    46
	void uploaded(bool success);
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    47
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    48
	void displayFriends();
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    49
	void showlist(SmfContactList* friendsList);
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    50
	void postUpdate();
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    51
	void showPosts(SmfPostList* posts, QString err);
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    52
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    53
	void getMusic(SmfTrackInfo currTrack);
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    54
	void showTrackSearch(SmfTrackInfoList* songs);
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    55
	void showStore(SmfProviderList* stores);
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    56
	void updateCurrentPlaying(QList<SmfMusicSearch> musicServices, SmfTrackInfo currTrack);
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    57
	void displayLyrics(SmfTrackInfo currTrack);
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    58
	void showLyrics(SmfLyricsList* list);
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    59
5
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
    60
	void getActivities();
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
    61
	void showActivities(SmfActivityEntryList* entries);
2
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    62
private:
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    63
	MyAppView* m_view;
3
0446eb7b28aa Updating the sample plugin and other related changes for clients and plugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 2
diff changeset
    64
	SmfClient client;
2
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    65
	SmfGallery* m_smfgl;
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    66
	SmfContactFetcher* m_smfcf;
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    67
	SmfMusicService* m_smfms;
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    68
	QList<SmfContact> m_myfrndz;
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    69
	};
0
5d2360e70d9f Application level use cases to illustrate the goal of SMF. Pushing the draft header files for SMF client and one sample application cpp
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    70
/** 1. Display a gallery on the screen for some remote service.
5d2360e70d9f Application level use cases to illustrate the goal of SMF. Pushing the draft header files for SMF client and one sample application cpp
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    71
 * assume m_view is some gallery view object in the application.*/
5d2360e70d9f Application level use cases to illustrate the goal of SMF. Pushing the draft header files for SMF client and one sample application cpp
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    72
void MyApplication::displayGallery()
1
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
    73
	{
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
    74
	// Some common interface for finding implementations.
5
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
    75
	QList<SmfProvider>* galleries = client.GetServices("org.symbian.smf.client.gallery\0.2");
0
5d2360e70d9f Application level use cases to illustrate the goal of SMF. Pushing the draft header files for SMF client and one sample application cpp
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    76
1
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
    77
	// We will use the first one now
2
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    78
	SmfProvider smfp = galleries->value(0);
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    79
	SmfGallery* myGallery = new SmfGallery(&smfp);
1
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
    80
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
    81
	// Adjust our view to show where these pictures came from
2
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    82
	QImage imge = smfp.serviceIcon();
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    83
	QString desc = smfp.description();
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    84
	QString name = smfp.serviceName();
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    85
	m_view->setIcon(imge);
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    86
	m_view->setProvider(smfp);
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    87
	m_view->setDescription(desc);
0
5d2360e70d9f Application level use cases to illustrate the goal of SMF. Pushing the draft header files for SMF client and one sample application cpp
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
    88
1
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
    89
	/**
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
    90
	 * Asynchrnous request to fetch the pictures.
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
    91
	 * The picturesAvailable() signal is emitted 
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
    92
	 * with SmfPictureList once the pictures have arrived.
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
    93
	 */
2
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    94
	myGallery->pictures();
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    95
	connect(myGallery,SIGNAL(picturesAvailable(SmfPictureList*, QString, SmfResultPage )),
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    96
			SLOT(showPicsSlot(SmfPictureList*, QString)));
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    97
	
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
    98
	m_smfgl = myGallery;
1
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
    99
	}
2
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   100
1
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   101
void MyApplication::showPicsSlot(SmfPictureList* pics, QString err)
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   102
	{
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   103
	//check err string if there is any error
2
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   104
	if(err.compare("Err")) return;
1
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   105
	//if no error
2
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   106
	foreach(SmfPicture pic, *pics) {
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   107
		m_view->add(pic.picture() ); // do something with the picture in this gallery
1
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   108
	}
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   109
	}
0
5d2360e70d9f Application level use cases to illustrate the goal of SMF. Pushing the draft header files for SMF client and one sample application cpp
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   110
5d2360e70d9f Application level use cases to illustrate the goal of SMF. Pushing the draft header files for SMF client and one sample application cpp
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   111
/** 2. Upload a picture captured by the user to some selection of galeries.*/
2
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   112
void MyApplication::uploadPicture(QImage* picture, QList<SmfGallery> galleries)
1
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   113
	{
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   114
	/**
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   115
	 * When uploading is finished we can check the success of the uploading
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   116
	 */	
2
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   117
	QObject::connect(m_smfcf,SIGNAL(uploadFinished(bool)),SLOT(uploaded(bool)));
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   118
	SmfPicture*  smfPic = new SmfPicture(*picture);
1
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   119
	// The list could be from a selection of galleries chosen by the user,
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   120
	// think multiple TweetDeck accounts?
2
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   121
	foreach(SmfGallery gallery, galleries)
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   122
		{
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   123
		gallery.upload(smfPic);
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   124
		}
1
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   125
	}
2
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   126
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   127
/**
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   128
 * Slot to catch the uploading finished event
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   129
 */
1
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   130
void MyApplication::uploaded(bool success)
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   131
	{
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   132
	if(!success)
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   133
		{
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   134
	//error occured while uploading
0
5d2360e70d9f Application level use cases to illustrate the goal of SMF. Pushing the draft header files for SMF client and one sample application cpp
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   135
		}
5d2360e70d9f Application level use cases to illustrate the goal of SMF. Pushing the draft header files for SMF client and one sample application cpp
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   136
	}
5d2360e70d9f Application level use cases to illustrate the goal of SMF. Pushing the draft header files for SMF client and one sample application cpp
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   137
5d2360e70d9f Application level use cases to illustrate the goal of SMF. Pushing the draft header files for SMF client and one sample application cpp
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   138
/**
1
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   139
 * 3. This is an example of displaying the friends profile image in a view from one or more
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   140
 * service provider. Note that this service can be provided by any kind of service provider,
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   141
 * e.g. last.fm music service where users maintain profiles and friends.
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   142
 */
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   143
void MyApplication::displayFriends()
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   144
	{
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   145
	// Some common interface for finding implementations.
5
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   146
	QList<SmfProvider>* contactFetcherList = client.GetServices("org.symbian.smf.cleint.contact.fetcher\0.2");
2
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   147
	SmfProvider smfp = contactFetcherList->value(0);
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   148
	SmfContactFetcher* smfcf = new SmfContactFetcher(&smfp);
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   149
	
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   150
	//Request friend list, the friendsListAvailable() signal
1
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   151
	//is emitted with SmfContactList once data is arrived.
2
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   152
	QObject::connect(smfcf,SIGNAL(friendsListAvailable(SmfContactList*, QString, SmfResultPage )),
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   153
			SLOT(showlist(SmfContactList*)));
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   154
	smfcf->friends();
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   155
	
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   156
	m_smfcf = smfcf;
1
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   157
	}
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   158
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   159
void MyApplication::showlist(SmfContactList* friendsList)
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   160
	{
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   161
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   162
	// Adjust our view to show where these pictures came from
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   163
	//display service name description and the logo
2
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   164
	m_view->setIcon( (m_smfcf->getProvider())->serviceIcon() );
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   165
	m_view->setDescription( (m_smfcf->getProvider())->description() );
0
5d2360e70d9f Application level use cases to illustrate the goal of SMF. Pushing the draft header files for SMF client and one sample application cpp
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   166
1
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   167
	//now display the images
2
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   168
	foreach(SmfContact contact, *friendsList) {
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   169
		QVariant data = contact.value("Avatar"); 
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   170
		QImage pic = data.value<QImage>();
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   171
		QContact qc;
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   172
		contact.convert(qc);
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   173
		m_view->add(qc);
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   174
		m_myfrndz.append(contact);
1
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   175
	}
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   176
	}
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   177
/**
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   178
 * 4. This is an example of posting and reading user updates to social netowrking sites
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   179
 */
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   180
void MyApplication::postUpdate()
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   181
	{
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   182
	// Some common interface for finding implementations.
5
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   183
	QList<SmfProvider>* postServices = client.GetServices("org.symbian.smf.client.contact.posts\0.2");
0
5d2360e70d9f Application level use cases to illustrate the goal of SMF. Pushing the draft header files for SMF client and one sample application cpp
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   184
1
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   185
	//let us use the first one
2
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   186
	QString servName = postServices->value(0).serviceName();
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   187
	if(!servName.compare("Facebook.com")) return;
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   188
	SmfProvider smfp = postServices->value(0);
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   189
	SmfPostProvider* myPostServer = new SmfPostProvider(&smfp);
1
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   190
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   191
	//Adjust our view to show where these posts came from (e.g. tweets from twitter)
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   192
	//display service name description and the logo
2
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   193
	m_view->setIcon((myPostServer->getProvider())->serviceIcon() );
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   194
	m_view->setProvider(myPostServer->getProvider());
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   195
	m_view->setDescription((myPostServer->getProvider())->description() );
1
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   196
2
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   197
	SmfPost reply("this is a text post", this);
1
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   198
	//post my udpate to be visible to all, connect to updatePostFinished()
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   199
	// signal of SmfPostProvider to track the success
2
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   200
	SmfContact frnd(m_myfrndz.value(0));
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   201
	myPostServer->postDirected(reply,frnd);
0
5d2360e70d9f Application level use cases to illustrate the goal of SMF. Pushing the draft header files for SMF client and one sample application cpp
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   202
1
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   203
	//Asynchronously get all posts to me in my profle (e.g. twits from all friends)
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   204
	//connect to postsAvailable to show the post
2
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   205
	myPostServer->posts();
1
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   206
2
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   207
	QObject::connect(myPostServer,
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   208
			SIGNAL(postsAvailable(SmfPostList*, QString, SmfResultPage )),
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   209
			SLOT(showPosts(SmfPostList*, QString)));
1
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   210
	}
2
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   211
void MyApplication::showPosts(SmfPostList* posts, QString /*err*/)
1
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   212
	{
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   213
	//Show the first post  
2
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   214
	SmfPost post = posts->at(0);
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   215
	m_view->setDescription( post.toPlainText() );
1
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   216
	}
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   217
/**
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   218
 * 5. This is an example of getting song recommendations from a social netowrking sites
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   219
 */
2
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   220
void MyApplication::getMusic(SmfTrackInfo currTrack)
1
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   221
	{
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   222
	// Some common interface for finding implementations.
5
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   223
	QList<SmfProvider>* smfProList = client.GetServices("org.symbian.smf.client.music\0.2");
2
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   224
	SmfProvider smfp = smfProList->value(0);
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   225
	SmfMusicSearch* mServer = new SmfMusicSearch(&smfp);
0
5d2360e70d9f Application level use cases to illustrate the goal of SMF. Pushing the draft header files for SMF client and one sample application cpp
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   226
2
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   227
	QObject::connect(mServer,SIGNAL(trackSearchAvailable(SmfTrackInfoList*, QString,SmfResultPage )),this,SLOT(showTrackSearch(SmfTrackInfoList*)));
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   228
	QObject::connect(mServer,SIGNAL(storeSearchAvailable(SmfProviderList*, QString,SmfResultPage )),this,SLOT(showStoreSearch(SmfProviderList*)));
1
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   229
	//search songs similar to currently playing,
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   230
	//connect to trackSearchAvailable signal to get the result
2
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   231
	mServer->recommendations(currTrack);
1
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   232
	//display to the user
2
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   233
	m_view->setIcon( mServer->getProvider()->serviceIcon() );
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   234
	m_view->setProvider( mServer->getProvider());
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   235
	m_view->setDescription( mServer->getProvider()->description() );
0
5d2360e70d9f Application level use cases to illustrate the goal of SMF. Pushing the draft header files for SMF client and one sample application cpp
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   236
1
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   237
0
5d2360e70d9f Application level use cases to illustrate the goal of SMF. Pushing the draft header files for SMF client and one sample application cpp
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   238
1
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   239
	}
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   240
void MyApplication::showTrackSearch(SmfTrackInfoList* songs)
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   241
	{
2
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   242
	foreach(SmfTrackInfo track, *songs){
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   243
		m_view->add(track);
1
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   244
	}
3
0446eb7b28aa Updating the sample plugin and other related changes for clients and plugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 2
diff changeset
   245
	QList<SmfProvider>* smfProList = client.GetServices("org.symbian.smf.client.music.search\0.2");
2
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   246
	SmfProvider smfp = smfProList->value(0);
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   247
	SmfMusicSearch* mServer = new SmfMusicSearch(&smfp);
1
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   248
	//allow user to select a track and get purchase links
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   249
	//connect to showStoreSearch signal to display the stores for that track
2
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   250
	mServer->stores(songs->value(0));
1
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   251
	}
2
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   252
void MyApplication::showStore(SmfProviderList* /*stores*/)
1
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   253
	{
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   254
	//show stores
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   255
	}
0
5d2360e70d9f Application level use cases to illustrate the goal of SMF. Pushing the draft header files for SMF client and one sample application cpp
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   256
void MyApplication::updateCurrentPlaying(QList<SmfMusicSearch> musicServices, SmfTrackInfo currTrack)
1
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   257
	{
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   258
	//after purchasing and downloading is over, user plays the track
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   259
	//now post the current platying track to all service providers
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   260
	//postFinished() signal of SmfMusicSearch can be tracked to check the success of the posts
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   261
	foreach(SmfMusicSearch provider, musicServices) {
0
5d2360e70d9f Application level use cases to illustrate the goal of SMF. Pushing the draft header files for SMF client and one sample application cpp
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   262
		provider.postCurrentPlaying(currTrack);
5d2360e70d9f Application level use cases to illustrate the goal of SMF. Pushing the draft header files for SMF client and one sample application cpp
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   263
	}
1
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   264
	//postCurrentPlaying is also a slot funtion, may be application can use connect
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   265
	}
0
5d2360e70d9f Application level use cases to illustrate the goal of SMF. Pushing the draft header files for SMF client and one sample application cpp
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   266
5d2360e70d9f Application level use cases to illustrate the goal of SMF. Pushing the draft header files for SMF client and one sample application cpp
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   267
void MyApplication::displayLyrics(SmfTrackInfo currTrack)
1
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   268
	{
2
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   269
0
5d2360e70d9f Application level use cases to illustrate the goal of SMF. Pushing the draft header files for SMF client and one sample application cpp
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   270
	// Some common interface for finding implementations.
5
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   271
	QList<SmfProvider>* smfProList = client.GetServices("org.symbian.smf.client.music.lyrics\0.2","lyricsfly.com");
2
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   272
	SmfProvider smfp = smfProList->value(0);
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   273
	SmfLyricsService* lyricsService = new SmfLyricsService(&smfp);
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   274
	QObject::connect(lyricsService,SIGNAL(lyricsAvailable(SmfLyricsList*, QString, SmfResultPage )),this,SLOT(showLyrics(SmfLyricsList*)));
0
5d2360e70d9f Application level use cases to illustrate the goal of SMF. Pushing the draft header files for SMF client and one sample application cpp
cgandhi <chandradeep.gandhi@sasken.com>
parents:
diff changeset
   275
1
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   276
	//Request to get the lyrics
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   277
	//lyricsAvailable() signal of SmfLyricsService is emitted when lyrics is available
2
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   278
	lyricsService->lyrics(currTrack);
1
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   279
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   280
	}
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   281
void MyApplication::showLyrics(SmfLyricsList* list)
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   282
	{
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   283
	//now display the latest edited lyrics
2
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   284
	//qSort(list->begin(),list->end(),caseInsensitiveLessThan);
86af6c333601 Changed the common classes for location, events. Changed APIs for paged results. Added exporting to QContacts.
cgandhi <chandradeep.gandhi@sasken.com>
parents: 1
diff changeset
   285
	m_view->setLyricsData(list->at(0));
1
4b1e636e8a71 Updating the interfaces for SMFClient and SMFPlugins
cgandhi <chandradeep.gandhi@sasken.com>
parents: 0
diff changeset
   286
	}
5
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   287
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   288
void MyApplication::getActivities()
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   289
	{
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   290
	// Some common interface for finding implementations.
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   291
	QList<SmfProvider>* activityServices = client.GetServices("org.symbian.smf.client.activity.fetcher\0.2");
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   292
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   293
	//let us use the Facebook one
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   294
	QString servName = activityServices->value(0).serviceName();
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   295
	if(!servName.compare("Facebook.com")) return;
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   296
	SmfProvider smfp = activityServices->value(0);
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   297
	SmfActivityFetcher* myActivityServer = new SmfActivityFetcher(&smfp);
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   298
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   299
	//Adjust our view to show where these posts came from (e.g. streams from Facebook)
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   300
	//display service name description and the logo
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   301
	m_view->setIcon((myActivityServer->getProvider())->serviceIcon() );
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   302
	m_view->setProvider(myActivityServer->getProvider());
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   303
	m_view->setDescription((myActivityServer->getProvider())->description() );
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   304
	
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   305
	QObject::connect(myActivityServer,
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   306
			SIGNAL(resultsAvailable(SmfActivityEntryList*,QString,SmfResultPage)),
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   307
			this,SLOT(showActivities(SmfActivityEntryList*)));	
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   308
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   309
	//get a list of updates to my wall
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   310
	myActivityServer->selfActivities();
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   311
	}
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   312
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   313
void MyApplication::showActivities(SmfActivityEntryList* entries)
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   314
	{
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   315
	foreach(SmfActivityEntry entry, *entries) {
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   316
		SmfContact sc = entry.author();
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   317
		QString desc = (sc.value("Name")).toString();
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   318
		SmfPost details = entry.details();
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   319
		QList<SmfActivityObject> aol = entry.activities();
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   320
		SmfActivityObject sao = aol.value(0);
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   321
		if(SmfActivityMarkAsFavorite == entry.actionName() )
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   322
			{
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   323
			desc.append("  has marked  ");
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   324
			QVariant qv = sao.objData();
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   325
			SmfActivityObjectType otype = sao.type();
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   326
			if((SmfActivityObjTypePhoto == otype ) && (qv.canConvert<SmfPicture>()))
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   327
				{
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   328
				SmfPicture pic = qv.value<SmfPicture>();
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   329
				desc.append( pic.description() );
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   330
				}
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   331
			desc.append("  as Favorite at");
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   332
			QDateTime qdt = sao.time();
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   333
			desc.append(qdt.toString("h:m:s ap"));
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   334
			}
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   335
	}
edb9dc8273d9 Adding support for easy fetching of social happenings (activity streams)
cgandhi <chandradeep.gandhi@sasken.com>
parents: 3
diff changeset
   336
	}