| 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 | |
| 18 namespace chromeos { | 12 namespace chromeos { |
| 19 namespace input_method { | 13 namespace input_method { |
| 20 | 14 |
| 21 struct InputMethodConfigValue; | 15 struct InputMethodConfigValue; |
| 22 struct InputMethodProperty; | 16 struct InputMethodProperty; |
| 23 typedef std::vector<InputMethodProperty> InputMethodPropertyList; | 17 typedef std::vector<InputMethodProperty> InputMethodPropertyList; |
| 24 | 18 |
| 25 // IBusController is used to interact with the system input method framework | 19 // IBusController is used to interact with the system input method framework |
| 26 // (which is currently IBus). | 20 // (which is currently IBus). |
| 27 class IBusController { | 21 class IBusController { |
| 28 public: | 22 public: |
| 29 class Observer { | 23 class Observer { |
| 30 public: | 24 public: |
| 31 virtual ~Observer() {} | 25 virtual ~Observer() {} |
| 32 virtual void PropertyChanged() = 0; | 26 virtual void PropertyChanged() = 0; |
| 33 virtual void OnConnected() = 0; | 27 virtual void OnConnected() = 0; |
| 34 virtual void OnDisconnected() = 0; | 28 virtual void OnDisconnected() = 0; |
| 35 // TODO(yusukes): Add functions for IPC error handling. | 29 // TODO(yusukes): Add functions for IPC error handling. |
| 36 }; | 30 }; |
| 37 | 31 |
| 38 // Creates an instance of the class. | 32 // Creates an instance of the class. |
| 39 static IBusController* Create( | 33 static IBusController* Create(); |
| 40 const scoped_refptr<base::SequencedTaskRunner>& default_task_runner, | |
| 41 const scoped_refptr<base::SequencedTaskRunner>& worker_task_runner); | |
| 42 | 34 |
| 43 virtual ~IBusController(); | 35 virtual ~IBusController(); |
| 44 | 36 |
| 45 virtual void AddObserver(Observer* observer) = 0; | 37 virtual void AddObserver(Observer* observer) = 0; |
| 46 virtual void RemoveObserver(Observer* observer) = 0; | 38 virtual void RemoveObserver(Observer* observer) = 0; |
| 47 | 39 |
| 48 // Starts the system input method framework. No-op if it's already started. | 40 // Starts the system input method framework. No-op if it's already started. |
| 49 virtual bool Start() = 0; | 41 virtual bool Start() = 0; |
| 50 | 42 |
| 51 // Resets the system input method framework. A composition text is discarded, | 43 // Resets the system input method framework. A composition text is discarded, |
| (...skipping 24 matching lines...) Expand all Loading... |
| 76 virtual const InputMethodPropertyList& GetCurrentProperties() const = 0; | 68 virtual const InputMethodPropertyList& GetCurrentProperties() const = 0; |
| 77 }; | 69 }; |
| 78 | 70 |
| 79 } // namespace input_method | 71 } // namespace input_method |
| 80 } // namespace chromeos | 72 } // namespace chromeos |
| 81 | 73 |
| 82 // TODO(yusukes,nona): This interface does not depend on IBus actually. | 74 // TODO(yusukes,nona): This interface does not depend on IBus actually. |
| 83 // Rename the file if needed. | 75 // Rename the file if needed. |
| 84 | 76 |
| 85 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_IBUS_CONTROLLER_H_ | 77 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_IBUS_CONTROLLER_H_ |
| OLD | NEW |