OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_INPUT_METHOD_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_MANAGER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_MANAGER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_MANAGER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 InputMethodManager* manager, | 47 InputMethodManager* manager, |
48 const InputMethodDescriptor& current_input_method, | 48 const InputMethodDescriptor& current_input_method, |
49 size_t num_active_input_methods) = 0; | 49 size_t num_active_input_methods) = 0; |
50 | 50 |
51 // Called when the list of properties is changed. | 51 // Called when the list of properties is changed. |
52 virtual void PropertyListChanged( | 52 virtual void PropertyListChanged( |
53 InputMethodManager* manager, | 53 InputMethodManager* manager, |
54 const ImePropertyList& current_ime_properties) = 0; | 54 const ImePropertyList& current_ime_properties) = 0; |
55 }; | 55 }; |
56 | 56 |
| 57 // CandidateWindowObserver is notified of events related to the candidate |
| 58 // window. These events won't occur when the virtual keyboard is used, |
| 59 // since it controls its own candidate window. |
| 60 class CandidateWindowObserver { |
| 61 public: |
| 62 virtual ~CandidateWindowObserver() {} |
| 63 |
| 64 // Called when the candidate window is opened. |
| 65 virtual void CandidateWindowOpened(InputMethodManager* manager) = 0; |
| 66 |
| 67 // Called when the candidate window is closed. |
| 68 virtual void CandidateWindowClosed(InputMethodManager* manager) = 0; |
| 69 }; |
| 70 |
57 class PreferenceObserver { | 71 class PreferenceObserver { |
58 public: | 72 public: |
59 virtual ~PreferenceObserver() {} | 73 virtual ~PreferenceObserver() {} |
60 | 74 |
61 // Called when the preferences have to be updated. | 75 // Called when the preferences have to be updated. |
62 virtual void PreferenceUpdateNeeded( | 76 virtual void PreferenceUpdateNeeded( |
63 InputMethodManager* manager, | 77 InputMethodManager* manager, |
64 const InputMethodDescriptor& previous_input_method, | 78 const InputMethodDescriptor& previous_input_method, |
65 const InputMethodDescriptor& current_input_method) = 0; | 79 const InputMethodDescriptor& current_input_method) = 0; |
66 | 80 |
(...skipping 11 matching lines...) Expand all Loading... |
78 const std::string& virtual_keyboard_layout) = 0; | 92 const std::string& virtual_keyboard_layout) = 0; |
79 }; | 93 }; |
80 | 94 |
81 virtual ~InputMethodManager() {} | 95 virtual ~InputMethodManager() {} |
82 | 96 |
83 static InputMethodManager* GetInstance(); | 97 static InputMethodManager* GetInstance(); |
84 | 98 |
85 // Adds an observer to receive notifications of input method related | 99 // Adds an observer to receive notifications of input method related |
86 // changes as desribed in the Observer class above. | 100 // changes as desribed in the Observer class above. |
87 virtual void AddObserver(Observer* observer) = 0; | 101 virtual void AddObserver(Observer* observer) = 0; |
| 102 virtual void AddCandidateWindowObserver( |
| 103 CandidateWindowObserver* observer) = 0; |
88 virtual void AddPreLoginPreferenceObserver(PreferenceObserver* observer) = 0; | 104 virtual void AddPreLoginPreferenceObserver(PreferenceObserver* observer) = 0; |
89 virtual void AddPostLoginPreferenceObserver(PreferenceObserver* observer) = 0; | 105 virtual void AddPostLoginPreferenceObserver(PreferenceObserver* observer) = 0; |
90 virtual void AddVirtualKeyboardObserver( | 106 virtual void AddVirtualKeyboardObserver( |
91 VirtualKeyboardObserver* observer) = 0; | 107 VirtualKeyboardObserver* observer) = 0; |
92 virtual void RemoveObserver(Observer* observer) = 0; | 108 virtual void RemoveObserver(Observer* observer) = 0; |
| 109 virtual void RemoveCandidateWindowObserver( |
| 110 CandidateWindowObserver* observer) = 0; |
93 virtual void RemovePreLoginPreferenceObserver( | 111 virtual void RemovePreLoginPreferenceObserver( |
94 PreferenceObserver* observer) = 0; | 112 PreferenceObserver* observer) = 0; |
95 virtual void RemovePostLoginPreferenceObserver( | 113 virtual void RemovePostLoginPreferenceObserver( |
96 PreferenceObserver* observer) = 0; | 114 PreferenceObserver* observer) = 0; |
97 virtual void RemoveVirtualKeyboardObserver( | 115 virtual void RemoveVirtualKeyboardObserver( |
98 VirtualKeyboardObserver* observer) = 0; | 116 VirtualKeyboardObserver* observer) = 0; |
99 | 117 |
100 // Returns all input methods that are supported, including ones not active. | 118 // Returns all input methods that are supported, including ones not active. |
101 // Caller has to delete the returned list. This function never returns NULL. | 119 // Caller has to delete the returned list. This function never returns NULL. |
102 virtual InputMethodDescriptors* GetSupportedInputMethods() = 0; | 120 virtual InputMethodDescriptors* GetSupportedInputMethods() = 0; |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 virtual InputMethodDescriptor previous_input_method() const = 0; | 263 virtual InputMethodDescriptor previous_input_method() const = 0; |
246 virtual InputMethodDescriptor current_input_method() const = 0; | 264 virtual InputMethodDescriptor current_input_method() const = 0; |
247 | 265 |
248 virtual const ImePropertyList& current_ime_properties() const = 0; | 266 virtual const ImePropertyList& current_ime_properties() const = 0; |
249 }; | 267 }; |
250 | 268 |
251 } // namespace input_method | 269 } // namespace input_method |
252 } // namespace chromeos | 270 } // namespace chromeos |
253 | 271 |
254 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_MANAGER_H_ | 272 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_MANAGER_H_ |
OLD | NEW |