- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / browser / chromeos / input_method / ibus_controller.h
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_IBUS_CONTROLLER_H_
6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_IBUS_CONTROLLER_H_
7
8 #include <string>
9 #include <utility>
10 #include <vector>
11
12 namespace chromeos {
13 namespace input_method {
14
15 struct InputMethodProperty;
16 typedef std::vector<InputMethodProperty> InputMethodPropertyList;
17
18 // IBusController is used to interact with the system input method framework
19 // (which is currently IBus).
20 class IBusController {
21  public:
22   class Observer {
23    public:
24     virtual ~Observer() {}
25     virtual void PropertyChanged() = 0;
26     // TODO(yusukes): Add functions for IPC error handling.
27   };
28
29   // Creates an instance of the class.
30   static IBusController* Create();
31
32   virtual ~IBusController();
33
34   virtual void AddObserver(Observer* observer) = 0;
35   virtual void RemoveObserver(Observer* observer) = 0;
36
37   virtual void ClearProperties() = 0;
38
39   // Activates the input method property specified by the |key|. Returns true on
40   // success.
41   virtual bool ActivateInputMethodProperty(const std::string& key) = 0;
42
43   // Gets the latest input method property send from the system input method
44   // framework.
45   virtual const InputMethodPropertyList& GetCurrentProperties() const = 0;
46 };
47
48 }  // namespace input_method
49 }  // namespace chromeos
50
51 // TODO(yusukes,nona): This interface does not depend on IBus actually.
52 // Rename the file if needed.
53
54 #endif  // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_IBUS_CONTROLLER_H_