| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 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 are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 29 */ | 29 */ |
| 30 | 30 |
| 31 #ifndef SpeechInput_h | 31 #ifndef SpeechInput_h |
| 32 #define SpeechInput_h | 32 #define SpeechInput_h |
| 33 | 33 |
| 34 #if ENABLE(INPUT_SPEECH) | 34 #if ENABLE(INPUT_SPEECH) |
| 35 | 35 |
| 36 #include "core/page/Page.h" | 36 #include "core/page/Page.h" |
| 37 #include "core/page/SpeechInputListener.h" | 37 #include "core/speech/SpeechInputListener.h" |
| 38 #include "wtf/Forward.h" | 38 #include "wtf/Forward.h" |
| 39 #include "wtf/HashMap.h" | 39 #include "wtf/HashMap.h" |
| 40 | 40 |
| 41 namespace WebCore { | 41 namespace WebCore { |
| 42 | 42 |
| 43 class IntRect; | 43 class IntRect; |
| 44 class SecurityOrigin; | 44 class SecurityOrigin; |
| 45 class SpeechInputClient; | 45 class SpeechInputClient; |
| 46 class SpeechInputListener; | 46 class SpeechInputListener; |
| 47 | 47 |
| 48 // This class connects the input elements requiring speech input with the platfo
rm specific | 48 // This class connects the input elements requiring speech input with the platfo
rm specific |
| 49 // speech recognition engine. It provides methods for the input elements to acti
vate speech | 49 // speech recognition engine. It provides methods for the input elements to acti
vate speech |
| 50 // recognition and methods for the speech recognition engine to return back the
results. | 50 // recognition and methods for the speech recognition engine to return back the
results. |
| 51 class SpeechInput : public SpeechInputListener, | 51 class SpeechInput : public SpeechInputListener, public Supplement<Page> { |
| 52 public Supplement<Page> { | |
| 53 WTF_MAKE_NONCOPYABLE(SpeechInput); | 52 WTF_MAKE_NONCOPYABLE(SpeechInput); |
| 54 public: | 53 public: |
| 55 virtual ~SpeechInput(); | 54 virtual ~SpeechInput(); |
| 56 | 55 |
| 57 static PassOwnPtr<SpeechInput> create(SpeechInputClient*); | 56 static PassOwnPtr<SpeechInput> create(SpeechInputClient*); |
| 58 static const char* supplementName(); | 57 static const char* supplementName(); |
| 59 static SpeechInput* from(Page* page) { return static_cast<SpeechInput*>(Supp
lement<Page>::from(page, supplementName())); } | 58 static SpeechInput* from(Page* page) { return static_cast<SpeechInput*>(Supp
lement<Page>::from(page, supplementName())); } |
| 60 | 59 |
| 61 // Generates a unique ID for the given listener to be used for speech reques
ts. | 60 // Generates a unique ID for the given listener to be used for speech reques
ts. |
| 62 // This should be the first call made by listeners before anything else. | 61 // This should be the first call made by listeners before anything else. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 82 SpeechInputClient* m_client; | 81 SpeechInputClient* m_client; |
| 83 HashMap<int, SpeechInputListener*> m_listeners; | 82 HashMap<int, SpeechInputListener*> m_listeners; |
| 84 int m_nextListenerId; | 83 int m_nextListenerId; |
| 85 }; | 84 }; |
| 86 | 85 |
| 87 } // namespace WebCore | 86 } // namespace WebCore |
| 88 | 87 |
| 89 #endif // ENABLE(INPUT_SPEECH) | 88 #endif // ENABLE(INPUT_SPEECH) |
| 90 | 89 |
| 91 #endif // SpeechInput_h | 90 #endif // SpeechInput_h |
| OLD | NEW |