LibreOffice Module svtools (master) 1
acceleratorexecute.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#pragma once
21
22#include <svtools/svtdllapi.h>
23
24#include <memory>
25#include <mutex>
26
27#include <com/sun/star/awt/KeyEvent.hpp>
28#include <vcl/keycod.hxx>
29
30namespace com :: sun :: star :: frame { class XDispatchProvider; }
31namespace com :: sun :: star :: frame { class XFrame; }
32namespace com :: sun :: star :: frame { class XModel; }
33namespace com :: sun :: star :: ui { class XAcceleratorConfiguration; }
34namespace com :: sun :: star :: uno { class XComponentContext; }
35namespace com :: sun :: star :: util { class XURLTransformer; }
36
37
38namespace svt
39{
40
41
66{
67 // member
68 private:
69 std::mutex m_aLock;
70
72 css::uno::Reference< css::uno::XComponentContext > m_xContext;
73
75 css::uno::Reference< css::util::XURLTransformer > m_xURLParser;
76
78 css::uno::Reference< css::frame::XDispatchProvider > m_xDispatcher;
79
81 css::uno::Reference< css::ui::XAcceleratorConfiguration > m_xGlobalCfg;
82 css::uno::Reference< css::ui::XAcceleratorConfiguration > m_xModuleCfg;
83 css::uno::Reference< css::ui::XAcceleratorConfiguration > m_xDocCfg;
84 // interface
85 public:
86
87
111 static std::unique_ptr<AcceleratorExecute> createAcceleratorHelper();
112
113
116
117
141 void init(const css::uno::Reference< css::uno::XComponentContext >& rxContext,
142 const css::uno::Reference< css::frame::XFrame >& xEnv );
143
144
160 bool execute(const vcl::KeyCode& aKey);
161 bool execute(const css::awt::KeyEvent& aKey);
162
168 OUString findCommand(const css::awt::KeyEvent& aKey);
169
171 static css::awt::KeyEvent st_VCLKey2AWTKey(const vcl::KeyCode& aKey);
172 static vcl::KeyCode st_AWTKey2VCLKey(const css::awt::KeyEvent& aKey);
173
174
176 static css::uno::Reference< css::ui::XAcceleratorConfiguration > st_openModuleConfig(const css::uno::Reference< css::uno::XComponentContext >& rxContext ,
177 const css::uno::Reference< css::frame::XFrame >& xFrame);
178
179 static css::uno::Reference<css::ui::XAcceleratorConfiguration> lok_createNewAcceleratorConfiguration(const css::uno::Reference< css::uno::XComponentContext >& rxContext, OUString sModule);
180 void lok_setModuleConfig(css::uno::Reference<css::ui::XAcceleratorConfiguration> acceleratorConfig);
181
183 static css::uno::Reference< css::ui::XAcceleratorConfiguration > st_openDocConfig(const css::uno::Reference< css::frame::XModel >& xModel);
184
185
186 // internal
187 private:
188
189
194
196 void operator=(const AcceleratorExecute&) = delete;
197
199 SVT_DLLPRIVATE OUString impl_ts_findCommand(const css::awt::KeyEvent& aKey);
200
201
203 SVT_DLLPRIVATE css::uno::Reference< css::util::XURLTransformer > impl_ts_getURLParser();
204};
205
206} // namespace svt
207
208/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
FILE * init(int, char **)
@descr implements a helper, which can be used to convert vcl key codes into awt key codes ....
css::uno::Reference< css::ui::XAcceleratorConfiguration > m_xDocCfg
css::uno::Reference< css::ui::XAcceleratorConfiguration > m_xGlobalCfg
TODO document me.
css::uno::Reference< css::frame::XDispatchProvider > m_xDispatcher
TODO document me.
AcceleratorExecute(const AcceleratorExecute &rCopy)=delete
css::uno::Reference< css::ui::XAcceleratorConfiguration > m_xModuleCfg
void operator=(const AcceleratorExecute &)=delete
css::uno::Reference< css::uno::XComponentContext > m_xContext
TODO document me.
css::uno::Reference< css::util::XURLTransformer > m_xURLParser
TODO document me.
#define SVT_DLLPUBLIC
Definition: svtdllapi.h:27
#define SVT_DLLPRIVATE
Definition: svtdllapi.h:29