| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * * Redistributions of source code must retain the above copyright | 7 * * Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * * Redistributions in binary form must reproduce the above copyright | 9 * * Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 #include "core/dom/ActiveDOMObject.h" | 30 #include "core/dom/ActiveDOMObject.h" |
| 31 #include "core/dom/EventTarget.h" | 31 #include "core/dom/EventTarget.h" |
| 32 #include "modules/speech/SpeechGrammarList.h" | 32 #include "modules/speech/SpeechGrammarList.h" |
| 33 #include "wtf/Compiler.h" | 33 #include "wtf/Compiler.h" |
| 34 #include "wtf/PassRefPtr.h" | 34 #include "wtf/PassRefPtr.h" |
| 35 #include "wtf/RefCounted.h" | 35 #include "wtf/RefCounted.h" |
| 36 #include "wtf/text/WTFString.h" | 36 #include "wtf/text/WTFString.h" |
| 37 | 37 |
| 38 namespace WebCore { | 38 namespace WebCore { |
| 39 | 39 |
| 40 class ExceptionState; | |
| 41 class ScriptExecutionContext; | 40 class ScriptExecutionContext; |
| 42 class SpeechRecognitionController; | 41 class SpeechRecognitionController; |
| 43 class SpeechRecognitionError; | 42 class SpeechRecognitionError; |
| 44 class SpeechRecognitionResult; | 43 class SpeechRecognitionResult; |
| 45 class SpeechRecognitionResultList; | 44 class SpeechRecognitionResultList; |
| 46 | 45 |
| 47 class SpeechRecognition : public RefCounted<SpeechRecognition>, public ScriptWra
ppable, public ActiveDOMObject, public EventTarget { | 46 class SpeechRecognition : public RefCounted<SpeechRecognition>, public ScriptWra
ppable, public ActiveDOMObject, public EventTarget { |
| 48 public: | 47 public: |
| 49 static PassRefPtr<SpeechRecognition> create(ScriptExecutionContext*); | 48 static PassRefPtr<SpeechRecognition> create(ScriptExecutionContext*); |
| 50 ~SpeechRecognition(); | 49 ~SpeechRecognition(); |
| 51 | 50 |
| 52 // Attributes. | 51 // Attributes. |
| 53 PassRefPtr<SpeechGrammarList> grammars() { return m_grammars; } | 52 PassRefPtr<SpeechGrammarList> grammars() { return m_grammars; } |
| 54 void setGrammars(PassRefPtr<SpeechGrammarList> grammars) { m_grammars = gram
mars; } | 53 void setGrammars(PassRefPtr<SpeechGrammarList> grammars) { m_grammars = gram
mars; } |
| 55 String lang() { return m_lang; } | 54 String lang() { return m_lang; } |
| 56 void setLang(const String& lang) { m_lang = lang; } | 55 void setLang(const String& lang) { m_lang = lang; } |
| 57 bool continuous() { return m_continuous; } | 56 bool continuous() { return m_continuous; } |
| 58 void setContinuous(bool continuous) { m_continuous = continuous; } | 57 void setContinuous(bool continuous) { m_continuous = continuous; } |
| 59 bool interimResults() { return m_interimResults; } | 58 bool interimResults() { return m_interimResults; } |
| 60 void setInterimResults(bool interimResults) { m_interimResults = interimResu
lts; } | 59 void setInterimResults(bool interimResults) { m_interimResults = interimResu
lts; } |
| 61 unsigned long maxAlternatives() { return m_maxAlternatives; } | 60 unsigned long maxAlternatives() { return m_maxAlternatives; } |
| 62 void setMaxAlternatives(unsigned long maxAlternatives) { m_maxAlternatives =
maxAlternatives; } | 61 void setMaxAlternatives(unsigned long maxAlternatives) { m_maxAlternatives =
maxAlternatives; } |
| 63 | 62 |
| 64 // Callable by the user. | 63 // Callable by the user. |
| 65 void start(ExceptionState&); | 64 void start(ExceptionCode&); |
| 66 void stopFunction(); | 65 void stopFunction(); |
| 67 void abort(); | 66 void abort(); |
| 68 | 67 |
| 69 // Called by the SpeechRecognitionClient. | 68 // Called by the SpeechRecognitionClient. |
| 70 void didStartAudio(); | 69 void didStartAudio(); |
| 71 void didStartSound(); | 70 void didStartSound(); |
| 72 void didStartSpeech(); | 71 void didStartSpeech(); |
| 73 void didEndSpeech(); | 72 void didEndSpeech(); |
| 74 void didEndSound(); | 73 void didEndSound(); |
| 75 void didEndAudio(); | 74 void didEndAudio(); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 SpeechRecognitionController* m_controller; | 123 SpeechRecognitionController* m_controller; |
| 125 bool m_stoppedByActiveDOMObject; | 124 bool m_stoppedByActiveDOMObject; |
| 126 bool m_started; | 125 bool m_started; |
| 127 bool m_stopping; | 126 bool m_stopping; |
| 128 Vector<RefPtr<SpeechRecognitionResult> > m_finalResults; | 127 Vector<RefPtr<SpeechRecognitionResult> > m_finalResults; |
| 129 }; | 128 }; |
| 130 | 129 |
| 131 } // namespace WebCore | 130 } // namespace WebCore |
| 132 | 131 |
| 133 #endif // SpeechRecognition_h | 132 #endif // SpeechRecognition_h |
| OLD | NEW |