|
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 * Private implementation for SmfGallery class |
|
17 * |
|
18 */ |
|
19 |
|
20 #ifndef SMFGALLERY_P_H |
|
21 #define SMFGALLERY_P_H |
|
22 |
|
23 #include <smfclientglobal.h> |
|
24 #include <smfglobal.h> |
|
25 #include <smfobserver.h> |
|
26 #include <smfpicture.h> |
|
27 #include <smfpicturealbum.h> |
|
28 |
|
29 // Forward Declarations |
|
30 class SmfProvider; |
|
31 class SmfGallery; |
|
32 class SmfContact; |
|
33 class SmfComment; |
|
34 #ifdef Q_OS_SYMBIAN |
|
35 class CSmfClientSymbian; |
|
36 #else |
|
37 class SmfClientQt; |
|
38 #endif |
|
39 |
|
40 |
|
41 /** |
|
42 * Private Qt wrapper |
|
43 * Provided to accomodate diff facilities in diff platforms. |
|
44 * Uses Symbian client-server for Symbian |
|
45 * QDbus for linux |
|
46 * QLocalserver for rest of the platforms |
|
47 * Note:- only symbian client-server impl is provided at the moment |
|
48 **/ |
|
49 class SmfGalleryPrivate : public smfObserver |
|
50 { |
|
51 Q_OBJECT |
|
52 |
|
53 public: |
|
54 /** |
|
55 * Constructor |
|
56 */ |
|
57 SmfGalleryPrivate(SmfGallery* gallery = 0); |
|
58 |
|
59 /** |
|
60 * Destructor |
|
61 */ |
|
62 ~SmfGalleryPrivate(); |
|
63 |
|
64 /** |
|
65 * Get the album listing asynchronously. The albumsAvailable() signal is |
|
66 * emitted with SmfPictureAlbumList once the albums have arrived. |
|
67 * When the list is big user can specify the page number and per page item data. |
|
68 * If not supplied by the user default values are used. |
|
69 * @param names the subject or any keywords to be used to filter albums with that name |
|
70 * @param user the user whose albums are requested |
|
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 albums ( QStringList names, SmfContact* user, |
|
75 int pageNum = SMF_FIRST_PAGE, |
|
76 int perPage = SMF_ITEMS_PER_PAGE ); |
|
77 |
|
78 /** |
|
79 * Get the picture listing asynchronously. The picturesAvailable() signal is |
|
80 * emitted with SmfPictureList once the pictures have arrived. |
|
81 * When the list is big user can specify the page number and per page item data. |
|
82 * If not supplied by the user default values are used. |
|
83 * @param albums album(s) whose pictures are being requested |
|
84 * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query. |
|
85 * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE |
|
86 */ |
|
87 void pictures ( SmfPictureAlbumList &albums, |
|
88 int pageNum = SMF_FIRST_PAGE, |
|
89 int perPage = SMF_ITEMS_PER_PAGE ); |
|
90 |
|
91 /** |
|
92 * Returns a user title/caption for the picture |
|
93 */ |
|
94 void description ( SmfPicture& picture ); |
|
95 |
|
96 /** |
|
97 * Upload an 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 image the image to be uploaded |
|
100 * @param album the optional destination album name |
|
101 */ |
|
102 void upload ( SmfPicture* image, SmfPictureAlbum* album = NULL ); |
|
103 |
|
104 /** |
|
105 * Upload an list image.Implemented as slot to connect to UI controls more easily |
|
106 * uploadFinished() signal is emitted with the success value of the upload |
|
107 * @param images the list image to be uploaded |
|
108 * @param album the optional destination album name |
|
109 */ |
|
110 void upload ( SmfPictureList* images, SmfPictureAlbum* album = NULL ); |
|
111 |
|
112 /** |
|
113 * Posts a comment for an image. uploadFinished() signal is emitted |
|
114 * with success of the post once comment is posted. |
|
115 * @param image Image to comment on |
|
116 * @param comment Comment to post |
|
117 */ |
|
118 void postComment ( SmfPicture image, SmfComment comment ); |
|
119 |
|
120 /** |
|
121 * Request for a custom operation. |
|
122 * @param operationId OperationId |
|
123 * @param customData Custom data to be sent |
|
124 * Note:-Interpretation of operationId and customData is upto the concerned |
|
125 * plugin and client application. service provider should provide some |
|
126 * serializing-deserializing utilities for these custom data |
|
127 */ |
|
128 void customRequest ( const int& operationId, QByteArray* customData ); |
|
129 |
|
130 public:// from smfobserver |
|
131 /** |
|
132 * To notify availibility of asynchronous requests. |
|
133 * @param result Requested result, before using must check error param. |
|
134 * @param opcode Requested opcode, for which the result has arrived. |
|
135 * @param error Error |
|
136 */ |
|
137 void resultsAvailable(QByteArray result,SmfRequestTypeID opcode,SmfError error); |
|
138 |
|
139 private: |
|
140 SmfGallery* m_gallery; |
|
141 QByteArray m_serializedDataToServer;//serialized byte array of provider+other info to be sent to the server |
|
142 int m_argFlag; |
|
143 #ifdef Q_OS_SYMBIAN |
|
144 CSmfClientSymbian* m_SmfClientPrivate; |
|
145 friend class CSmfClientSymbian; |
|
146 #else |
|
147 SmfClientQt* m_SmfClientPrivate; |
|
148 friend class SmfClientQt; |
|
149 #endif |
|
150 |
|
151 }; |
|
152 |
|
153 #endif // SMFGALLERY_P_H |