widget/qt/nsBidiKeyboard.cpp

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:4abbec2ac0ff
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/. */
7
8 #include <Qt>
9 #include <QGuiApplication>
10
11 #include "nsBidiKeyboard.h"
12
13 NS_IMPL_ISUPPORTS(nsBidiKeyboard, nsIBidiKeyboard)
14
15 nsBidiKeyboard::nsBidiKeyboard() : nsIBidiKeyboard()
16 {
17 Reset();
18 }
19
20 nsBidiKeyboard::~nsBidiKeyboard()
21 {
22 }
23
24 NS_IMETHODIMP nsBidiKeyboard::Reset()
25 {
26 return NS_OK;
27 }
28
29 NS_IMETHODIMP nsBidiKeyboard::IsLangRTL(bool *aIsRTL)
30 {
31 *aIsRTL = false;
32
33 QInputMethod* input = qApp->inputMethod();
34 Qt::LayoutDirection layoutDir = input ? input->inputDirection() : Qt::LeftToRight;
35
36 if (layoutDir == Qt::RightToLeft) {
37 *aIsRTL = true;
38 }
39
40 return NS_OK;
41 }
42
43 NS_IMETHODIMP nsBidiKeyboard::GetHaveBidiKeyboards(bool* aResult)
44 {
45 // not implemented yet
46 return NS_ERROR_NOT_IMPLEMENTED;
47 }

mercurial