|
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: Storage main client |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef __RPENGSTORAGECLIENT_H__ |
|
19 #define __RPENGSTORAGECLIENT_H__ |
|
20 |
|
21 // INCLUDES |
|
22 #include <e32std.h> |
|
23 |
|
24 /** |
|
25 * Storage Main client |
|
26 * It is used for connecting of the storage sub-clients |
|
27 * |
|
28 * @lib PEngStoreMan2.dll |
|
29 * @since 3.0 |
|
30 */ |
|
31 |
|
32 // CLASS DECLARATION |
|
33 NONSHARABLE_CLASS( RPEngStorageClient ): |
|
34 public RSessionBase |
|
35 { |
|
36 |
|
37 public: // Constructors and destructors |
|
38 /** |
|
39 * Destructor. |
|
40 */ |
|
41 ~RPEngStorageClient(); |
|
42 |
|
43 /** |
|
44 * C++ default constructor. |
|
45 */ |
|
46 RPEngStorageClient(); |
|
47 |
|
48 public: // Connect close methods |
|
49 |
|
50 /** |
|
51 * Connects to the presence server |
|
52 * |
|
53 * @since 3.0 |
|
54 * @return KErrNone if connected |
|
55 * or any of system wide error codes |
|
56 */ |
|
57 TInt Connect(); |
|
58 |
|
59 /** |
|
60 * Close connection to the presence server |
|
61 * |
|
62 * @since 3.0 |
|
63 */ |
|
64 void Close(); |
|
65 |
|
66 public: // new methods for Client usage |
|
67 |
|
68 /** |
|
69 * Get Session Slot state |
|
70 * |
|
71 * @since 3.0 |
|
72 * @param aSessionName packed session slot Id |
|
73 * @param aSessionState on returns contain packed session slot |
|
74 * state |
|
75 * @return KErrNone if request went through, or system wide error |
|
76 */ |
|
77 TInt SessionSlotState( const TDesC8& aSessionName, |
|
78 HBufC8*& aSessionState, |
|
79 TInt aInitSize ); |
|
80 |
|
81 /** |
|
82 * Get list of States of all known Session Slots |
|
83 * |
|
84 * @since 3.0 |
|
85 * @param aSessionSlotsBuffer on return contact packed session |
|
86 * slot states of all available session slots |
|
87 * @return KErrNone if request went through, or system wide error |
|
88 */ |
|
89 TInt AllSessionSlotsStates( HBufC8*& aSessionSlotsBuffer, |
|
90 TInt aInitSize ); |
|
91 |
|
92 /** |
|
93 * Start listening global Events of the storage manager |
|
94 * |
|
95 * @since 3.0 |
|
96 * @return KErrNone if request went through, or system wide error |
|
97 */ |
|
98 TInt ListenGlobalEvents(); |
|
99 |
|
100 /** |
|
101 * Reload global listener |
|
102 * |
|
103 * @since 3.0 |
|
104 * @param aGlobalEventBuffer buffer new event will be written |
|
105 * when it occures. |
|
106 * @param aStatus TRequestStatus for reloading |
|
107 * @return KErrNone if request went through, or system wide error |
|
108 */ |
|
109 TInt ReloadGlobalEventListener( TDes8& aGlobalEventBuffer, |
|
110 TRequestStatus& aStatus ); |
|
111 |
|
112 /** |
|
113 * Stop global events listener |
|
114 * |
|
115 * @since 3.0 |
|
116 * @return KErrNone if request went through, or system wide error |
|
117 */ |
|
118 TInt StopEventListening(); |
|
119 |
|
120 /** |
|
121 * Create Session Sub-folder to the storage manager store |
|
122 * |
|
123 * @since 3.0 |
|
124 * @param aSessionName packed session slot Id |
|
125 * @param aApplicationId application Id |
|
126 * @return KErrNone if request went through, or system wide error |
|
127 */ |
|
128 TInt CreateSessionFolder( const TDesC8& aSessionSlot, |
|
129 const TDesC16& aApplicationId ); |
|
130 |
|
131 /** |
|
132 * Remove Session Sub-folder in the storage manager store |
|
133 * |
|
134 * @since 3.0 |
|
135 * @param aSessionName packed session slot Id |
|
136 * @param aApplicationId application Id |
|
137 * @return KErrNone if request went through, or system wide error |
|
138 */ |
|
139 TInt RemoveSessionFolder( const TDesC8& aSessionSlot, |
|
140 const TDesC16& aApplicationId ); |
|
141 |
|
142 private: // New functions |
|
143 |
|
144 /** |
|
145 * Get version |
|
146 * @since 3.0 |
|
147 * @return version of the client |
|
148 */ |
|
149 TVersion Version() const; |
|
150 |
|
151 private: // Data |
|
152 |
|
153 /// Flag if client is connected to the Storage Server |
|
154 TBool iConnected ; |
|
155 |
|
156 }; |
|
157 |
|
158 #endif // __RPENGSTORAGECLIENT_H__ |
|
159 |
|
160 |
|
161 |