1 /** |
|
2 * Copyright (c) 2010 Sasken Communication Technologies Ltd. |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html" |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Chandradeep Gandhi, Sasken Communication Technologies Ltd - Initial contribution |
|
11 * |
|
12 * Contributors: |
|
13 * Manasij Roy, Nalina Hariharan |
|
14 * |
|
15 * Description: |
|
16 * The SmfEvent class represents an event |
|
17 * |
|
18 */ |
|
19 |
|
20 #ifndef SMFGALLERY_H |
|
21 #define SMFGALLERY_H |
|
22 |
|
23 #include "smfglobal.h" |
|
24 #include "smfprovider.h" |
|
25 #include "../common/SmfClientGlobal.h" |
|
26 class SmfProvider; |
|
27 class SmfComment; //user id, string, and url |
|
28 class SmfPicture; |
|
29 |
|
30 |
|
31 #include <QObject> |
|
32 #include <QDateTime> |
|
33 #include <QStringList> |
|
34 //List of SmfPicture |
|
35 typedef QList<SmfPicture> SmfPictureList; |
|
36 /** |
|
37 * @ingroup smf_client_group |
|
38 * Interface to a remote gallery service. This class |
|
39 * provides some basic gallery functionality to allow applications |
|
40 * to interact with a picture gallery in a social network. |
|
41 * |
|
42 * Note that branding information for the particular service implementation |
|
43 * is available from getProvider() API. See also: |
|
44 * SmfProvider::serviceName(), SmfProvider::serviceIcon() |
|
45 * |
|
46 * All of the functionality described here should be implemented by a service |
|
47 * specific plug-in object. |
|
48 * Interface name for SmfGallery org.symbian.smf.client.gallery |
|
49 */ |
|
50 class SMFCLIENT_EXPORT SmfGallery : public QObject |
|
51 { |
|
52 Q_OBJECT |
|
53 |
|
54 public: |
|
55 /** |
|
56 * Constructs SmfGallery. |
|
57 * @param baseProvider The base provider info |
|
58 * Seeing as this is a plug-in implementation, these will realistically |
|
59 be generated by SMF factory of some kind |
|
60 */ |
|
61 |
|
62 SmfGallery(SmfProvider* baseprovider = 0); |
|
63 ~SmfGallery(); |
|
64 |
|
65 public: |
|
66 /** |
|
67 * Get the picture listing asynchronously. |
|
68 * The picturesAvailable() signal is emitted with SmfPictureList once the pictures have arrived. |
|
69 * When the list is big user can specify the page number and per page item data. |
|
70 * If not supplied by the user default values are used. |
|
71 * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query. |
|
72 * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE |
|
73 */ |
|
74 void pictures(int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE); |
|
75 |
|
76 /** |
|
77 * Returns a user title/caption for the picture |
|
78 */ |
|
79 QString description(SmfPicture& picture); // A user title or caption, maybe? |
|
80 |
|
81 //APIs to get/set base provider info (SmfProvider) |
|
82 |
|
83 /** |
|
84 * Gets the base provider info |
|
85 */ |
|
86 SmfProvider* getProvider() ; |
|
87 |
|
88 public slots: |
|
89 /** |
|
90 * Upload an image.Implemented as slot to connect to UI controls more easily |
|
91 * uploadFinished() signal is emitted with the success value of the upload |
|
92 * @param image the image to be uploaded |
|
93 */ |
|
94 void upload(SmfPicture* image) ; |
|
95 |
|
96 /** |
|
97 * Upload an list image.Implemented as slot to connect to UI controls more easily |
|
98 * uploadFinished() signal is emitted with the success value of the upload |
|
99 * @param images the list image to be uploaded |
|
100 */ |
|
101 void upload(SmfPictureList* images) ; |
|
102 |
|
103 /** |
|
104 * Posts a comment for an image. uploadFinished() signal is emitted |
|
105 * with success of the post once comment is posted. |
|
106 * @param image Image to comment on |
|
107 * @param comment Comment to post |
|
108 */ |
|
109 void postComment(SmfPicture image, SmfComment comment) ; |
|
110 |
|
111 signals: |
|
112 /* |
|
113 * Notification on arrival of list of SmfPicture as a result of request. |
|
114 * Note if number of friends is large, then it can download the list page by page. |
|
115 * In that case this signal is emitted multiple times. |
|
116 * through pictures(). |
|
117 * @param pics Picture list |
|
118 * @param error Error string |
|
119 * @param resultPage Page number info |
|
120 */ |
|
121 void picturesAvailable(SmfPictureList* pics, QString error, SmfResultPage resultPage); |
|
122 |
|
123 /** |
|
124 * Notification of the success of the uploading of image/comment |
|
125 * @param error The upload success result of each individual pictures |
|
126 */ |
|
127 void uploadFinished(QList<bool> error); |
|
128 private: |
|
129 SmfProvider* m_baseProvider; |
|
130 }; |
|
131 |
|
132 SMF_SERVICE_NAME(SmfGallery, "org.symbian.smf.client.gallery\0.2") |
|
133 |
|
134 #endif // SMFGALLERY_H |
|
135 |
|