OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_APP_LIST_SPEECH_UI_MODEL_OBSERVER_H_ | 5 #ifndef UI_APP_LIST_SPEECH_UI_MODEL_OBSERVER_H_ |
6 #define UI_APP_LIST_SPEECH_UI_MODEL_OBSERVER_H_ | 6 #define UI_APP_LIST_SPEECH_UI_MODEL_OBSERVER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
10 #include "ui/app_list/app_list_export.h" | 10 #include "ui/app_list/app_list_export.h" |
11 | 11 |
12 namespace app_list { | 12 namespace app_list { |
13 | 13 |
14 enum SpeechRecognitionState { | 14 enum SpeechRecognitionState { |
15 SPEECH_RECOGNITION_NOT_STARTED = 0, | 15 SPEECH_RECOGNITION_OFF = 0, |
16 SPEECH_RECOGNITION_ON, | 16 SPEECH_RECOGNITION_READY, |
| 17 SPEECH_RECOGNITION_HOTWORD_LISTENING, |
| 18 SPEECH_RECOGNITION_RECOGNIZING, |
17 SPEECH_RECOGNITION_IN_SPEECH, | 19 SPEECH_RECOGNITION_IN_SPEECH, |
| 20 SPEECH_RECOGNITION_STOPPING, |
18 }; | 21 }; |
19 | 22 |
20 class APP_LIST_EXPORT SpeechUIModelObserver { | 23 class APP_LIST_EXPORT SpeechUIModelObserver { |
21 public: | 24 public: |
22 // Invoked when sound level for the speech recognition has changed. |level| | 25 // Invoked when sound level for the speech recognition has changed. |level| |
23 // represents the current sound-level in the range of [0, 255]. | 26 // represents the current sound-level in the range of [0, 255]. |
24 virtual void OnSpeechSoundLevelChanged(uint8 level) {} | 27 virtual void OnSpeechSoundLevelChanged(uint8 level) {} |
25 | 28 |
26 // Invoked when a speech result arrives. |is_final| is true only when the | 29 // Invoked when a speech result arrives. |is_final| is true only when the |
27 // speech result is final. | 30 // speech result is final. |
28 virtual void OnSpeechResult(const base::string16& result, bool is_final) {} | 31 virtual void OnSpeechResult(const base::string16& result, bool is_final) {} |
29 | 32 |
30 // Invoked when the state of speech recognition is changed. | 33 // Invoked when the state of speech recognition is changed. |
31 virtual void OnSpeechRecognitionStateChanged( | 34 virtual void OnSpeechRecognitionStateChanged( |
32 SpeechRecognitionState new_state) {} | 35 SpeechRecognitionState new_state) {} |
33 | 36 |
34 protected: | 37 protected: |
35 virtual ~SpeechUIModelObserver() {} | 38 virtual ~SpeechUIModelObserver() {} |
36 }; | 39 }; |
37 | 40 |
38 } // namespace app_list | 41 } // namespace app_list |
39 | 42 |
40 #endif // UI_APP_LIST_SPEECH_UI_MODEL_OBSERVER_H_ | 43 #endif // UI_APP_LIST_SPEECH_UI_MODEL_OBSERVER_H_ |
OLD | NEW |