OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Apple Inc. All rights reserved. | 2 * Copyright (C) 2013 Apple 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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. 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 "modules/EventTargetModules.h" | 30 #include "modules/EventTargetModules.h" |
31 #include "modules/ModulesExport.h" | 31 #include "modules/ModulesExport.h" |
32 #include "modules/speech/SpeechSynthesisUtterance.h" | 32 #include "modules/speech/SpeechSynthesisUtterance.h" |
33 #include "modules/speech/SpeechSynthesisVoice.h" | 33 #include "modules/speech/SpeechSynthesisVoice.h" |
34 #include "platform/heap/Handle.h" | 34 #include "platform/heap/Handle.h" |
35 #include "platform/speech/PlatformSpeechSynthesisUtterance.h" | 35 #include "platform/speech/PlatformSpeechSynthesisUtterance.h" |
36 #include "platform/speech/PlatformSpeechSynthesizer.h" | 36 #include "platform/speech/PlatformSpeechSynthesizer.h" |
37 | 37 |
38 namespace blink { | 38 namespace blink { |
39 | 39 |
40 class ExceptionState; | |
41 class PlatformSpeechSynthesizerClient; | 40 class PlatformSpeechSynthesizerClient; |
42 | 41 |
43 class MODULES_EXPORT SpeechSynthesis final : public RefCountedGarbageCollectedEv
entTargetWithInlineData<SpeechSynthesis>, public PlatformSpeechSynthesizerClient
, public ContextLifecycleObserver { | 42 class MODULES_EXPORT SpeechSynthesis final : public RefCountedGarbageCollectedEv
entTargetWithInlineData<SpeechSynthesis>, public PlatformSpeechSynthesizerClient
, public ContextLifecycleObserver { |
44 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(SpeechSynthesis); | 43 REFCOUNTED_GARBAGE_COLLECTED_EVENT_TARGET(SpeechSynthesis); |
45 DEFINE_WRAPPERTYPEINFO(); | 44 DEFINE_WRAPPERTYPEINFO(); |
46 USING_GARBAGE_COLLECTED_MIXIN(SpeechSynthesis); | 45 USING_GARBAGE_COLLECTED_MIXIN(SpeechSynthesis); |
47 public: | 46 public: |
48 static SpeechSynthesis* create(ExecutionContext*); | 47 static SpeechSynthesis* create(ExecutionContext*); |
49 | 48 |
50 bool pending() const; | 49 bool pending() const; |
51 bool speaking() const; | 50 bool speaking() const; |
52 bool paused() const; | 51 bool paused() const; |
53 | 52 |
54 void speak(SpeechSynthesisUtterance*, ExceptionState&); | 53 void speak(SpeechSynthesisUtterance*); |
55 void cancel(); | 54 void cancel(); |
56 void pause(); | 55 void pause(); |
57 void resume(); | 56 void resume(); |
58 | 57 |
59 const HeapVector<Member<SpeechSynthesisVoice>>& getVoices(); | 58 const HeapVector<Member<SpeechSynthesisVoice>>& getVoices(); |
60 | 59 |
61 // Used in testing to use a mock platform synthesizer | 60 // Used in testing to use a mock platform synthesizer |
62 void setPlatformSynthesizer(PlatformSpeechSynthesizer*); | 61 void setPlatformSynthesizer(PlatformSpeechSynthesizer*); |
63 | 62 |
64 DEFINE_ATTRIBUTE_EVENT_LISTENER(voiceschanged); | 63 DEFINE_ATTRIBUTE_EVENT_LISTENER(voiceschanged); |
(...skipping 26 matching lines...) Expand all Loading... |
91 HeapDeque<Member<SpeechSynthesisUtterance>> m_utteranceQueue; | 90 HeapDeque<Member<SpeechSynthesisUtterance>> m_utteranceQueue; |
92 bool m_isPaused; | 91 bool m_isPaused; |
93 | 92 |
94 // EventTarget | 93 // EventTarget |
95 const AtomicString& interfaceName() const override; | 94 const AtomicString& interfaceName() const override; |
96 }; | 95 }; |
97 | 96 |
98 } // namespace blink | 97 } // namespace blink |
99 | 98 |
100 #endif // SpeechSynthesisEvent_h | 99 #endif // SpeechSynthesisEvent_h |
OLD | NEW |