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 UI_BASE_IME_CHROMEOS_INPUT_METHOD_MANAGER_H_ | 5 #ifndef UI_BASE_IME_CHROMEOS_INPUT_METHOD_MANAGER_H_ |
6 #define UI_BASE_IME_CHROMEOS_INPUT_METHOD_MANAGER_H_ | 6 #define UI_BASE_IME_CHROMEOS_INPUT_METHOD_MANAGER_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
62 // keyboard is used, since it controls its own candidate window. | 62 // keyboard is used, since it controls its own candidate window. |
63 class CandidateWindowObserver { | 63 class CandidateWindowObserver { |
64 public: | 64 public: |
65 virtual ~CandidateWindowObserver() {} | 65 virtual ~CandidateWindowObserver() {} |
66 // Called when the candidate window is opened. | 66 // Called when the candidate window is opened. |
67 virtual void CandidateWindowOpened(InputMethodManager* manager) = 0; | 67 virtual void CandidateWindowOpened(InputMethodManager* manager) = 0; |
68 // Called when the candidate window is closed. | 68 // Called when the candidate window is closed. |
69 virtual void CandidateWindowClosed(InputMethodManager* manager) = 0; | 69 virtual void CandidateWindowClosed(InputMethodManager* manager) = 0; |
70 }; | 70 }; |
71 | 71 |
72 // ImeMenuObserver is notified of events related to the IME menu on the shelf | |
73 // bar. | |
74 class ImeMenuObserver { | |
75 public: | |
76 virtual ~ImeMenuObserver() {} | |
77 // Called when the IME menu is activated/deactivated. Notices to activate | |
michaelpg
2016/01/08 03:08:54
"Notices to activate"? Can you make this clearer?
Azure Wei
2016/01/08 03:26:05
Yeah, I simply mean that |activation| specifies wh
| |
78 // the IME menu if |activation| is true. | |
79 virtual void ImeMenuActivationChanged(bool activation) = 0; | |
80 }; | |
81 | |
72 class State : public base::RefCounted<InputMethodManager::State> { | 82 class State : public base::RefCounted<InputMethodManager::State> { |
73 public: | 83 public: |
74 // Returns a copy of state. | 84 // Returns a copy of state. |
75 virtual scoped_refptr<State> Clone() const = 0; | 85 virtual scoped_refptr<State> Clone() const = 0; |
76 | 86 |
77 // Adds an input method extension. This function does not takes ownership of | 87 // Adds an input method extension. This function does not takes ownership of |
78 // |instance|. | 88 // |instance|. |
79 virtual void AddInputMethodExtension( | 89 virtual void AddInputMethodExtension( |
80 const std::string& extension_id, | 90 const std::string& extension_id, |
81 const InputMethodDescriptors& descriptors, | 91 const InputMethodDescriptors& descriptors, |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
196 static UI_BASE_IME_EXPORT void Shutdown(); | 206 static UI_BASE_IME_EXPORT void Shutdown(); |
197 | 207 |
198 // Get the current UI session state (e.g. login screen, lock screen, etc.). | 208 // Get the current UI session state (e.g. login screen, lock screen, etc.). |
199 virtual UISessionState GetUISessionState() = 0; | 209 virtual UISessionState GetUISessionState() = 0; |
200 | 210 |
201 // Adds an observer to receive notifications of input method related | 211 // Adds an observer to receive notifications of input method related |
202 // changes as desribed in the Observer class above. | 212 // changes as desribed in the Observer class above. |
203 virtual void AddObserver(Observer* observer) = 0; | 213 virtual void AddObserver(Observer* observer) = 0; |
204 virtual void AddCandidateWindowObserver( | 214 virtual void AddCandidateWindowObserver( |
205 CandidateWindowObserver* observer) = 0; | 215 CandidateWindowObserver* observer) = 0; |
216 virtual void AddImeMenuObserver(ImeMenuObserver* observer) = 0; | |
206 virtual void RemoveObserver(Observer* observer) = 0; | 217 virtual void RemoveObserver(Observer* observer) = 0; |
207 virtual void RemoveCandidateWindowObserver( | 218 virtual void RemoveCandidateWindowObserver( |
208 CandidateWindowObserver* observer) = 0; | 219 CandidateWindowObserver* observer) = 0; |
220 virtual void RemoveImeMenuObserver(ImeMenuObserver* observer) = 0; | |
209 | 221 |
210 // Returns all input methods that are supported, including ones not active. | 222 // Returns all input methods that are supported, including ones not active. |
211 // This function never returns NULL. Note that input method extensions are NOT | 223 // This function never returns NULL. Note that input method extensions are NOT |
212 // included in the result. | 224 // included in the result. |
213 virtual scoped_ptr<InputMethodDescriptors> | 225 virtual scoped_ptr<InputMethodDescriptors> |
214 GetSupportedInputMethods() const = 0; | 226 GetSupportedInputMethods() const = 0; |
215 | 227 |
216 // Activates the input method property specified by the |key|. | 228 // Activates the input method property specified by the |key|. |
217 virtual void ActivateInputMethodMenuItem(const std::string& key) = 0; | 229 virtual void ActivateInputMethodMenuItem(const std::string& key) = 0; |
218 | 230 |
(...skipping 19 matching lines...) Expand all Loading... | |
238 std::vector<std::string>* input_method_ids) = 0; | 250 std::vector<std::string>* input_method_ids) = 0; |
239 | 251 |
240 // Returns new empty state for the |profile|. | 252 // Returns new empty state for the |profile|. |
241 virtual scoped_refptr<State> CreateNewState(Profile* profile) = 0; | 253 virtual scoped_refptr<State> CreateNewState(Profile* profile) = 0; |
242 | 254 |
243 // Returns active state. | 255 // Returns active state. |
244 virtual scoped_refptr<InputMethodManager::State> GetActiveIMEState() = 0; | 256 virtual scoped_refptr<InputMethodManager::State> GetActiveIMEState() = 0; |
245 | 257 |
246 // Replaces active state. | 258 // Replaces active state. |
247 virtual void SetState(scoped_refptr<State> state) = 0; | 259 virtual void SetState(scoped_refptr<State> state) = 0; |
260 | |
261 // Activates or deactivates the IME Menu. | |
262 virtual void ImeMenuActivationChanged(bool activation) = 0; | |
248 }; | 263 }; |
249 | 264 |
250 } // namespace input_method | 265 } // namespace input_method |
251 } // namespace chromeos | 266 } // namespace chromeos |
252 | 267 |
253 #endif // UI_BASE_IME_CHROMEOS_INPUT_METHOD_MANAGER_H_ | 268 #endif // UI_BASE_IME_CHROMEOS_INPUT_METHOD_MANAGER_H_ |
OLD | NEW |