|
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 SmfGallery::~SmfGallery() |
|
30 { |
|
31 if(m_private) |
|
32 { |
|
33 delete m_private; |
|
34 m_private = NULL; |
|
35 } |
|
36 } |
|
37 |
|
38 /** |
|
39 * Get the picture listing asynchronously. |
|
40 * The picturesAvailable() signal is emitted with SmfPictureList once the pictures have arrived. |
|
41 * When the list is big user can specify the page number and per page item data. |
|
42 * If not supplied by the user default values are used. |
|
43 * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query. |
|
44 * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE |
|
45 */ |
|
46 void SmfGallery::pictures(int pageNum,int perPage) |
|
47 { |
|
48 m_private->pictures(pageNum,perPage); |
|
49 } |
|
50 |
|
51 /** |
|
52 * Returns a user title/caption for the picture |
|
53 */ |
|
54 QString SmfGallery::description(SmfPicture& picture) |
|
55 { |
|
56 m_private->description(picture); |
|
57 } |
|
58 |
|
59 //APIs to get/set base provider info (SmfProvider) |
|
60 |
|
61 /** |
|
62 * Gets the base provider info |
|
63 */ |
|
64 SmfProvider* SmfGallery::getProvider() |
|
65 { |
|
66 return m_baseProvider; |
|
67 } |
|
68 |
|
69 /** |
|
70 * Upload an image.Implemented as slot to connect to UI controls more easily |
|
71 * uploadFinished() signal is emitted with the success value of the upload |
|
72 * @param image the image to be uploaded |
|
73 */ |
|
74 void SmfGallery::upload(SmfPicture* image) |
|
75 { |
|
76 m_private->upload(image); |
|
77 } |
|
78 |
|
79 /** |
|
80 * Upload an list image.Implemented as slot to connect to UI controls more easily |
|
81 * uploadFinished() signal is emitted with the success value of the upload |
|
82 * @param images the list image to be uploaded |
|
83 */ |
|
84 void SmfGallery::upload(SmfPictureList* images) |
|
85 { |
|
86 m_private->upload(images); |
|
87 } |
|
88 |
|
89 /** |
|
90 * Posts a comment for an image. uploadFinished() signal is emitted |
|
91 * with success of the post once comment is posted. |
|
92 * @param image Image to comment on |
|
93 * @param comment Comment to post |
|
94 */ |
|
95 void SmfGallery::postComment(SmfPicture image, SmfComment comment) |
|
96 { |
|
97 m_private->postComment(image,comment); |
|
98 } |
|
99 |