1 /* |
|
2 * Copyright (c) 2003-2007 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: The MNssRecognitionHandler class performs the recognition function. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef NSSVASMRECOGNITIONHANDLER_H |
|
20 #define NSSVASMRECOGNITIONHANDLER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <e32def.h> |
|
25 #include <nssvasmtag.h> |
|
26 #include <nssvasmcontext.h> |
|
27 #include <nssvasmadaptationitem.h> |
|
28 #include <nssvasmrecognizeeventhandler.h> |
|
29 #include <nssvasmrecognizeinitcompletehandler.h> |
|
30 #include <nssvasmrejecttagcompletehandler.h> |
|
31 #include <nssvasmadaptationeventhandler.h> |
|
32 |
|
33 // CLASS DEFINITIONS |
|
34 |
|
35 /** |
|
36 * |
|
37 * The MNssRecognitionHandler class performs the recognition function. |
|
38 * CNssRecognitionHandler class. |
|
39 * |
|
40 * @lib NssVASApi.lib |
|
41 * @since 2.8 |
|
42 */ |
|
43 class MNssRecognitionHandler |
|
44 { |
|
45 |
|
46 public: |
|
47 |
|
48 enum TNssRecognitionResult |
|
49 { |
|
50 EVasErrorNone, |
|
51 EVasRecognitionInitFailed, |
|
52 EVasRecognitionFailed, |
|
53 EVasSelectTagFailed, |
|
54 EVasRejectTagFailed, |
|
55 EVasUnexpectedRequest, |
|
56 EVasInvalidParameter |
|
57 }; |
|
58 |
|
59 /** |
|
60 * Initiate the Select Tag event. |
|
61 * @since 2.0 |
|
62 * @param aClientTag The voice tag which was selected. The tag is owned |
|
63 * by the client. |
|
64 * @return TNssRecognitionResult Return indicating request is valid. |
|
65 */ |
|
66 virtual TNssRecognitionResult SelectTagL( MNssTag* aClientTag ) = 0; |
|
67 |
|
68 /** |
|
69 * Initiate the Select Tag event. |
|
70 * @since 2.0 |
|
71 * @param aClientTag The voice tag which was selected. The tag is owned |
|
72 * by the client. |
|
73 * @param aShouldNotifyHandlers If this is false, then handlers which |
|
74 * monitor tag's context won't be notified. |
|
75 * @return TNssRecognitionResult Return indicating request is valid. |
|
76 */ |
|
77 virtual TNssRecognitionResult SelectTagL(MNssTag* aClientTag, TBool aNotifyHandlers ) = 0; |
|
78 |
|
79 /** |
|
80 * Perform the recognize function. |
|
81 * @since 2.0 |
|
82 * @param aEventHandler The event call back to receive recognize events. |
|
83 * @return TNssRecognitionResult Return indicating request is valid. |
|
84 */ |
|
85 virtual TNssRecognitionResult Recognize( MNssRecognizeEventHandler* aEventHandler ) = 0; |
|
86 |
|
87 /** |
|
88 * Perform initialization for the recognize funtion. |
|
89 * @since 2.0 |
|
90 * @param aInitCompleteHandler The event call back to receive recognize |
|
91 * init events. |
|
92 * @param aMaxResults The maximum number of voice tags to be recognized. |
|
93 * @return TNssRecognitionResult Return indicating request is valid. |
|
94 */ |
|
95 virtual TNssRecognitionResult |
|
96 RecognizeInitL( MNssRecognizeInitCompleteHandler* aInitCompleteHandler, |
|
97 TInt aMaxResults ) = 0; |
|
98 |
|
99 /** |
|
100 * Perform initialization for the recognize function. |
|
101 * @since 2.0 |
|
102 * @param aInitCompleteHandler The event call back to receive recognize |
|
103 * init events. |
|
104 * @param aContextArray The list of contexts to be active in |
|
105 * recognition, i.e. recognition vocabulary. |
|
106 * @param aMaxResults The maximum number of voice tags to be recognized. |
|
107 * @return TNssRecognitionResult Return indicating request is valid. |
|
108 */ |
|
109 virtual TNssRecognitionResult RecognizeInitL( |
|
110 MNssRecognizeInitCompleteHandler* aInitCompleteHandler, |
|
111 const CArrayPtrFlat<MNssContext>& aContextArray, |
|
112 TInt aMaxResults ) = 0; |
|
113 |
|
114 /** |
|
115 * Starts sampling already before RecognizeInitL and Recognize calls. |
|
116 * This is used to ensure that there is no delay between user notification |
|
117 * and sampling start. |
|
118 * Asynchronous: MNssRecognizeInitCompleteHandler::HandlePreSamplingStarted |
|
119 * will be called when ready. |
|
120 * |
|
121 * @since 3.2 |
|
122 * @param aInitCompleteHandler Callback handler |
|
123 * @return Return value indicating if request was valid |
|
124 */ |
|
125 virtual TNssRecognitionResult PreStartSampling( MNssRecognizeInitCompleteHandler* aInitCompleteHandler ) = 0; |
|
126 |
|
127 /** |
|
128 * Cancel the last recognition function. |
|
129 * @since 2.0 |
|
130 * @return TNssRecognitionResult Return indicating request is valid. |
|
131 */ |
|
132 virtual TNssRecognitionResult Cancel() = 0; |
|
133 |
|
134 /** |
|
135 * Request Reject Tag, i.e. blacklisting. |
|
136 * @since 2.0 |
|
137 * @param aClientTagList The list of voice tags which is to be rejected, i.e. |
|
138 * blacklisted. The tag list is owned by the client. |
|
139 * @return TNssRecognitionResult Return indicating request is valid. |
|
140 */ |
|
141 virtual TNssRecognitionResult RejectTagL( |
|
142 MNssRejectTagCompleteHandler* aRejectTagCompleteHandler, |
|
143 CArrayPtrFlat<MNssTag>* aClientTagList ) = 0; |
|
144 /** |
|
145 * Get adaptation item to allow later adaptation. |
|
146 * @since 2.0 |
|
147 * @return MNssAdaptationItem* The adaptation item. Client takes ownership. |
|
148 */ |
|
149 virtual MNssAdaptationItem *GetAdaptationItemL() = 0; |
|
150 }; |
|
151 |
|
152 #endif // NSSVASMRECOGNITIONHANDLER_H |
|
153 |
|
154 // End of File |
|