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
15IPC_STRUCT_TRAITS_BEGIN(TtsUtteranceRequest)
16IPC_STRUCT_TRAITS_MEMBER(id)
17IPC_STRUCT_TRAITS_MEMBER(text)
18IPC_STRUCT_TRAITS_MEMBER(lang)
19IPC_STRUCT_TRAITS_MEMBER(voice)
20IPC_STRUCT_TRAITS_MEMBER(volume)
21IPC_STRUCT_TRAITS_MEMBER(rate)
22IPC_STRUCT_TRAITS_MEMBER(pitch)
23IPC_STRUCT_TRAITS_END()
24
25IPC_STRUCT_TRAITS_BEGIN(TtsVoice)
26IPC_STRUCT_TRAITS_MEMBER(voice_uri)
27IPC_STRUCT_TRAITS_MEMBER(name)
28IPC_STRUCT_TRAITS_MEMBER(lang)
29IPC_STRUCT_TRAITS_MEMBER(local_service)
30IPC_STRUCT_TRAITS_MEMBER(is_default)
31IPC_STRUCT_TRAITS_END()
32
33// Renderer -> Browser messages.
34
35IPC_MESSAGE_CONTROL0(TtsHostMsg_InitializeVoiceList)
36IPC_MESSAGE_CONTROL1(TtsHostMsg_Speak,
37                     TtsUtteranceRequest)
38IPC_MESSAGE_CONTROL0(TtsHostMsg_Pause)
39IPC_MESSAGE_CONTROL0(TtsHostMsg_Resume)
40IPC_MESSAGE_CONTROL0(TtsHostMsg_Cancel)
41
42// Browser -> Renderer messages.
43
44IPC_MESSAGE_CONTROL1(TtsMsg_SetVoiceList,
45                     std::vector<TtsVoice>)
46IPC_MESSAGE_CONTROL1(TtsMsg_DidStartSpeaking,
47                     int /* utterance id */)
48IPC_MESSAGE_CONTROL1(TtsMsg_DidFinishSpeaking,
49                     int /* utterance id */)
50IPC_MESSAGE_CONTROL1(TtsMsg_DidPauseSpeaking,
51                     int /* utterance id */)
52IPC_MESSAGE_CONTROL1(TtsMsg_DidResumeSpeaking,
53                     int /* utterance id */)
54IPC_MESSAGE_CONTROL2(TtsMsg_WordBoundary,
55                     int /* utterance id */,
56                     int /* char index */)
57IPC_MESSAGE_CONTROL2(TtsMsg_SentenceBoundary,
58                     int /* utterance id */,
59                     int /* char index */)
60IPC_MESSAGE_CONTROL2(TtsMsg_MarkerEvent,
61                     int /* utterance id */,
62                     int /* char index */)
63IPC_MESSAGE_CONTROL1(TtsMsg_WasInterrupted,
64                     int /* utterance id */)
65IPC_MESSAGE_CONTROL1(TtsMsg_WasCancelled,
66                     int /* utterance id */)
67IPC_MESSAGE_CONTROL2(TtsMsg_SpeakingErrorOccurred,
68                     int /* utterance id */,
69                     std::string /* error message */)
70