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 * Private Qt wrapper |
|
21 * Provided to accomodate diff facilities in diff platforms. |
|
22 * Uses Symbian client-server for Symbian |
|
23 * QDbus for linux |
|
24 * QLocalserver for rest of the platforms |
|
25 * Note:- only symbian client-server impl is provided at the moment |
|
26 **/ |
|
27 #ifndef SMFGALLERY_P_H |
|
28 #define SMFGALLERY_P_H |
|
29 |
|
30 #include "smfprovider.h" |
|
31 #include "SmfClientGlobal.h" |
|
32 #include "smfGlobal.h" |
|
33 #include "SmfObserver.h" |
|
34 |
|
35 class SmfProvider; |
|
36 |
|
37 |
|
38 #include <QObject> |
|
39 #include <QDateTime> |
|
40 #include <QStringList> |
|
41 |
|
42 #include "SmfObserver.h" |
|
43 #include "smfgallery.h" |
|
44 #ifdef Q_OS_SYMBIAN |
|
45 class CSmfClientSymbian; |
|
46 #else |
|
47 class SmfClientQt; |
|
48 #endif |
|
49 class SmfGalleryPrivate : public smfObserver |
|
50 { |
|
51 Q_OBJECT |
|
52 |
|
53 public: |
|
54 |
|
55 SmfGalleryPrivate(SmfGallery* gallery=0); |
|
56 ~SmfGalleryPrivate(); |
|
57 |
|
58 /** |
|
59 * Get the album listing asynchronously. |
|
60 * The albumsAvailable() signal is emitted with SmfPictureAlbumList once the albums have arrived. |
|
61 * When the list is big user can specify the page number and per page item data. |
|
62 * If not supplied by the user default values are used. |
|
63 * @param names the subject or any keywords to be used to filter albums with that name |
|
64 * @param user the user whose albums are requested |
|
65 * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query. |
|
66 * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE |
|
67 */ |
|
68 void albums(QStringList names, SmfContact* user, int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE); |
|
69 |
|
70 |
|
71 /** |
|
72 * Get the picture listing asynchronously. |
|
73 * The picturesAvailable() signal is emitted with SmfPictureList once the pictures have arrived. |
|
74 * When the list is big user can specify the page number and per page item data. |
|
75 * If not supplied by the user default values are used. |
|
76 * @param albums album(s) whose pictures are being requested |
|
77 * @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query. |
|
78 * @param perPage Item per page, default is SMF_ITEMS_PER_PAGE |
|
79 */ |
|
80 void pictures(SmfPictureAlbumList albums, int pageNum=SMF_FIRST_PAGE,int perPage=SMF_ITEMS_PER_PAGE); |
|
81 |
|
82 /** |
|
83 * Upload an image.Implemented as slot to connect to UI controls more easily |
|
84 * uploadFinished() signal is emitted with the success value of the upload |
|
85 * @param image the image to be uploaded |
|
86 * @param album the optional destination album name |
|
87 */ |
|
88 void upload(SmfPicture* image, SmfPictureAlbum* album=NULL) ; |
|
89 |
|
90 /** |
|
91 * Upload an list image.Implemented as slot to connect to UI controls more easily |
|
92 * uploadFinished() signal is emitted with the success value of the upload |
|
93 * @param images the list image to be uploaded |
|
94 * @param album the optional destination album name |
|
95 */ |
|
96 void upload(SmfPictureList* images, SmfPictureAlbum* album=NULL) ; |
|
97 |
|
98 /** |
|
99 * Posts a comment for an image. uploadFinished() signal is emitted |
|
100 * with success of the post once comment is posted. |
|
101 * @param image Image to comment on |
|
102 * @param comment Comment to post |
|
103 */ |
|
104 void postComment(SmfPicture image, SmfComment comment) ; |
|
105 |
|
106 /** from smfobserver */ |
|
107 void resultsAvailable(QByteArray result,SmfRequestTypeID opcode,SmfError error); |
|
108 |
|
109 |
|
110 private: |
|
111 SmfProvider* m_baseProvider; |
|
112 //serialized byte array of provider+other info to be sent to the server |
|
113 //The order:- SmfProvider then params in order of their appearance in fn |
|
114 QByteArray m_serializedDataToServer; |
|
115 //serialized xtra info, order of serialization follows order of param |
|
116 QByteArray m_xtraInfoSerialized; |
|
117 #ifdef Q_OS_SYMBIAN |
|
118 CSmfClientSymbian* m_SmfClientPrivate; |
|
119 friend class CSmfClientSymbian; |
|
120 #else |
|
121 SmfClientQt* m_SmfClientPrivate; |
|
122 friend class SmfClientQt; |
|
123 #endif |
|
124 bool m_connected; |
|
125 SmfGallery* m_gallery; |
|
126 SmfPictureList* m_picList; |
|
127 int m_xtraInfoFlag; |
|
128 int m_pageInfoFlag; |
|
129 void writeLog(QString log) const{}; |
|
130 |
|
131 }; |
|
132 #endif |
|
133 |
|
134 |
|
135 |
|
136 |
|
137 |
|
138 |
|