1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/widget/qt/nsBidiKeyboard.cpp Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,47 @@ 1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 1.5 +/* vim:expandtab:shiftwidth=4:tabstop=4: 1.6 + */ 1.7 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.8 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.9 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.10 + 1.11 +#include <Qt> 1.12 +#include <QGuiApplication> 1.13 + 1.14 +#include "nsBidiKeyboard.h" 1.15 + 1.16 +NS_IMPL_ISUPPORTS(nsBidiKeyboard, nsIBidiKeyboard) 1.17 + 1.18 +nsBidiKeyboard::nsBidiKeyboard() : nsIBidiKeyboard() 1.19 +{ 1.20 + Reset(); 1.21 +} 1.22 + 1.23 +nsBidiKeyboard::~nsBidiKeyboard() 1.24 +{ 1.25 +} 1.26 + 1.27 +NS_IMETHODIMP nsBidiKeyboard::Reset() 1.28 +{ 1.29 + return NS_OK; 1.30 +} 1.31 + 1.32 +NS_IMETHODIMP nsBidiKeyboard::IsLangRTL(bool *aIsRTL) 1.33 +{ 1.34 + *aIsRTL = false; 1.35 + 1.36 + QInputMethod* input = qApp->inputMethod(); 1.37 + Qt::LayoutDirection layoutDir = input ? input->inputDirection() : Qt::LeftToRight; 1.38 + 1.39 + if (layoutDir == Qt::RightToLeft) { 1.40 + *aIsRTL = true; 1.41 + } 1.42 + 1.43 + return NS_OK; 1.44 +} 1.45 + 1.46 +NS_IMETHODIMP nsBidiKeyboard::GetHaveBidiKeyboards(bool* aResult) 1.47 +{ 1.48 + // not implemented yet 1.49 + return NS_ERROR_NOT_IMPLEMENTED; 1.50 +}