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() {} | |
stevenjb
2016/01/20 18:33:43
blank line
Azure Wei
2016/01/21 10:25:07
Done.
| |
77 // Called when the IME menu is activated or deactivated. | |
78 virtual void ImeMenuActivationChanged(bool is_active) = 0; | |
stevenjb
2016/01/20 18:33:43
private:
DISALLOW_ASSIGN(...)
Azure Wei
2016/01/21 10:25:07
Done.
| |
79 }; | |
80 | |
72 class State : public base::RefCounted<InputMethodManager::State> { | 81 class State : public base::RefCounted<InputMethodManager::State> { |
73 public: | 82 public: |
74 // Returns a copy of state. | 83 // Returns a copy of state. |
75 virtual scoped_refptr<State> Clone() const = 0; | 84 virtual scoped_refptr<State> Clone() const = 0; |
76 | 85 |
77 // Adds an input method extension. This function does not takes ownership of | 86 // Adds an input method extension. This function does not takes ownership of |
78 // |instance|. | 87 // |instance|. |
79 virtual void AddInputMethodExtension( | 88 virtual void AddInputMethodExtension( |
80 const std::string& extension_id, | 89 const std::string& extension_id, |
81 const InputMethodDescriptors& descriptors, | 90 const InputMethodDescriptors& descriptors, |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
196 static UI_BASE_IME_EXPORT void Shutdown(); | 205 static UI_BASE_IME_EXPORT void Shutdown(); |
197 | 206 |
198 // Get the current UI session state (e.g. login screen, lock screen, etc.). | 207 // Get the current UI session state (e.g. login screen, lock screen, etc.). |
199 virtual UISessionState GetUISessionState() = 0; | 208 virtual UISessionState GetUISessionState() = 0; |
200 | 209 |
201 // Adds an observer to receive notifications of input method related | 210 // Adds an observer to receive notifications of input method related |
202 // changes as desribed in the Observer class above. | 211 // changes as desribed in the Observer class above. |
203 virtual void AddObserver(Observer* observer) = 0; | 212 virtual void AddObserver(Observer* observer) = 0; |
204 virtual void AddCandidateWindowObserver( | 213 virtual void AddCandidateWindowObserver( |
205 CandidateWindowObserver* observer) = 0; | 214 CandidateWindowObserver* observer) = 0; |
215 virtual void AddImeMenuObserver(ImeMenuObserver* observer) = 0; | |
206 virtual void RemoveObserver(Observer* observer) = 0; | 216 virtual void RemoveObserver(Observer* observer) = 0; |
207 virtual void RemoveCandidateWindowObserver( | 217 virtual void RemoveCandidateWindowObserver( |
208 CandidateWindowObserver* observer) = 0; | 218 CandidateWindowObserver* observer) = 0; |
219 virtual void RemoveImeMenuObserver(ImeMenuObserver* observer) = 0; | |
209 | 220 |
210 // Returns all input methods that are supported, including ones not active. | 221 // Returns all input methods that are supported, including ones not active. |
211 // This function never returns NULL. Note that input method extensions are NOT | 222 // This function never returns NULL. Note that input method extensions are NOT |
212 // included in the result. | 223 // included in the result. |
213 virtual scoped_ptr<InputMethodDescriptors> | 224 virtual scoped_ptr<InputMethodDescriptors> |
214 GetSupportedInputMethods() const = 0; | 225 GetSupportedInputMethods() const = 0; |
215 | 226 |
216 // Activates the input method property specified by the |key|. | 227 // Activates the input method property specified by the |key|. |
217 virtual void ActivateInputMethodMenuItem(const std::string& key) = 0; | 228 virtual void ActivateInputMethodMenuItem(const std::string& key) = 0; |
218 | 229 |
(...skipping 19 matching lines...) Expand all Loading... | |
238 std::vector<std::string>* input_method_ids) = 0; | 249 std::vector<std::string>* input_method_ids) = 0; |
239 | 250 |
240 // Returns new empty state for the |profile|. | 251 // Returns new empty state for the |profile|. |
241 virtual scoped_refptr<State> CreateNewState(Profile* profile) = 0; | 252 virtual scoped_refptr<State> CreateNewState(Profile* profile) = 0; |
242 | 253 |
243 // Returns active state. | 254 // Returns active state. |
244 virtual scoped_refptr<InputMethodManager::State> GetActiveIMEState() = 0; | 255 virtual scoped_refptr<InputMethodManager::State> GetActiveIMEState() = 0; |
245 | 256 |
246 // Replaces active state. | 257 // Replaces active state. |
247 virtual void SetState(scoped_refptr<State> state) = 0; | 258 virtual void SetState(scoped_refptr<State> state) = 0; |
259 | |
260 // Activates or deactivates the IME Menu. | |
261 virtual void ImeMenuActivationChanged(bool is_active) = 0; | |
248 }; | 262 }; |
249 | 263 |
250 } // namespace input_method | 264 } // namespace input_method |
251 } // namespace chromeos | 265 } // namespace chromeos |
252 | 266 |
253 #endif // UI_BASE_IME_CHROMEOS_INPUT_METHOD_MANAGER_H_ | 267 #endif // UI_BASE_IME_CHROMEOS_INPUT_METHOD_MANAGER_H_ |
OLD | NEW |