25
|
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 |
* Nalina Hariharan
|
|
14 |
*
|
|
15 |
* Description:
|
|
16 |
* Private implementation of events related services
|
|
17 |
*
|
|
18 |
*/
|
|
19 |
|
|
20 |
#ifndef SMFEVENTSFETCHER_P_H_
|
|
21 |
#define SMFEVENTSFETCHER_P_H_
|
|
22 |
|
|
23 |
#include <smfglobal.h>
|
|
24 |
#include <smfobserver.h>
|
|
25 |
#include <smfevent.h>
|
|
26 |
#include <smflocation.h>
|
|
27 |
#include <smfprovider.h>
|
|
28 |
|
|
29 |
class SmfEventsFetcher;
|
|
30 |
|
|
31 |
#ifdef Q_OS_SYMBIAN
|
|
32 |
class CSmfClientSymbian;
|
|
33 |
#else
|
|
34 |
class SmfClientQt;
|
|
35 |
#endif
|
|
36 |
|
|
37 |
class SmfEventsFetcherPrivate : public smfObserver
|
|
38 |
{
|
|
39 |
Q_OBJECT
|
|
40 |
|
|
41 |
public:
|
|
42 |
/**
|
|
43 |
* Constructs SmfEventsFetcher with base provider info
|
|
44 |
*/
|
|
45 |
SmfEventsFetcherPrivate(SmfEventsFetcher* aEventFetcher);
|
|
46 |
|
|
47 |
/**
|
|
48 |
* Destructor
|
|
49 |
*/
|
|
50 |
~SmfEventsFetcherPrivate();
|
|
51 |
|
|
52 |
public:
|
|
53 |
/**
|
|
54 |
* Gets list of events in a particular venue asynchronously.
|
|
55 |
* eventsAvailable() signal is emitted with SmfEventsList once its arrived.
|
|
56 |
* When the list is big user can specify the page number and per page item data.
|
|
57 |
* If not supplied by the user default values are used.
|
|
58 |
* @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
|
|
59 |
* @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
|
|
60 |
* @return SmfNoError if success, else appropriate error value
|
|
61 |
*/
|
|
62 |
SmfError events ( SmfLocation venue, int pageNum = SMF_FIRST_PAGE,
|
|
63 |
int perPage = SMF_ITEMS_PER_PAGE);
|
|
64 |
|
|
65 |
/**
|
|
66 |
* Gets list of venues of a particular location asynchronously.
|
|
67 |
* venuesAvailable() signal is emitted with SmfLocationList once its arrived.
|
|
68 |
* When the list is big user can specify the page number and per page item data.
|
|
69 |
* If not supplied by the user default values are used.
|
|
70 |
* @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
|
|
71 |
* @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
|
|
72 |
* @return SmfNoError if success, else appropriate error value
|
|
73 |
*/
|
|
74 |
SmfError venues ( SmfLocation location, int pageNum = SMF_FIRST_PAGE,
|
|
75 |
int perPage = SMF_ITEMS_PER_PAGE);
|
|
76 |
|
|
77 |
|
|
78 |
/**
|
|
79 |
* Gets a list of attendees to the event
|
|
80 |
* attendeesAvailable() signal is emitted with SmfContacts for the users attending this event
|
|
81 |
* @param event
|
|
82 |
* @param pageNum Page number to download, SMF_FIRST_PAGE denotes fresh query.
|
|
83 |
* @param perPage Item per page, default is SMF_ITEMS_PER_PAGE
|
|
84 |
* @return SmfNoError if success, else appropriate error value
|
|
85 |
*/
|
|
86 |
SmfError attendees(SmfEvent event, int pageNum = SMF_FIRST_PAGE,
|
|
87 |
int perPage = SMF_ITEMS_PER_PAGE);
|
|
88 |
|
|
89 |
/**
|
|
90 |
* Updates events. Might not be supported by all service provider.
|
|
91 |
* eventsUpdated() signal can be checked for success value.
|
|
92 |
* @param SmfEventsList List of events to be posted
|
|
93 |
* @return SmfNoError if success, else appropriate error value
|
|
94 |
*/
|
|
95 |
SmfError postEvents ( SmfEventList events );
|
|
96 |
|
|
97 |
/**
|
|
98 |
* Request for a custom operation. The signal customDataAvailable() is emitted
|
|
99 |
* when the result is available.
|
|
100 |
* @param operationId OperationId
|
|
101 |
* @param customData Custom data to be sent
|
|
102 |
* @return SmfNoError if success, else appropriate error value
|
|
103 |
* Note:-Interpretation of operationId and customData is upto the concerned
|
|
104 |
* plugin and client application. service provider should provide some
|
|
105 |
* serializing-deserializing utilities for these custom data
|
|
106 |
*/
|
|
107 |
SmfError customRequest ( const int& operationId, QByteArray* customData );
|
|
108 |
|
|
109 |
/**
|
|
110 |
* Cancels a request generated due to the call to any API which results
|
|
111 |
* into http request. Might return error if no request is currently pending.
|
|
112 |
* Please note that there can be only one request pending at any point of time
|
|
113 |
* @return Appropriate SmfError value
|
|
114 |
*/
|
|
115 |
SmfError cancelRequest ();
|
|
116 |
|
|
117 |
public: //From smfObserver
|
|
118 |
/**
|
|
119 |
* To notify availibility of asynchronous requests.
|
|
120 |
* @param result Requested result, before using must check error param.
|
|
121 |
* @param opcode Requested opcode, for which the result has arrived.
|
|
122 |
* @param error Error
|
|
123 |
*/
|
|
124 |
void resultsAvailable(QByteArray result,SmfRequestTypeID opcode, SmfError error);
|
|
125 |
|
|
126 |
private:
|
|
127 |
SmfEventsFetcher* m_eventFetcher;
|
|
128 |
//serialized byte array of provider+other info to be sent to the server
|
|
129 |
//The order:- SmfProvider then params in order of their appearance in fn
|
|
130 |
QByteArray m_serializedDataToServer;
|
|
131 |
#ifdef Q_OS_SYMBIAN
|
|
132 |
CSmfClientSymbian* m_SmfClientPrivate;
|
|
133 |
friend class CSmfClientSymbian;
|
|
134 |
#else
|
|
135 |
SmfClientQt* m_SmfClientPrivate;
|
|
136 |
friend class SmfClientQt;
|
|
137 |
#endif
|
|
138 |
quint8 m_argFlag;
|
|
139 |
|
|
140 |
};
|
|
141 |
|
|
142 |
#endif /* SMFEVENTSFETCHER_P_H_ */
|