1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 // Multiply-included message file, hence no include guard. 6 7 #include <vector> 8 9 #include "chrome/common/tts_utterance_request.h" 10 #include "ipc/ipc_message_macros.h" 11 #include "ipc/ipc_param_traits.h" 12 13 #define IPC_MESSAGE_START TtsMsgStart 14 15 IPC_STRUCT_TRAITS_BEGIN(TtsUtteranceRequest) 16 IPC_STRUCT_TRAITS_MEMBER(id) 17 IPC_STRUCT_TRAITS_MEMBER(text) 18 IPC_STRUCT_TRAITS_MEMBER(lang) 19 IPC_STRUCT_TRAITS_MEMBER(voice) 20 IPC_STRUCT_TRAITS_MEMBER(volume) 21 IPC_STRUCT_TRAITS_MEMBER(rate) 22 IPC_STRUCT_TRAITS_MEMBER(pitch) 23 IPC_STRUCT_TRAITS_END() 24 25 IPC_STRUCT_TRAITS_BEGIN(TtsVoice) 26 IPC_STRUCT_TRAITS_MEMBER(voice_uri) 27 IPC_STRUCT_TRAITS_MEMBER(name) 28 IPC_STRUCT_TRAITS_MEMBER(lang) 29 IPC_STRUCT_TRAITS_MEMBER(local_service) 30 IPC_STRUCT_TRAITS_MEMBER(is_default) 31 IPC_STRUCT_TRAITS_END() 32 33 // Renderer -> Browser messages. 34 35 IPC_MESSAGE_CONTROL0(TtsHostMsg_InitializeVoiceList) 36 IPC_MESSAGE_CONTROL1(TtsHostMsg_Speak, 37 TtsUtteranceRequest) 38 IPC_MESSAGE_CONTROL0(TtsHostMsg_Pause) 39 IPC_MESSAGE_CONTROL0(TtsHostMsg_Resume) 40 IPC_MESSAGE_CONTROL0(TtsHostMsg_Cancel) 41 42 // Browser -> Renderer messages. 43 44 IPC_MESSAGE_CONTROL1(TtsMsg_SetVoiceList, 45 std::vector<TtsVoice>) 46 IPC_MESSAGE_CONTROL1(TtsMsg_DidStartSpeaking, 47 int /* utterance id */) 48 IPC_MESSAGE_CONTROL1(TtsMsg_DidFinishSpeaking, 49 int /* utterance id */) 50 IPC_MESSAGE_CONTROL1(TtsMsg_DidPauseSpeaking, 51 int /* utterance id */) 52 IPC_MESSAGE_CONTROL1(TtsMsg_DidResumeSpeaking, 53 int /* utterance id */) 54 IPC_MESSAGE_CONTROL2(TtsMsg_WordBoundary, 55 int /* utterance id */, 56 int /* char index */) 57 IPC_MESSAGE_CONTROL2(TtsMsg_SentenceBoundary, 58 int /* utterance id */, 59 int /* char index */) 60 IPC_MESSAGE_CONTROL2(TtsMsg_MarkerEvent, 61 int /* utterance id */, 62 int /* char index */) 63 IPC_MESSAGE_CONTROL1(TtsMsg_WasInterrupted, 64 int /* utterance id */) 65 IPC_MESSAGE_CONTROL1(TtsMsg_WasCancelled, 66 int /* utterance id */) 67 IPC_MESSAGE_CONTROL2(TtsMsg_SpeakingErrorOccurred, 68 int /* utterance id */, 69 std::string /* error message */) 70