|
1 /* |
|
2 * Copyright (c) 2004 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: Some data serialization functions for Custom Commands |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef SICUSTOMCOMMANDDATA_H |
|
21 #define SICUSTOMCOMMANDDATA_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32std.h> |
|
25 #include <badesca.h> |
|
26 #include <nsssispeechrecognitiondataclient.h> |
|
27 #include <mmfcontrollerframework.h> |
|
28 #include "nsssispeechrecognitioncustomcommandcommon.h" |
|
29 |
|
30 |
|
31 /** |
|
32 * Static functions to internalize and externalize some data types. |
|
33 * |
|
34 * @lib nsssispeechrecognitioncustomcommands.lib |
|
35 * @since 2.8 |
|
36 */ |
|
37 class SICustomCommandData // Static classes don't have Symbian prefix |
|
38 { |
|
39 public: // New functions |
|
40 |
|
41 /** |
|
42 * Internalize a string array. |
|
43 * @since 2.8 |
|
44 * @param aBuffer Buffer to be internalized |
|
45 * @return Internalized string array |
|
46 */ |
|
47 static MDesCArray* InternalizeDesCArrayL(const TDesC8& aBuffer); |
|
48 |
|
49 /** |
|
50 * Externalize a string array. |
|
51 * @since 2.8 |
|
52 * @param aArray Array to be externalized |
|
53 * @return The buffer containing the string array |
|
54 */ |
|
55 static CBufFlat* ExternalizeDesCArrayL(const MDesCArray& aArray); |
|
56 |
|
57 /** |
|
58 * Internalize a string array. |
|
59 * @since 2.8 |
|
60 * @param aBuffer Buffer to be internalized |
|
61 * @return The array of string arrays |
|
62 */ |
|
63 static RPointerArray<MDesCArray> *InternalizeDesCArrayArrayL( |
|
64 const TDesC8& aBuffer); |
|
65 |
|
66 /** |
|
67 * Externalize a string array. |
|
68 * @since 2.8 |
|
69 * @param aArray Array of string arras to be externalized. |
|
70 * @return The buffer containing the array of string arrays. |
|
71 */ |
|
72 static CBufFlat* ExternalizeDesCArrayArrayL( |
|
73 const RPointerArray<MDesCArray>& aArrayArray); |
|
74 |
|
75 /** |
|
76 * Reads parameter data from TMMFMessage. TMMFMessage has 2 param slots. |
|
77 * @since 2.8 |
|
78 * @param aMessage The message to be read. |
|
79 * @param aSlot The parameter slot to be read. 1 or 2. |
|
80 * @return The data from slot X. |
|
81 */ |
|
82 static HBufC8* ReadMessageDataLC( TMMFMessage& aMessage, TInt aSlot ); |
|
83 |
|
84 /** |
|
85 * Internalizes a pronunciatoin array. |
|
86 * @since 2.8 |
|
87 * @param aData The serialized buffer |
|
88 * @param aCount How many pronunciations was saved to aData. |
|
89 * @param aArray Array to be populated. |
|
90 */ |
|
91 static void InternalizePronunArrayL( |
|
92 const TDesC8& aData, |
|
93 TInt aCount, |
|
94 RArray<TSIPronunciationID>& aArray ); |
|
95 |
|
96 }; |
|
97 |
|
98 #endif // SICUSTOMCOMMANDDATA_H |
|
99 |
|
100 // End of File |