1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2  * vim: sw=2 ts=8 et :
3  */
4 /* This Source Code Form is subject to the terms of the Mozilla Public
5  * License, v. 2.0. If a copy of the MPL was not distributed with this
6  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 
8 #include "PuppetBidiKeyboard.h"
9 #include "nsIWidget.h"
10 
11 using namespace mozilla::widget;
12 
NS_IMPL_ISUPPORTS(PuppetBidiKeyboard,nsIBidiKeyboard)13 NS_IMPL_ISUPPORTS(PuppetBidiKeyboard, nsIBidiKeyboard)
14 
15 PuppetBidiKeyboard::PuppetBidiKeyboard()
16     : nsIBidiKeyboard(), mIsLangRTL(false), mHaveBidiKeyboards(false) {}
17 
18 PuppetBidiKeyboard::~PuppetBidiKeyboard() = default;
19 
20 NS_IMETHODIMP
Reset()21 PuppetBidiKeyboard::Reset() { return NS_OK; }
22 
23 NS_IMETHODIMP
IsLangRTL(bool * aIsRTL)24 PuppetBidiKeyboard::IsLangRTL(bool* aIsRTL) {
25   *aIsRTL = mIsLangRTL;
26   return NS_OK;
27 }
28 
SetBidiKeyboardInfo(bool aIsLangRTL,bool aHaveBidiKeyboards)29 void PuppetBidiKeyboard::SetBidiKeyboardInfo(bool aIsLangRTL,
30                                              bool aHaveBidiKeyboards) {
31   mIsLangRTL = aIsLangRTL;
32   mHaveBidiKeyboards = aHaveBidiKeyboards;
33 }
34 
35 NS_IMETHODIMP
GetHaveBidiKeyboards(bool * aResult)36 PuppetBidiKeyboard::GetHaveBidiKeyboards(bool* aResult) {
37   *aResult = mHaveBidiKeyboards;
38   return NS_OK;
39 }
40 
41 // static
42 already_AddRefed<nsIBidiKeyboard>
CreateBidiKeyboardContentProcess()43 nsIWidget::CreateBidiKeyboardContentProcess() {
44   return do_AddRef(new PuppetBidiKeyboard());
45 }
46