13 * |
13 * |
14 * Description: Metadata for ATEXT |
14 * Description: Metadata for ATEXT |
15 * |
15 * |
16 */ |
16 */ |
17 |
17 |
18 |
|
19 #ifndef C_CATEXTMETADATA_H |
18 #ifndef C_CATEXTMETADATA_H |
20 #define C_CATEXTMETADATA_H |
19 #define C_CATEXTMETADATA_H |
21 |
20 |
22 #include <e32base.h> |
21 #include <e32base.h> |
23 #include <atext.h> |
22 #include <atext.h> |
24 #include "atextpluginobserver.h" |
23 #include "atextpluginobserver.h" |
25 |
24 |
26 class CATExtPluginBase; |
25 class CATExtPluginBase; |
27 class CATExtListen; |
26 class CATExtListen; |
28 |
27 |
29 /** Support types supported by RSS file (M|P|S) */ |
28 /** Panic categories */ |
|
29 enum TATExtPanicCategories |
|
30 { |
|
31 EPanicCategoryFaultyMaster = 1, |
|
32 EPanicCategoryPluginType = 2 |
|
33 }; |
|
34 |
|
35 /** Support types supported by RSS file (M|P|O) */ |
30 enum TATExtSupportType |
36 enum TATExtSupportType |
31 { |
37 { |
32 ESupportTypeUndefined = KErrNotFound, |
38 ESupportTypeUndefined = KErrNotFound, |
33 ESupportTypeMaster = 0, |
39 ESupportTypeMaster = 0, |
34 ESupportTypePrimary, |
40 ESupportTypePartial, |
35 ESupportTypeSecondary |
41 ESupportTypeObserver |
36 }; |
42 }; |
37 |
43 |
38 /** Operation types, either for command handling or for URC receiving */ |
44 /** Operation types, either for command handling or for URC receiving */ |
39 enum TATExtOperationType |
45 enum TATExtOperationType |
40 { |
46 { |
126 NONSHARABLE_CLASS( TATExtSearchHelper ) |
132 NONSHARABLE_CLASS( TATExtSearchHelper ) |
127 { |
133 { |
128 |
134 |
129 public: |
135 public: |
130 |
136 |
131 TATExtSearchHelper() : iPrimaryIndex( KErrNotFound ), |
137 TATExtSearchHelper() : iPartialIndex( KErrNotFound ), |
132 iSecondaryIndex( KErrNotFound ) {} |
138 iObserverIndex( KErrNotFound ) {} |
133 |
139 |
134 /** |
140 /** |
135 * Index to the primary entry |
141 * Index to the partial entry |
136 */ |
142 */ |
137 TInt iPrimaryIndex; |
143 TInt iPartialIndex; |
138 |
144 |
139 /** |
145 /** |
140 * Index to the secondary entry |
146 * Index to the observer entry |
141 */ |
147 */ |
142 TInt iSecondaryIndex; |
148 TInt iObserverIndex; |
143 |
149 |
144 }; |
150 }; |
145 |
151 |
146 /** |
152 /** |
147 * Class to store data needed for one AT command support. |
153 * Class to store data needed for one AT command support. |
148 * This includes the support's type and the plugin entry. |
154 * This includes the support's type and the plugin entry. |
149 * Thus one plugin's RSS file may contain multiple M|P|S entries. |
155 * Thus one plugin's RSS file may contain multiple M|P|O entries. |
150 * |
156 * |
151 * @since S60 v5.0 |
157 * @since S60 v5.0 |
152 */ |
158 */ |
153 NONSHARABLE_CLASS( TATExtOneCmdSupport ) |
159 NONSHARABLE_CLASS( TATExtOneCmdSupport ) |
154 { |
160 { |
155 |
161 |
156 public: |
162 public: |
157 |
163 |
158 /** |
164 /** |
159 * Support's type (M|P|S) |
165 * Support's type (M|P|O) |
160 */ |
166 */ |
161 TATExtSupportType iSupportType; |
167 TATExtSupportType iSupportType; |
162 |
168 |
163 /** |
169 /** |
164 * Plugin entry for support |
170 * Plugin entry for support |
311 TATExtEntrySupport( TDesC8& aAtCmdFull, |
317 TATExtEntrySupport( TDesC8& aAtCmdFull, |
312 const RMessage2& aMessage, |
318 const RMessage2& aMessage, |
313 CArrayFixFlat<TATExtOneCmdSupport>* aSupport ) : |
319 CArrayFixFlat<TATExtOneCmdSupport>* aSupport ) : |
314 iAtCmdFull( aAtCmdFull ), |
320 iAtCmdFull( aAtCmdFull ), |
315 iMessage( aMessage ), |
321 iMessage( aMessage ), |
316 iSupport( aSupport ) {} |
322 iSupport( aSupport ), |
|
323 iEntry( NULL ), |
|
324 iStartIndex( KErrNotFound ), |
|
325 iSupportFound( EFalse ){} |
317 |
326 |
318 /** |
327 /** |
319 * Full AT command for which to check the support |
328 * Full AT command for which to check the support |
320 * (base part + parameters) |
329 * (base part + parameters) |
321 */ |
330 */ |
326 */ |
335 */ |
327 const RMessage2& iMessage; |
336 const RMessage2& iMessage; |
328 |
337 |
329 /** |
338 /** |
330 * AT command's plugin entry support data. |
339 * AT command's plugin entry support data. |
331 * Used by SendToMultipleSecondaryL() and FindFirstSecondarySupportL(). |
340 * Used by SendToMultipleObserverL() and FindFirstObserverSupportL(). |
332 */ |
341 */ |
333 CArrayFixFlat<TATExtOneCmdSupport>* iSupport; |
342 CArrayFixFlat<TATExtOneCmdSupport>* iSupport; |
334 |
343 |
335 /** |
344 /** |
336 * Found plugin entry. |
345 * Found plugin entry. |
337 */ |
346 */ |
338 TATExtPluginEntry* iEntry; |
347 TATExtPluginEntry* iEntry; |
339 |
348 |
340 /** |
349 /** |
341 * Starts index for searches with HandlePrimaryPluginSupportL() and |
350 * Start index for searches with HandlePartialAndMasterPluginSupportL() and |
342 * HandleSecondaryPluginSupportL() |
351 * HandleObserverPluginSupportL() |
343 */ |
352 */ |
344 TInt iStartIndex; |
353 TInt iStartIndex; |
|
354 |
|
355 /** |
|
356 * Found plugin support for HandlePartialAndMasterPluginSupportL(). |
|
357 */ |
|
358 TBool iSupportFound; |
345 |
359 |
346 }; |
360 }; |
347 |
361 |
348 /** |
362 /** |
349 * Class for handling various operations of the server session which are |
363 * Class for handling various operations of the server session which are |
868 * Adds new plugin entry link from plugin support entry to plugin entry |
882 * Adds new plugin entry link from plugin support entry to plugin entry |
869 * |
883 * |
870 * @since S60 5.0 |
884 * @since S60 5.0 |
871 * @param aEntries Plugin entries for support |
885 * @param aEntries Plugin entries for support |
872 * @param aEntryIndex Plugin index entry |
886 * @param aEntryIndex Plugin index entry |
873 * @param aSupportType Support's type (M|P|S) |
887 * @param aSupportType Support's type (M|P|O) |
874 * @param aSearchHelper The search helper |
888 * @param aSearchHelper The search helper |
875 * @return Index to the added entry, KErrNotSupported otherwise |
889 * @return Index to the added entry, KErrNotSupported otherwise |
876 */ |
890 */ |
877 TInt AddNewMetadataEntryLinkL( |
891 TInt AddNewMetadataEntryLinkL( |
878 CArrayFixFlat<TATExtOneCmdSupport>*& aEntries, |
892 CArrayFixFlat<TATExtOneCmdSupport>*& aEntries, |
891 CArrayFixFlat<TATExtOneCmdSupport>* aEntries, |
905 CArrayFixFlat<TATExtOneCmdSupport>* aEntries, |
892 TATExtSearchHelper& aSearchHelper, |
906 TATExtSearchHelper& aSearchHelper, |
893 TATExtOneCmdSupport& aOneCmdSupport ); |
907 TATExtOneCmdSupport& aOneCmdSupport ); |
894 |
908 |
895 /** |
909 /** |
896 * Adds new primary plugin entry link from plugin support entry to plugin |
910 * Adds new partial plugin entry link from plugin support entry to plugin |
897 * entry |
911 * entry |
898 * |
912 * |
899 * @since S60 5.0 |
913 * @since S60 5.0 |
900 * @return Index to the added entry, KErrNotSupported otherwise |
914 * @return Index to the added entry, KErrNotSupported otherwise |
901 */ |
915 */ |
902 TInt AddNewPrimaryMetadataEntryLinkL( |
916 TInt AddNewPartialMetadataEntryLinkL( |
903 CArrayFixFlat<TATExtOneCmdSupport>* aEntries, |
917 CArrayFixFlat<TATExtOneCmdSupport>* aEntries, |
904 TATExtSearchHelper& aSearchHelper, |
918 TATExtSearchHelper& aSearchHelper, |
905 TATExtOneCmdSupport& aOneCmdSupport ); |
919 TATExtOneCmdSupport& aOneCmdSupport ); |
906 |
920 |
907 /** |
921 /** |
908 * Adds new secondary plugin entry link from plugin support entry to plugin |
922 * Adds new observer plugin entry link from plugin support entry to plugin |
909 * entry. Search starts from the front as there could be multiple S plugins |
923 * entry. Search starts from the front as there could be multiple O plugins |
910 * but only one or two M/P plugins. |
924 * but only one or two M/P plugins. |
911 * |
925 * |
912 * @since S60 5.0 |
926 * @since S60 5.0 |
913 * @return Index to the added entry, KErrNotSupported otherwise |
927 * @return Index to the added entry, KErrNotSupported otherwise |
914 */ |
928 */ |
915 TInt AddNewSecondaryMetadataEntryLinkL( |
929 TInt AddNewObserverMetadataEntryLinkL( |
916 CArrayFixFlat<TATExtOneCmdSupport>* aEntries, |
930 CArrayFixFlat<TATExtOneCmdSupport>* aEntries, |
917 TATExtSearchHelper& aSearchHelper, |
931 TATExtSearchHelper& aSearchHelper, |
918 TATExtOneCmdSupport& aOneCmdSupport ); |
932 TATExtOneCmdSupport& aOneCmdSupport ); |
919 |
933 |
920 /** |
934 /** |
1052 * @return None |
1066 * @return None |
1053 */ |
1067 */ |
1054 void CreateSelfReplyData( const RMessage2& aMessage ); |
1068 void CreateSelfReplyData( const RMessage2& aMessage ); |
1055 |
1069 |
1056 /** |
1070 /** |
1057 * Handles support when a master plugin is detected in the plugin data |
1071 * Handles support when a master or partial plugin is detected in the plugin |
1058 * via support data's link (support for a full AT command). If a master |
1072 * data via support data's link. If a partial or master plugin is detected |
1059 * plugin is detected then reply is detected from that plugin. No further |
1073 * then reply is expected from that plugin. Also if one or more observer |
1060 * sending to primary or secondary plugins is repformed. |
1074 * plugins are detected then no reply is expected from them. |
1061 * |
1075 * |
1062 * @since S60 5.0 |
1076 * @since S60 5.0 |
1063 * @param aEntrySupport Support data to the first found master plugin |
1077 * @param aEntrySupport Support data to the first found partial or master plugin |
1064 * @param aReplyExpected ETrue if reply is expected from the master plugin, |
1078 * @param aStartIndex Start index to search the next observer plugin |
1065 * EFalse if no reply is expected from the master plugin, |
1079 * @param aReplyExpected ETrue if reply is expected from the partial or master plugin, |
|
1080 * EFalse if no reply is expected from the partial or master plugin, |
1066 * (i.e. no support found) |
1081 * (i.e. no support found) |
1067 * @return ETrue if support found, EFalse otherwise |
1082 * @return ETrue if support found, EFalse otherwise |
1068 */ |
1083 */ |
1069 TBool HandleMasterPluginSupportL( TATExtEntrySupport& aEntrySupport, |
1084 TBool HandleMasterAndPartialPluginSupportL( |
1070 TBool& aReplyExpected ); |
1085 TATExtEntrySupport& aEntrySupport, |
1071 |
1086 TInt aStartIndex, |
1072 /** |
1087 TBool& aReplyExpected ); |
1073 * Handles support when a primary plugin is detect in the plugin data |
1088 |
1074 * via support data's link. If a primary plugin is detected then reply is |
1089 /** |
1075 * expected from that plugin. Also if one or more secondary plugins are |
1090 * Handles support when a observer plugin is detected in the plugin data |
1076 * detected then no reply is expected from them. |
1091 * via support data's link. If only one observer plugin is detected then |
1077 * |
1092 * reply is expected from that plugin. Instead, if more than one observer |
1078 * @since S60 5.0 |
|
1079 * @param aEntrySupport Support data to the first found primary plugin |
|
1080 * @param aStartIndex Start index to search the next secondary plugin |
|
1081 * @param aReplyExpected ETrue if reply is expected from the primary plugin, |
|
1082 * EFalse if no reply is expected from the primary plugin, |
|
1083 * (i.e. no support found) |
|
1084 * @return ETrue if support found, EFalse otherwise |
|
1085 */ |
|
1086 TBool HandlePrimaryPluginSupportL( TATExtEntrySupport& aEntrySupport, |
|
1087 TInt aStartIndex, |
|
1088 TBool& aReplyExpected ); |
|
1089 |
|
1090 /** |
|
1091 * Handles support when a secondary plugin is detected in the plugin data |
|
1092 * via support data's link. If only one secondary plugin is detected then |
|
1093 * reply is expected from that plugin. Instead, if more than one secondary |
|
1094 * plugins are detected then no reply is expected from them. |
1093 * plugins are detected then no reply is expected from them. |
1095 * |
1094 * |
1096 * @since S60 5.0 |
1095 * @since S60 5.0 |
1097 * @param aEntrySupport Support data to the first found secondary plugin |
1096 * @param aEntrySupport Support data to the first found observer plugin |
1098 * entry |
1097 * entry |
1099 * @param aStartIndex Start index to search the next secondary plugin |
1098 * @param aStartIndex Start index to search the next observer plugin |
1100 * @param aReplyExpected ETrue if reply is expected from one or more plugins, |
1099 * @param aReplyExpected ETrue if reply is expected from one or more plugins, |
1101 * EFalse if no reply is expected from any of the plugins |
1100 * EFalse if no reply is expected from any of the plugins |
1102 * @return ETrue if support found, EFalse otherwise |
1101 * @return ETrue if support found, EFalse otherwise |
1103 */ |
1102 */ |
1104 TBool HandleSecondaryPluginSupportL( TATExtEntrySupport& aEntrySupport, |
1103 TBool HandleObserverPluginSupportL( TATExtEntrySupport& aEntrySupport, |
1105 TInt aStartIndex, |
1104 TInt aStartIndex, |
1106 TBool& aReplyExpected ); |
1105 TBool& aReplyExpected ); |
|
1106 |
|
1107 /** |
|
1108 * Finds exclusive partial plugin support |
|
1109 * |
|
1110 * @since S60 5.0 |
|
1111 * @param aEntrySupport Support data to the first found partial plugin entry |
|
1112 * @return ETrue if exclusive support found, EFalse otherwise |
|
1113 */ |
|
1114 TBool FindExclusivePartialSupportL( TATExtEntrySupport& aEntrySupport ); |
1107 |
1115 |
1108 /** |
1116 /** |
1109 * Finds support entries from support data for a given base AT command |
1117 * Finds support entries from support data for a given base AT command |
1110 * |
1118 * |
1111 * @since S60 5.0 |
1119 * @since S60 5.0 |
1171 void HandleCommandL( TATExtEntrySupport& aEntrySupport, |
1179 void HandleCommandL( TATExtEntrySupport& aEntrySupport, |
1172 TBool aReplyNeeded, |
1180 TBool aReplyNeeded, |
1173 const TDesC8* aAtCmdFull=NULL ); |
1181 const TDesC8* aAtCmdFull=NULL ); |
1174 |
1182 |
1175 /** |
1183 /** |
1176 * Sends an AT commands to multiple secondary plugins, starting from a |
1184 * Sends an AT commands to multiple observer plugins, starting from a |
1177 * given position. |
1185 * given position. |
1178 * |
1186 * |
1179 * @since S60 5.0 |
1187 * @since S60 5.0 |
1180 * @param aEntrySupport Entry support data to position from where to start |
1188 * @param aEntrySupport Entry support data to position from where to start |
1181 * sending to the found secondary plugins |
1189 * sending to the found observer plugins |
1182 * @param aAtCmdFull Full AT command to send (base part + parameters) |
1190 * @param aAtCmdFull Full AT command to send (base part + parameters) |
1183 * @return None |
1191 * @return None |
1184 */ |
1192 */ |
1185 void SendToMultipleSecondaryL( TATExtEntrySupport& aEntrySupport, |
1193 void SendToMultipleObserverL( TATExtEntrySupport& aEntrySupport, |
1186 const TDesC8* aAtCmdFull ); |
1194 const TDesC8* aAtCmdFull ); |
1187 |
1195 |
1188 /** |
1196 /** |
1189 * Finds the first secondary plugin support from a given starting position |
1197 * Finds the first observer plugin support from a given starting position |
1190 * |
1198 * |
1191 * @since S60 5.0 |
1199 * @since S60 5.0 |
1192 * @param aEntrySupport Entry support data to the next entry after the found |
1200 * @param aEntrySupport Entry support data to the next entry after the found |
1193 * secondary plugin entry; marks the start for search |
1201 * observer plugin entry; marks the start for search |
1194 * @return ETrue if support found, EFalse otherwise |
1202 * @return ETrue if support found, EFalse otherwise |
1195 */ |
1203 */ |
1196 TBool FindFirstSecondarySupportL( TATExtEntrySupport& aEntrySupport ); |
1204 TBool FindFirstObserverSupportL( TATExtEntrySupport& aEntrySupport ); |
1197 |
1205 |
1198 /** |
1206 /** |
1199 * Extracts one NVRAM entry from a pipe-character delimited NVRAM buffer |
1207 * Extracts one NVRAM entry from a pipe-character delimited NVRAM buffer |
1200 * |
1208 * |
1201 * @since S60 5.0 |
1209 * @since S60 5.0 |