|
1 /* |
|
2 * Copyright (c) 2006-2006 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: Common client-server header file for the Preset Server |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef PSCOMMON_H |
|
20 #define PSCOMMON_H |
|
21 |
|
22 #include <e32std.h> |
|
23 #include <pspresetobserver.h> |
|
24 |
|
25 const TInt KPSVersionMajor = 1; /**< Major version number of the server. */ |
|
26 const TInt KPSVersionMinor = 0; /**< Minor version number of the server. */ |
|
27 const TInt KPSVersionBuild = 0; /**< Build version number of the server. */ |
|
28 |
|
29 _LIT( KPSServerExe, "psserver.exe" ); /**< Name of the preset server executable. */ |
|
30 _LIT( KPSServerName, "PresetServer" ); /**< Name of the preset server process. */ |
|
31 |
|
32 /** |
|
33 * Notification package struct. |
|
34 * |
|
35 * Used when a preset change notification is requested or completed. |
|
36 */ |
|
37 typedef struct |
|
38 { |
|
39 /** Identifier of the preset the observer is interested in, or <code>KErrNotFound</code> if all changes should be notified. */ |
|
40 TInt iId; |
|
41 /** Data handler of the preset (UID of the ECom plugin that handles this kind of presets). */ |
|
42 TUid iDataHandler; |
|
43 /** Reason for the change. */ |
|
44 MPSPresetObserver::TPSReason iReason; |
|
45 /** Unique identifier for the notification. */ |
|
46 TUint64 iNotificationId; |
|
47 /** Universal time for this notification's origin. This is not used in the client-server communication and can be omitted. */ |
|
48 TTime iNotificationTime; |
|
49 } TPSNotifyDataPackage; |
|
50 |
|
51 /** |
|
52 * Client-server operation codes. |
|
53 */ |
|
54 enum TPSOpCode |
|
55 { |
|
56 |
|
57 /** |
|
58 * Creates a new preset. |
|
59 * |
|
60 * Parameters: |
|
61 * [IN] Int0 Index of the preset to create. |
|
62 * [IN] Int1 Data handler of the preset to create. |
|
63 * [OUT] Int2 Id of the preset that was created. |
|
64 */ |
|
65 EPSOpCreatePreset, |
|
66 |
|
67 /** |
|
68 * Deletes a preset. |
|
69 * |
|
70 * Parameters: |
|
71 * [IN] Int0 Id of the preset to delete. |
|
72 */ |
|
73 EPSOpDeletePreset, |
|
74 |
|
75 /** |
|
76 * Starts an explicit read/write transaction with a preset. |
|
77 * |
|
78 * Parameters: |
|
79 * [IN] Int0 Id of the preset. |
|
80 */ |
|
81 EPSOpStartTransaction, |
|
82 |
|
83 /** |
|
84 * Commits the changes made to a preset during a transaction. |
|
85 * |
|
86 * Parameters: |
|
87 * [IN] Int0 Id of the preset. |
|
88 */ |
|
89 EPSOpCommitTransaction, |
|
90 |
|
91 /** |
|
92 * Reverts all changes made to a preset during a transaction. |
|
93 * |
|
94 * Parameters: |
|
95 * [IN] Int0 Id of the preset. |
|
96 */ |
|
97 EPSOpRollbackTransaction, |
|
98 |
|
99 /** |
|
100 * Moves a preset. |
|
101 * |
|
102 * Parameters: |
|
103 * [IN] Int0 Id of the preset. |
|
104 * [IN] Int1 Destination index of the preset. |
|
105 */ |
|
106 EPSOpMovePreset, |
|
107 |
|
108 /** |
|
109 * Notifies on preset changes. |
|
110 * |
|
111 * Parameters: |
|
112 * [IN] Int0 Pointer to the notifier as an integer. |
|
113 * [IN] Int1 ID of the preset to observe, or <code>KErrNotFound</code> |
|
114 if all changes should result in a notification. |
|
115 * [IN] Ptr2 Packed data of type TPSNotifyDataPackage. |
|
116 */ |
|
117 EPSOpNotify, |
|
118 |
|
119 /** |
|
120 * Cancels a pending notification of a preset change. |
|
121 * |
|
122 * Parameters: |
|
123 * [IN] Int0 Pointer to the notifier as an integer. |
|
124 */ |
|
125 EPSOpCancelNotify, |
|
126 |
|
127 /** |
|
128 * Sets the name of a preset. |
|
129 * |
|
130 * Parameters: |
|
131 * [IN] Int0 Id of the preset. |
|
132 * [IN] Ptr1 Name of the preset. |
|
133 */ |
|
134 EPSOpSetPresetName, |
|
135 |
|
136 /** |
|
137 * Sets the index of a preset. |
|
138 * |
|
139 * Parameters: |
|
140 * [IN] Int0 Id of the preset. |
|
141 * [IN] Int1 Index to set. |
|
142 */ |
|
143 EPSOpSetPresetIndex, |
|
144 |
|
145 /** |
|
146 * Sets the data of a preset. |
|
147 * |
|
148 * Parameters: |
|
149 * [IN] Int0 Id of the preset. |
|
150 * [IN] Ptr1 Data to set. |
|
151 */ |
|
152 EPSOpSetPresetData, |
|
153 |
|
154 /** |
|
155 * Gets the name of a preset. |
|
156 * |
|
157 * Parameters: |
|
158 * [IN] Int0 The id of the preset. |
|
159 * [OUT] Ptr1 The name of the preset. |
|
160 */ |
|
161 EPSOpGetPresetName, |
|
162 |
|
163 /** |
|
164 * Gets the length of a preset's name. |
|
165 * |
|
166 * Parameters: |
|
167 * [IN] Int0 Id of the preset. |
|
168 * [OUT] Int1 Length of the preset's name. |
|
169 */ |
|
170 EPSOpGetPresetNameLength, |
|
171 |
|
172 /** |
|
173 * Gets the index of a preset. |
|
174 * |
|
175 * Parameters: |
|
176 * [IN] Int0 Id of the preset. |
|
177 * [OUT] Int1 Index of the preset. |
|
178 */ |
|
179 EPSOpGetPresetIndex, |
|
180 |
|
181 /** |
|
182 * Gets the data handler of a preset. |
|
183 * |
|
184 * Parameters: |
|
185 * [IN] Int0 Id of the preset. |
|
186 * [OUT] Int1 Data handler of the preset. |
|
187 */ |
|
188 EPSOpGetPresetDataHandler, |
|
189 |
|
190 /** |
|
191 * Gets the data of a preset. |
|
192 * |
|
193 * Parameters: |
|
194 * [IN] Int0 Id of the preset. |
|
195 * [OUT] Ptr1 Data of the preset. |
|
196 */ |
|
197 EPSOpGetPresetData, |
|
198 |
|
199 /** |
|
200 * Gets the length of a preset's data. |
|
201 * |
|
202 * Parameters: |
|
203 * [IN] Int0 Id of the preset. |
|
204 * [OUT] Int1 Length of the preset's data. |
|
205 */ |
|
206 EPSOpGetPresetDataLength, |
|
207 |
|
208 /** |
|
209 * Gets an array of preset ids. |
|
210 * |
|
211 * Parameters: |
|
212 * [IN] Int0 Data handler of the presets. |
|
213 * [OUT] Ptr1 Preset ids matching the data handler. |
|
214 */ |
|
215 EPSOpGetPresets, |
|
216 |
|
217 /** |
|
218 * Gets the length of the preset array. |
|
219 * |
|
220 * Parameters: |
|
221 * [IN] Int0 Data handler of the presets. |
|
222 * [OUT] Int1 Length of the array. |
|
223 */ |
|
224 EPSOpGetPresetsLength |
|
225 |
|
226 }; |
|
227 |
|
228 #endif // PSCOMMON_H |