Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
seleniumhq
GitHub Repository: seleniumhq/selenium
Path: blob/trunk/cpp/imehandler/linux/src/ibushandler.h
2868 views
1
/*
2
Copyright 2011 WebDriver committers
3
Copyright 2011 Google Inc.
4
5
Licensed under the Apache License, Version 2.0 (the "License");
6
you may not use this file except in compliance with the License.
7
You may obtain a copy of the License at
8
9
http://www.apache.org/licenses/LICENSE-2.0
10
11
Unless required by applicable law or agreed to in writing, software
12
distributed under the License is distributed on an "AS IS" BASIS,
13
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
See the License for the specific language governing permissions and
15
limitations under the License.
16
17
Author: [email protected]
18
*/
19
20
#ifndef IBUSHANDLER_H_
21
#define IBUSHANDLER_H_
22
23
24
#include <vector>
25
#include <string>
26
27
#include "imehandler.h"
28
29
// If ibus.h is not included, provide a forward definition
30
// for these classes.
31
#ifndef IBUS_MAJOR_VERSION
32
class IBusInputContext;
33
class IBusBus;
34
#endif
35
36
/*
37
* Implementation of the IME handler for the linux ibus framework.
38
*/
39
class IBusHandler : public ImeHandler {
40
public:
41
IBusHandler();
42
virtual ~IBusHandler();
43
virtual std::vector<std::string> GetInstalledEngines() const;
44
virtual std::vector<std::string> GetAvailableEngines() const;
45
virtual std::string GetActiveEngine() const;
46
virtual bool IsActivated() const;
47
virtual void Deactivate();
48
virtual int LoadEngines(const std::vector<std::string>&);
49
virtual bool ActivateEngine(const std::string&);
50
51
private:
52
// Methods to factorize common tasks.
53
IBusInputContext* GetCurrentInputContext() const;
54
55
// The current connection to the ibus daemon.
56
IBusBus* bus_;
57
58
// Is iBus available at all?
59
bool ibus_available_;
60
61
DISALLOW_COPY_AND_ASSIGN(IBusHandler);
62
};
63
64
65
#endif // IBUSHANDLER_H_
66
67