|
1 /* |
|
2 * Copyright (c) 2002-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: ?Description |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CFCOMMON_H |
|
20 #define CFCOMMON_H |
|
21 |
|
22 // Panic categories |
|
23 _LIT( KPanicCatClient, "CfClient" ); |
|
24 |
|
25 /** |
|
26 * Reasons for Server Panic. |
|
27 */ |
|
28 enum TContextServPanic |
|
29 { |
|
30 EBadRequest, |
|
31 EBadDescriptor, |
|
32 EMainSchedulerError, |
|
33 ESvrCreateServer, |
|
34 ESvrStartServer, |
|
35 ECreateTrapCleanup, |
|
36 ENotImplementedYet, |
|
37 EReceiveReceiveAlreadyActive, |
|
38 ESrvCreateServer, |
|
39 ENoCurrentAction, |
|
40 EAlreadyReceivingScriptNotification |
|
41 }; |
|
42 |
|
43 // OpCodes used in message passing between client and server |
|
44 enum TContextServRqst |
|
45 { |
|
46 // Context related operation codes |
|
47 EDefineContext, |
|
48 EPublishContext, |
|
49 EReceiveContextIndicationMessage, |
|
50 EGetContextIndication, |
|
51 ECancelReceiveContextIndicationMessage, |
|
52 ECreate, |
|
53 EClose, |
|
54 EAddSubscription, |
|
55 ERemoveSubscription, |
|
56 ERequestContext, |
|
57 ERequestContextSet, |
|
58 EPublishContextWithData, |
|
59 EGetContextSubscriptionError, |
|
60 EReceiveMessage, |
|
61 EGetMessage, |
|
62 ECancelReceiveMessage, |
|
63 |
|
64 // Action related operation codes |
|
65 EDefineAction, |
|
66 ESubscribeAction, |
|
67 EUnsubscribeAction, |
|
68 EListenActionSubscription, |
|
69 ECancelListenActionSubscription, |
|
70 EGetActionIndication, |
|
71 |
|
72 // Script related operation codes |
|
73 ERegisterScriptByName, |
|
74 EDeregisterScriptById, |
|
75 ERegisterScriptByNameAndDesc, |
|
76 ESaveScriptByName, |
|
77 ESaveScriptByNameAndDesc, |
|
78 EDeleteScriptByName, |
|
79 EDeleteScriptByUid, |
|
80 EUpgradeRomScriptByName, |
|
81 EUpgradeRomScriptByNameAndDesc, |
|
82 ERestoreRomScript, |
|
83 EScriptNotificationStart, |
|
84 EScriptNotificationCancel, |
|
85 EGetScriptNotification, |
|
86 |
|
87 // Context source related operation codes |
|
88 EInstallSourceSetting, |
|
89 EUninstallSourceSetting, |
|
90 EUninstallSourceSettings, |
|
91 |
|
92 // Keep this last |
|
93 ENumOfOpCodes |
|
94 }; |
|
95 |
|
96 // OpCodes used in message passing between client and server |
|
97 enum TContextServCallbackMessages |
|
98 { |
|
99 // Context related operation codes |
|
100 ESubscribers, |
|
101 ENoSubscribers, |
|
102 EHandleCommand |
|
103 }; |
|
104 |
|
105 // Server leave codes |
|
106 enum TContextServLeave |
|
107 { |
|
108 ENonNumericString, |
|
109 EListenAlreadyListening |
|
110 }; |
|
111 |
|
112 // server name |
|
113 _LIT( KContextServerName, "CFServer" ); |
|
114 |
|
115 // A version must be specifyed when creating a session with the server |
|
116 const TUint KContextServMajorVersionNumber=1; |
|
117 const TUint KContextServMinorVersionNumber=0; |
|
118 const TUint KContextServBuildVersionNumber=1; |
|
119 |
|
120 // Context data object default size if not defined in cenrep |
|
121 const TUint KContextDataObjectDefaultSize = 0x2000; // 8kb |
|
122 |
|
123 // IPC communication constants |
|
124 const TInt KMaxSizeFixedArray = 5; |
|
125 const TInt KMaxBufferSize = 1024; |
|
126 |
|
127 const TUid KCFServerSid = {0x10282BC4}; |
|
128 |
|
129 // Special contextfw error codes. |
|
130 // These must not cause leave if called User::LeaveIfError(). |
|
131 enum TCfwErrorCodes |
|
132 { |
|
133 // Base error code |
|
134 KErrCfwErrorBase = 1000, |
|
135 KErrDeregisterNotNeeded, |
|
136 }; |
|
137 |
|
138 // Format string to create persistent data file from: |
|
139 // - Owner uid |
|
140 // - Script name |
|
141 // - Persistent data name |
|
142 _LIT( KPersistenDataFormat, "c:\\private\\10282bc4\\rules\\%x\\%S-%S.dat" ); |
|
143 |
|
144 // Format string to create persistent data file from: |
|
145 // - Owner uid |
|
146 // - Persistent data name |
|
147 _LIT( KPersistenDataFormat2, "c:\\private\\10282bc4\\rules\\%x\\%S.dat" ); |
|
148 |
|
149 // Format string for creating a file name for a saved script: |
|
150 // - Owner uid |
|
151 // - Script name |
|
152 _LIT( KDefaultSystemRuleFileFormat, "!:\\private\\10282BC4\\Rules\\%x\\%S.rul" ); |
|
153 |
|
154 // Format string for creating a file name for rom upgrade: |
|
155 // - Script name |
|
156 _LIT( KDefaultRomRuleFileUpgradeFormat, "!:\\private\\10282BC4\\Rules\\%S.rul" ); |
|
157 |
|
158 // Script tag to identify the XML file as Contextfw script |
|
159 _LIT8( KScriptStartTag, "<script" ); |
|
160 |
|
161 #endif // CFCOMMON_H |
|
162 |
|
163 // End of File |