|
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 SmfGallery class |
|
17 * |
|
18 */ |
|
19 |
|
20 #include "smfgallery.h" |
|
21 #include "smfgallery_p.h" |
|
22 |
|
23 |
|
24 SmfGallery::SmfGallery(SmfProvider* baseprovider):m_baseProvider(baseprovider) |
|
25 { |
|
26 //creating private impl wrapper |
|
27 m_private = new SmfGalleryPrivate(this); |
|
28 } |
|
29 |
|
30 SmfGallery::~SmfGallery() |
|
31 { |
|
32 if(m_private) |
|
33 { |
|
34 delete m_private; |
|
35 m_private = NULL; |
|
36 } |
|
37 } |
|
38 |
|
39 /** |
|
40 * Get the album listing asynchronously. The albumsAvailable() signal is |
|
41 * emitted with SmfPictureAlbumList once the albums have arrived. |
|
42 * When the list is big user can specify the page number and per page item data. |
|
43 * If not supplied by the user default values are used. |
|
44 * @param names the subject or any keywords to be used to filter albums with that name |
|
45 * @param user the user whose albums are requested |
|
46 * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query. |
|
47 * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE |
|
48 */ |
|
49 void SmfGallery::albums(QStringList names, SmfContact* user, int pageNum, int perPage) |
|
50 { |
|
51 m_private->albums(names,user, pageNum, perPage); |
|
52 } |
|
53 |
|
54 /** |
|
55 * Get the picture listing asynchronously. The picturesAvailable() signal is |
|
56 * emitted with SmfPictureList once the pictures have arrived. |
|
57 * When the list is big user can specify the page number and per page item data. |
|
58 * If not supplied by the user default values are used. |
|
59 * @param albums album(s) whose pictures are being requested |
|
60 * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query. |
|
61 * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE |
|
62 */ |
|
63 void SmfGallery::pictures(SmfPictureAlbumList &albums, int pageNum, int perPage) |
|
64 { |
|
65 m_private->pictures( albums, pageNum, perPage); |
|
66 } |
|
67 |
|
68 |
|
69 /** |
|
70 * Returns a user title/caption for the picture |
|
71 */ |
|
72 void SmfGallery::description ( SmfPicture& picture ) |
|
73 { |
|
74 m_private->description(picture); |
|
75 } |
|
76 |
|
77 /** |
|
78 * Upload an image.Implemented as slot to connect to UI controls more easily |
|
79 * uploadFinished() signal is emitted with the success value of the upload |
|
80 * @param image the image to be uploaded |
|
81 * @param album the optional destination album name |
|
82 */ |
|
83 void SmfGallery::upload(SmfPicture* image, SmfPictureAlbum* album) |
|
84 { |
|
85 m_private->upload(image,album); |
|
86 } |
|
87 |
|
88 /** |
|
89 * Upload an list image.Implemented as slot to connect to UI controls more easily |
|
90 * uploadFinished() signal is emitted with the success value of the upload |
|
91 * @param images the list image to be uploaded |
|
92 * @param album the optional destination album name |
|
93 */ |
|
94 void SmfGallery::upload(SmfPictureList* images, SmfPictureAlbum* album) |
|
95 { |
|
96 m_private->upload(images,album); |
|
97 } |
|
98 |
|
99 /** |
|
100 * Posts a comment for an image. uploadFinished() signal is emitted |
|
101 * with success of the post once comment is posted. |
|
102 * @param image Image to comment on |
|
103 * @param comment Comment to post |
|
104 */ |
|
105 void SmfGallery::postComment(SmfPicture image, SmfComment comment) |
|
106 { |
|
107 m_private->postComment(image,comment); |
|
108 } |
|
109 |
|
110 /** |
|
111 * Request for a custom operation. |
|
112 * @param operationId OperationId |
|
113 * @param customData Custom data to be sent |
|
114 * Note:-Interpretation of operationId and customData is upto the concerned |
|
115 * plugin and client application. service provider should provide some |
|
116 * serializing-deserializing utilities for these custom data |
|
117 */ |
|
118 void SmfGallery::customRequest(const int& operationId,QByteArray* customData) |
|
119 { |
|
120 m_private->customRequest(operationId, customData); |
|
121 } |
|
122 |
|
123 /** |
|
124 * Gets the base provider info |
|
125 */ |
|
126 SmfProvider* SmfGallery::getProvider() const |
|
127 { |
|
128 return m_baseProvider; |
|
129 } |