/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
class AsyncAccelExec : public cppu::WeakImplHelper<css::lang::XEventListener>
{ private:
css::uno::Reference<css::lang::XComponent> m_xFrame;
css::uno::Reference< css::frame::XDispatch > m_xDispatch;
css::util::URL m_aURL;
vcl::EventPoster m_aAsyncCallback; public:
/** creates a new instance of this class, which can be used one times only!
This instance can be forced to execute its internal set request asynchronous. After that it deletes itself!
*/ static rtl::Reference<AsyncAccelExec> createOneShotInstance(const css::uno::Reference<css::lang::XComponent>& xFrame, const css::uno::Reference<css::frame::XDispatch>& xDispatch, const css::util::URL& rURL);
/** @short allow creation of instances of this class by using our factory only!
*/
AsyncAccelExec(css::uno::Reference<css::lang::XComponent> xFrame,
css::uno::Reference< css::frame::XDispatch > xDispatch,
css::util::URL aURL);
try
{ if (xDocCfg.is())
sCommand = xDocCfg->getCommandByKeyEvent(aKey); if (!sCommand.isEmpty()) return sCommand;
} catch(const css::container::NoSuchElementException&)
{}
try
{ if (xModuleCfg.is())
sCommand = xModuleCfg->getCommandByKeyEvent(aKey); if (!sCommand.isEmpty()) return sCommand;
} catch(const css::container::NoSuchElementException&)
{}
try
{ if (xGlobalCfg.is())
sCommand = xGlobalCfg->getCommandByKeyEvent(aKey); if (!sCommand.isEmpty()) return sCommand;
} catch(const css::container::NoSuchElementException&)
{}
// fall back to functional key codes if( aKey.Modifiers == 0 )
{ switch( aKey.KeyCode )
{ case css::awt::Key::DELETE_TO_BEGIN_OF_LINE: return u".uno:DelToStartOfLine"_ustr; case css::awt::Key::DELETE_TO_END_OF_LINE: return u".uno:DelToEndOfLine"_ustr; case css::awt::Key::DELETE_TO_BEGIN_OF_PARAGRAPH: return u".uno:DelToStartOfPara"_ustr; case css::awt::Key::DELETE_TO_END_OF_PARAGRAPH: return u".uno:DelToEndOfPara"_ustr; case css::awt::Key::DELETE_WORD_BACKWARD: return u".uno:DelToStartOfWord"_ustr; case css::awt::Key::DELETE_WORD_FORWARD: return u".uno:DelToEndOfWord"_ustr; case css::awt::Key::INSERT_LINEBREAK: return u".uno:InsertLinebreak"_ustr; case css::awt::Key::INSERT_PARAGRAPH: return u".uno:InsertPara"_ustr; case css::awt::Key::MOVE_WORD_BACKWARD: return u".uno:GoToPrevWord"_ustr; case css::awt::Key::MOVE_WORD_FORWARD: return u".uno:GoToNextWord"_ustr; case css::awt::Key::MOVE_TO_BEGIN_OF_LINE: return u".uno:GoToStartOfLine"_ustr; case css::awt::Key::MOVE_TO_END_OF_LINE: return u".uno:GoToEndOfLine"_ustr; case css::awt::Key::MOVE_TO_BEGIN_OF_PARAGRAPH: return u".uno:GoToStartOfPara"_ustr; case css::awt::Key::MOVE_TO_END_OF_PARAGRAPH: return u".uno:GoToEndOfPara"_ustr; case css::awt::Key::MOVE_TO_BEGIN_OF_DOCUMENT: return u".uno:GoToStartOfDoc"_ustr; case css::awt::Key::MOVE_TO_END_OF_DOCUMENT: return u".uno:GoToEndOfDoc"_ustr; case css::awt::Key::SELECT_BACKWARD: return u".uno:CharLeftSel"_ustr; case css::awt::Key::SELECT_FORWARD: return u".uno:CharRightSel"_ustr; case css::awt::Key::SELECT_WORD_BACKWARD: return u".uno:WordLeftSel"_ustr; case css::awt::Key::SELECT_WORD_FORWARD: return u".uno:WordRightSel"_ustr; case css::awt::Key::SELECT_WORD: return u".uno:SelectWord"_ustr; case css::awt::Key::SELECT_LINE: return OUString(); case css::awt::Key::SELECT_PARAGRAPH: return u".uno:SelectText"_ustr; case css::awt::Key::SELECT_TO_BEGIN_OF_LINE: return u".uno:StartOfLineSel"_ustr; case css::awt::Key::SELECT_TO_END_OF_LINE: return u".uno:EndOfLineSel"_ustr; case css::awt::Key::SELECT_TO_BEGIN_OF_PARAGRAPH: return u".uno:StartOfParaSel"_ustr; case css::awt::Key::SELECT_TO_END_OF_PARAGRAPH: return u".uno:EndOfParaSel"_ustr; case css::awt::Key::SELECT_TO_BEGIN_OF_DOCUMENT: return u".uno:StartOfDocumentSel"_ustr; case css::awt::Key::SELECT_TO_END_OF_DOCUMENT: return u".uno:EndOfDocumentSel"_ustr; case css::awt::Key::SELECT_ALL: return u".uno:SelectAll"_ustr; default: break;
}
}
css::ui::XModuleUIConfigurationManager2* t = static_cast<css::ui::XModuleUIConfigurationManager2*>(xUIManager.get());
// Return new short cut manager in case current view's language is different from previous ones. return t->createShortCutManager();
} catch(const css::container::NoSuchElementException&)
{}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.