Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* vim:expandtab:shiftwidth=4:tabstop=4:
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/. */
8 #include <Qt>
9 #include <QGuiApplication>
11 #include "nsBidiKeyboard.h"
13 NS_IMPL_ISUPPORTS(nsBidiKeyboard, nsIBidiKeyboard)
15 nsBidiKeyboard::nsBidiKeyboard() : nsIBidiKeyboard()
16 {
17 Reset();
18 }
20 nsBidiKeyboard::~nsBidiKeyboard()
21 {
22 }
24 NS_IMETHODIMP nsBidiKeyboard::Reset()
25 {
26 return NS_OK;
27 }
29 NS_IMETHODIMP nsBidiKeyboard::IsLangRTL(bool *aIsRTL)
30 {
31 *aIsRTL = false;
33 QInputMethod* input = qApp->inputMethod();
34 Qt::LayoutDirection layoutDir = input ? input->inputDirection() : Qt::LeftToRight;
36 if (layoutDir == Qt::RightToLeft) {
37 *aIsRTL = true;
38 }
40 return NS_OK;
41 }
43 NS_IMETHODIMP nsBidiKeyboard::GetHaveBidiKeyboards(bool* aResult)
44 {
45 // not implemented yet
46 return NS_ERROR_NOT_IMPLEMENTED;
47 }