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.
5 #ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_IBUS_CONTROLLER_H_
6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_IBUS_CONTROLLER_H_
13 namespace input_method {
15 struct InputMethodProperty;
16 typedef std::vector<InputMethodProperty> InputMethodPropertyList;
18 // IBusController is used to interact with the system input method framework
19 // (which is currently IBus).
20 class IBusController {
24 virtual ~Observer() {}
25 virtual void PropertyChanged() = 0;
26 // TODO(yusukes): Add functions for IPC error handling.
29 // Creates an instance of the class.
30 static IBusController* Create();
32 virtual ~IBusController();
34 virtual void AddObserver(Observer* observer) = 0;
35 virtual void RemoveObserver(Observer* observer) = 0;
37 virtual void ClearProperties() = 0;
39 // Activates the input method property specified by the |key|. Returns true on
41 virtual bool ActivateInputMethodProperty(const std::string& key) = 0;
43 // Gets the latest input method property send from the system input method
45 virtual const InputMethodPropertyList& GetCurrentProperties() const = 0;
48 } // namespace input_method
49 } // namespace chromeos
51 // TODO(yusukes,nona): This interface does not depend on IBus actually.
52 // Rename the file if needed.
54 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_IBUS_CONTROLLER_H_