"Fossies" - the Fresh Open Source Software Archive 
Member "selenium-selenium-4.8.1/cpp/imehandler/windows/src/winapihandler.h" (17 Feb 2023, 2430 Bytes) of package /linux/www/selenium-selenium-4.8.1.tar.gz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file.
For more information about "winapihandler.h" see the
Fossies "Dox" file reference documentation.
1 /*
2 Licensed to the Software Freedom Conservancy (SFC) under one
3 or more contributor license agreements. See the NOTICE file
4 distributed with this work for additional information
5 regarding copyright ownership. The SFC licenses this file
6 to you under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
9
10 http://www.apache.org/licenses/LICENSE-2.0
11
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
17
18 Author: timothe@google.com
19 */
20
21 #ifndef WINAPIHANDLER_H_
22 #define WINAPIHANDLER_H_
23
24 #include <vector>
25 #include <string>
26 #include <utility>
27
28 #include <windows.h>
29
30 #include "imehandler.h"
31
32
33
34 // a pair representing an entry as written in the windows registry:
35 // HKL <-> Keyboard layout name
36 typedef std::pair<std::string, std::string> keyboard_layout;
37
38 class WinapiHandler : public ImeHandler {
39 public:
40 WinapiHandler();
41 virtual ~WinapiHandler() {}
42 virtual std::string GetToggleKeys() const;
43 virtual std::vector<std::string> GetLoadedEngines() const;
44 virtual std::vector<std::string> GetAvailableEngines() const;
45 virtual std::string GetNextEngineKeys() const;
46 virtual std::string GetActiveEngine() const;
47 virtual bool IsActivated() const;
48 virtual void Deactivate();
49 virtual int LoadEngines(const std::vector<std::string>& engines);
50 virtual bool ActivateEngine(const std::string& engine);
51
52 // The following is specific to this handler's implementation.
53 std::string GetSwitchingKeysForEngine(std::string engine);
54
55 protected:
56 std::vector<keyboard_layout> keyboard_layouts;
57
58 /*
59 * Converts from HKL hexadecimal strings to human readable
60 * names and vice versa.
61 */
62 std::string GetLayoutName(std::string hkl) const;
63 std::string GetLayoutHkl(const std::string& name) const;
64 unsigned int GetHKLFromString(const std::string &) const;
65 /*
66 * Reads the registry and loads all the available layouts
67 * and engines.
68 */
69 void LoadAvailableLayouts();
70 /*
71 * Return the key modifiers@for the DWORD value usually
72 * taken as written in the registry.
73 */
74 std::string GetModifiers(DWORD value);
75 };
76
77 #endif // WINAPIHANDLER_H_