Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
seleniumhq
GitHub Repository: seleniumhq/selenium
Path: blob/trunk/cpp/imehandler/common/imehandler.h
2868 views
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: [email protected]
19
*/
20
21
22
#ifndef IMEHANDLER_H_
23
#define IMEHANDLER_H_
24
25
#include <vector>
26
#include <string>
27
28
// A macro to disallow the copy constructor and operator= functions
29
// This should be used in the private: declarations of all subclasses.
30
#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
31
TypeName(const TypeName&); \
32
void operator=(const TypeName&)
33
34
35
/*
36
* Abstract class representing a IME handler
37
* aka. the base class abstracting interactions for all IME on all systems.
38
*/
39
class ImeHandler {
40
public:
41
virtual ~ImeHandler() {}
42
/*
43
* Return the currently installed engines in a clear, human readable
44
* representation.
45
*/
46
virtual std::vector<std::string> GetInstalledEngines() const = 0;
47
48
/*
49
* Return a list of all the available engines on the system.
50
*/
51
virtual std::vector<std::string> GetAvailableEngines() const = 0;
52
53
/*
54
* Return a human readable representation of the currently active engine.
55
*/
56
virtual std::string GetActiveEngine() const = 0;
57
58
/*
59
* Returns true if a non standard (aka. complex, IME type) input method
60
* is currently used.
61
*/
62
virtual bool IsActivated() const = 0;
63
64
/*
65
* Switches back to a standard input method.
66
*/
67
virtual void Deactivate() = 0;
68
69
/*
70
* Load engines in the system.
71
* Returns the number of loaded engines.
72
*/
73
virtual int LoadEngines(const std::vector<std::string>& engines) = 0;
74
75
/*
76
* Sets the specified engine to be the one active.
77
* Returns true if set correctly, false otherwise.
78
*/
79
virtual bool ActivateEngine(const std::string& engine) = 0;
80
};
81
82
/* To use the library with dlopen. */
83
typedef ImeHandler* create_h();
84
typedef void destroy_h(ImeHandler*);
85
86
#endif // IMEHANDLER_H_
87
88