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