|
1 /* |
|
2 * Copyright (c) 2002 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: Startup place for client & server, message handling. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef WIMCLIENT_H |
|
20 #define WIMCLIENT_H |
|
21 |
|
22 // INCLUDES |
|
23 #include "WimClsv.h" |
|
24 #include <f32file.h> |
|
25 #include <e32base.h> |
|
26 |
|
27 //FORWARD DECLARATIONS |
|
28 class TWIMSrvStartSignal; |
|
29 |
|
30 //The number of message slots represents the number of operations that |
|
31 //can be outstanding at once. If you wish to have more asynchronous operations |
|
32 //outstanding than this, use more message slots. |
|
33 //You should always provide an extra slot for the cancel operation. |
|
34 const TInt KMessageSlotsNum = 5; |
|
35 |
|
36 |
|
37 // CLASS DECLARATION |
|
38 |
|
39 /** |
|
40 * RWimClient, this creates new connection to server and sends |
|
41 * syncronous & asyncronous messages to server. |
|
42 * |
|
43 * @lib WimClient |
|
44 * @since Series 60 2.1 |
|
45 */ |
|
46 class RWimClient: public RSessionBase |
|
47 { |
|
48 public: |
|
49 |
|
50 /** |
|
51 * Constructor |
|
52 */ |
|
53 RWimClient(); |
|
54 |
|
55 /** |
|
56 * Destructor |
|
57 */ |
|
58 virtual ~RWimClient(); |
|
59 |
|
60 /** |
|
61 * Connect to WIMI server |
|
62 * @return TInt |
|
63 */ |
|
64 TInt Connect(); |
|
65 |
|
66 /** |
|
67 * Starts Server |
|
68 * @return TInt -error code |
|
69 */ |
|
70 TInt StartWim(); |
|
71 |
|
72 |
|
73 /** |
|
74 * Sends initialization command to Server. |
|
75 * @param aStatus -Client status |
|
76 * @return void |
|
77 */ |
|
78 void Initialize( TRequestStatus& aStatus ); |
|
79 |
|
80 /** |
|
81 * Cancel initialization command to Server. |
|
82 * @return void |
|
83 */ |
|
84 void CancelInitialize(); |
|
85 |
|
86 /** |
|
87 * Return version |
|
88 * @return TVersion |
|
89 */ |
|
90 TVersion Version() const; |
|
91 |
|
92 /** |
|
93 * Sends data synchronoysly to server |
|
94 * @param aFn the WIMRequest operation |
|
95 * @param aIpcArgs IPC parameters |
|
96 * @return TInt |
|
97 */ |
|
98 TInt SendReceiveData( TWimServRqst aFn, TIpcArgs& aIpcArcs ); |
|
99 |
|
100 /** |
|
101 * Sends data asynchronoysly to server |
|
102 * @param aFn the WIMRequest operation |
|
103 * @param aIpcArgs IPC parameters |
|
104 * @param aStatus -Caller's status |
|
105 * @return void |
|
106 */ |
|
107 void SendReceiveData( TWimServRqst aFn, |
|
108 TIpcArgs& aIpcArgs, |
|
109 TRequestStatus& aStatus ); |
|
110 |
|
111 /** |
|
112 * Free the address list |
|
113 * @param addrLst -Address of a list to be freed |
|
114 * @return void |
|
115 */ |
|
116 void FreeAddrLst( const TUint32 addrLst ); |
|
117 |
|
118 /** |
|
119 * Free the address list |
|
120 * @param addrLst -Reference to WIMI |
|
121 * @param aSize -Size to be freed |
|
122 * return void |
|
123 */ |
|
124 void FreeWIMAddrLst( const TWimAddressList addrLst, const TUint aSize ); |
|
125 |
|
126 /** |
|
127 * Free the address list |
|
128 * @param aAddr -Referece to WIMI |
|
129 * return void |
|
130 */ |
|
131 void FreeWIMAddr( const TWimAddress aAddr ); |
|
132 |
|
133 |
|
134 private: |
|
135 |
|
136 |
|
137 /** |
|
138 * Return the name of the Wim server file |
|
139 * @param aServer -descriptor for server filename |
|
140 * @return TInt -error code |
|
141 */ |
|
142 TInt FindServerFileName( TFileName& aServer ); |
|
143 |
|
144 |
|
145 private: |
|
146 |
|
147 /** |
|
148 * Copy constructor |
|
149 * @param aSource -Reference to class object. |
|
150 */ |
|
151 RWimClient( const RWimClient& aSource ); |
|
152 |
|
153 /** |
|
154 * Assigment operator |
|
155 * @param aParam -Reference to class object. |
|
156 */ |
|
157 RWimClient& operator = ( const RWimClient& aParam ); |
|
158 |
|
159 |
|
160 |
|
161 |
|
162 }; |
|
163 |
|
164 #endif |