| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_IBUS_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_IBUS_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_IBUS_CONTROLLER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_IBUS_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/memory/ref_counted.h" |
| 13 |
| 14 namespace base { |
| 15 class SequencedTaskRunner; |
| 16 } // namespace base |
| 17 |
| 12 namespace chromeos { | 18 namespace chromeos { |
| 13 namespace input_method { | 19 namespace input_method { |
| 14 | 20 |
| 15 struct InputMethodConfigValue; | 21 struct InputMethodConfigValue; |
| 16 struct InputMethodProperty; | 22 struct InputMethodProperty; |
| 17 typedef std::vector<InputMethodProperty> InputMethodPropertyList; | 23 typedef std::vector<InputMethodProperty> InputMethodPropertyList; |
| 18 | 24 |
| 19 // IBusController is used to interact with the system input method framework | 25 // IBusController is used to interact with the system input method framework |
| 20 // (which is currently IBus). | 26 // (which is currently IBus). |
| 21 class IBusController { | 27 class IBusController { |
| 22 public: | 28 public: |
| 23 class Observer { | 29 class Observer { |
| 24 public: | 30 public: |
| 25 virtual ~Observer() {} | 31 virtual ~Observer() {} |
| 26 virtual void PropertyChanged() = 0; | 32 virtual void PropertyChanged() = 0; |
| 27 virtual void OnConnected() = 0; | 33 virtual void OnConnected() = 0; |
| 28 virtual void OnDisconnected() = 0; | 34 virtual void OnDisconnected() = 0; |
| 29 // TODO(yusukes): Add functions for IPC error handling. | 35 // TODO(yusukes): Add functions for IPC error handling. |
| 30 }; | 36 }; |
| 31 | 37 |
| 32 // Creates an instance of the class. | 38 // Creates an instance of the class. |
| 33 static IBusController* Create(); | 39 static IBusController* Create( |
| 40 const scoped_refptr<base::SequencedTaskRunner>& default_task_runner, |
| 41 const scoped_refptr<base::SequencedTaskRunner>& worker_task_runner); |
| 34 | 42 |
| 35 virtual ~IBusController(); | 43 virtual ~IBusController(); |
| 36 | 44 |
| 37 virtual void AddObserver(Observer* observer) = 0; | 45 virtual void AddObserver(Observer* observer) = 0; |
| 38 virtual void RemoveObserver(Observer* observer) = 0; | 46 virtual void RemoveObserver(Observer* observer) = 0; |
| 39 | 47 |
| 40 // Starts the system input method framework. No-op if it's already started. | 48 // Starts the system input method framework. No-op if it's already started. |
| 41 virtual bool Start() = 0; | 49 virtual bool Start() = 0; |
| 42 | 50 |
| 43 // Resets the system input method framework. A composition text is discarded, | 51 // Resets the system input method framework. A composition text is discarded, |
| (...skipping 24 matching lines...) Expand all Loading... |
| 68 virtual const InputMethodPropertyList& GetCurrentProperties() const = 0; | 76 virtual const InputMethodPropertyList& GetCurrentProperties() const = 0; |
| 69 }; | 77 }; |
| 70 | 78 |
| 71 } // namespace input_method | 79 } // namespace input_method |
| 72 } // namespace chromeos | 80 } // namespace chromeos |
| 73 | 81 |
| 74 // TODO(yusukes,nona): This interface does not depend on IBus actually. | 82 // TODO(yusukes,nona): This interface does not depend on IBus actually. |
| 75 // Rename the file if needed. | 83 // Rename the file if needed. |
| 76 | 84 |
| 77 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_IBUS_CONTROLLER_H_ | 85 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_IBUS_CONTROLLER_H_ |
| OLD | NEW |