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) 3053e740f4a82e17f3ae59772501622dc354e42336Torne (Richard Coles)#include "core/platform/PlatformSpeechSynthesisUtterance.h" 317757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch#include "wtf/PassRefPtr.h" 327757ec2eadfa2dd8ac2aeed0a4399e9b07ec38cbBen Murdoch#include "wtf/RefPtr.h" 33926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) 34926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)using namespace WebCore; 35926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) 36926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)namespace WebKit { 37926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) 38926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)WebSpeechSynthesisUtterance::WebSpeechSynthesisUtterance(const PassRefPtr<PlatformSpeechSynthesisUtterance>& utterance) 39926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) : m_private(utterance) 40926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles){ 41926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)} 42926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) 43926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)WebSpeechSynthesisUtterance& WebSpeechSynthesisUtterance::operator=(WebCore::PlatformSpeechSynthesisUtterance* utterance) 44926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles){ 45926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) m_private = utterance; 46926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) return *this; 47926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)} 48926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) 49926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)void WebSpeechSynthesisUtterance::assign(const WebSpeechSynthesisUtterance& other) 50926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles){ 51926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) m_private = other.m_private; 52926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)} 53926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) 54926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)void WebSpeechSynthesisUtterance::reset() 55926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles){ 56926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) m_private.reset(); 57926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)} 58926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) 59926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)WebSpeechSynthesisUtterance::operator PassRefPtr<PlatformSpeechSynthesisUtterance>() const 60926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles){ 61926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) return m_private.get(); 62926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)} 63926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) 64926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)WebSpeechSynthesisUtterance::operator PlatformSpeechSynthesisUtterance*() const 65926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles){ 66926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) return m_private.get(); 67926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)} 68926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) 69926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)WebString WebSpeechSynthesisUtterance::text() const 70926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles){ 71926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) return m_private->text(); 72926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)} 73926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) 74926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)WebString WebSpeechSynthesisUtterance::lang() const 75926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles){ 76926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) return m_private->lang(); 77926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)} 78926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) 79926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)WebString WebSpeechSynthesisUtterance::voice() const 80926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles){ 81926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) return m_private->voice() ? WebString(m_private->voice()->name()) : WebString(); 82926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)} 83926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) 84926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)float WebSpeechSynthesisUtterance::volume() const 85926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles){ 86926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) return m_private->volume(); 87926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)} 88926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) 89926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)float WebSpeechSynthesisUtterance::rate() const 90926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles){ 91926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) return m_private->rate(); 92926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)} 93926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) 94926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)float WebSpeechSynthesisUtterance::pitch() const 95926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles){ 96926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) return m_private->pitch(); 97926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)} 98926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) 99926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)double WebSpeechSynthesisUtterance::startTime() const 100926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles){ 101926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) return m_private->startTime(); 102926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)} 103926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles) 104926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)} // namespace WebKit 105