1926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)/*
2926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * Copyright (C) 2013 Google Inc. All rights reserved.
3926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) *
4926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * Redistribution and use in source and binary forms, with or without
5926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * modification, are permitted provided that the following conditions
6926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * are met:
7926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) *
8926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * 1.  Redistributions of source code must retain the above copyright
9926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) *     notice, this list of conditions and the following disclaimer.
10926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * 2.  Redistributions in binary form must reproduce the above copyright
11926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) *     notice, this list of conditions and the following disclaimer in the
12926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) *     documentation and/or other materials provided with the distribution.
13926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) *
14926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
15926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
16926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
17926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
18926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
19926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
20926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
21926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) */
25926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)
26926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)#include "config.h"
27926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)
285267f701546148b83dfbe1d151cb184385bb5c22Torne (Richard Coles)#include "public/platform/WebSpeechSynthesisUtterance.h"
29926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)
30a854de003a23bf3c7f95ec0f8154ada64092ff5cTorne (Richard Coles)#include "platform/speech/PlatformSpeechSynthesisUtterance.h"
317757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch#include "wtf/PassRefPtr.h"
327757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch#include "wtf/RefPtr.h"
33926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)
3451b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)namespace blink {
35926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)
36e38fbeeb576b5094e34e038ab88d9d6a5c5c2214Torne (Richard Coles)WebSpeechSynthesisUtterance::WebSpeechSynthesisUtterance(PlatformSpeechSynthesisUtterance* utterance)
37926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)    : m_private(utterance)
38926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles){
39926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)}
40926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)
41e38fbeeb576b5094e34e038ab88d9d6a5c5c2214Torne (Richard Coles)WebSpeechSynthesisUtterance& WebSpeechSynthesisUtterance::operator=(PlatformSpeechSynthesisUtterance* utterance)
42926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles){
43926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)    m_private = utterance;
44926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)    return *this;
45926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)}
46926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)
47926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)void WebSpeechSynthesisUtterance::assign(const WebSpeechSynthesisUtterance& other)
48926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles){
49926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)    m_private = other.m_private;
50926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)}
51926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)
52926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)void WebSpeechSynthesisUtterance::reset()
53926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles){
54926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)    m_private.reset();
55926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)}
56926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)
57926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)WebSpeechSynthesisUtterance::operator PlatformSpeechSynthesisUtterance*() const
58926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles){
59926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)    return m_private.get();
60926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)}
61926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)
62926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)WebString WebSpeechSynthesisUtterance::text() const
63926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles){
64926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)    return m_private->text();
65926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)}
66926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)
67926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)WebString WebSpeechSynthesisUtterance::lang() const
68926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles){
69926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)    return m_private->lang();
70926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)}
71926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)
72926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)WebString WebSpeechSynthesisUtterance::voice() const
73926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles){
74926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)    return m_private->voice() ? WebString(m_private->voice()->name()) : WebString();
75926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)}
76926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)
77926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)float WebSpeechSynthesisUtterance::volume() const
78926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles){
79926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)    return m_private->volume();
80926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)}
81926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)
82926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)float WebSpeechSynthesisUtterance::rate() const
83926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles){
84926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)    return m_private->rate();
85926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)}
86926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)
87926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)float WebSpeechSynthesisUtterance::pitch() const
88926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles){
89926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)    return m_private->pitch();
90926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)}
91926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)
92926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)double WebSpeechSynthesisUtterance::startTime() const
93926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles){
94926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)    return m_private->startTime();
95926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)}
96926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)
9751b2906e11752df6c18351cf520e30522d3b53a1Torne (Richard Coles)} // namespace blink
98