|
1 /* |
|
2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "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 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CCCLIENTSESSION_H |
|
19 #define CCCLIENTSESSION_H |
|
20 |
|
21 // System includes |
|
22 #include <e32base.h> |
|
23 |
|
24 // Forward declarations |
|
25 |
|
26 /** |
|
27 * Content control server client side session |
|
28 * |
|
29 * |
|
30 * @code |
|
31 * |
|
32 * @endcode |
|
33 * |
|
34 * @lib hsccsrv.lib |
|
35 * @since S60 v5.0 |
|
36 */ |
|
37 class RCcClientSession : public RSessionBase |
|
38 { |
|
39 protected: |
|
40 /** |
|
41 * Connect. |
|
42 * |
|
43 * @since S60 5.0 |
|
44 * @return Symbian error code. |
|
45 */ |
|
46 IMPORT_C TInt Connect(); |
|
47 |
|
48 /** |
|
49 * Close. |
|
50 * |
|
51 * @since S60 5.0 |
|
52 */ |
|
53 IMPORT_C void Close(); |
|
54 |
|
55 /** |
|
56 * Registers content control API provider |
|
57 * @param aProvider Provider id |
|
58 * @param aAddress Registered address of service provider |
|
59 * @return KErrNone if registration succeeded |
|
60 * Symbian error code if registration fails |
|
61 * @since S60 5.0 |
|
62 */ |
|
63 IMPORT_C TInt RegisterProvider( |
|
64 TPckgBuf<TUint32>& aProvider, |
|
65 TPckgBuf<TUint32>& aAddress ); |
|
66 |
|
67 /** |
|
68 * Registers content control API observer |
|
69 * @param aProvider Provider id |
|
70 * @param aAddress Registered address of observer |
|
71 * @return KErrNone if registration succeeded |
|
72 * Symbian error code if registration fails |
|
73 * @since S60 5.0 |
|
74 */ |
|
75 IMPORT_C TInt RegisterObserver( |
|
76 TPckgBuf<TUint32>& aProvider, |
|
77 TPckgBuf<TUint32>& aAddress ); |
|
78 |
|
79 /** |
|
80 * Cancels outstanding async request |
|
81 * @param aFunction Canceled function |
|
82 * @return KErrNone if registration succeeded |
|
83 * Symbian error code if registration fails |
|
84 * @since S60 5.0 |
|
85 */ |
|
86 IMPORT_C TInt CancelReq( |
|
87 TPckgBuf<TInt>& aFunction ); |
|
88 |
|
89 /** |
|
90 * Starts receiving API requests |
|
91 * @param aProvider Provider id |
|
92 * @param aSender Sender of Api request |
|
93 * @param aReceiver Service provider |
|
94 * @param aBuf Message buffer for received API request header |
|
95 * @param aStatus Completion status for IPC request |
|
96 * @since S60 5.0 |
|
97 */ |
|
98 IMPORT_C void WaitForApiReq( |
|
99 TPckgBuf<TUint32>& aProvider, |
|
100 TPckgBuf<TUint32>& aSender, |
|
101 TPckgBuf<TUint32>& aReceiver, |
|
102 TPtr8& aBuf, |
|
103 TRequestStatus& aStatus ); |
|
104 |
|
105 /** |
|
106 * Starts receiving API notifications |
|
107 * @param aProvider Provider id |
|
108 * @param aSender Sender of Api request |
|
109 * @param aReceiver Service provider |
|
110 * @param aBuf Message buffer for received API notification header |
|
111 * @param aStatus Completion status for IPC request |
|
112 * @since S60 5.0 |
|
113 */ |
|
114 IMPORT_C void WaitForApiNtf( |
|
115 TPckgBuf<TUint32>& aProvider, |
|
116 TPckgBuf<TUint32>& aSender, |
|
117 TPckgBuf<TUint32>& aReceiver, |
|
118 TPtr8& aBuf, |
|
119 TRequestStatus& aStatus ); |
|
120 |
|
121 /** |
|
122 * Sends API request/response to Home screen content control server |
|
123 * @param aFunction IPC function EHsCcApiReq/EHsCcApiResp |
|
124 * @param aProvider Provider id |
|
125 * @param aSender Sender of Api request |
|
126 * @param aReceiver Service provider |
|
127 * @param aBuf Message buffer: |
|
128 * in: service request |
|
129 * out: service response header |
|
130 * @return KErrNone if sending succeeded |
|
131 * Symbian error code if sending fails |
|
132 * @since S60 5.0 |
|
133 */ |
|
134 IMPORT_C TInt Send( |
|
135 TInt aFunction, |
|
136 TPckgBuf<TUint32>& aProvider, |
|
137 TPckgBuf<TUint32>& aSender, |
|
138 TPckgBuf<TUint32>& aReceiver, |
|
139 TPtr8& aBuf ); |
|
140 |
|
141 /** |
|
142 * Reads message data |
|
143 * @param aTrId Transaction id |
|
144 * @param aBuf Data buffer |
|
145 * @return KErrNone if reading succeeded |
|
146 * Symbian error code if reading fails |
|
147 * @since S60 5.0 |
|
148 */ |
|
149 IMPORT_C TInt GetMsgData( |
|
150 TPckgBuf<TUint32>& aTrId, |
|
151 TPtr8& aBuf ); |
|
152 |
|
153 public: |
|
154 friend class CHsCcProviderClient; |
|
155 friend class CHsCcApiClient; |
|
156 |
|
157 }; |
|
158 |
|
159 |
|
160 #endif // CCCLIENTSESSION_H |
|
161 |
|
162 // End of file |