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 <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "ui/base/ime/chromeos/input_method_descriptor.h" | 14 #include "ui/base/ime/chromeos/input_method_descriptor.h" |
15 #include "ui/base/ui_base_export.h" | 15 #include "ui/base/ime/ui_base_ime_export.h" |
16 | 16 |
17 class Profile; | 17 class Profile; |
18 | 18 |
19 namespace ui { | 19 namespace ui { |
20 class Accelerator; | 20 class Accelerator; |
21 } // namespace ui | 21 } // namespace ui |
22 | 22 |
23 namespace user_manager { | 23 namespace user_manager { |
24 class User; | 24 class User; |
25 } // namespace user_manager | 25 } // namespace user_manager |
26 | 26 |
27 namespace chromeos { | 27 namespace chromeos { |
28 class ComponentExtensionIMEManager; | 28 class ComponentExtensionIMEManager; |
29 class InputMethodEngineInterface; | 29 class InputMethodEngineInterface; |
30 namespace input_method { | 30 namespace input_method { |
31 class InputMethodUtil; | 31 class InputMethodUtil; |
32 class ImeKeyboard; | 32 class ImeKeyboard; |
33 | 33 |
34 // This class manages input methodshandles. Classes can add themselves as | 34 // This class manages input methodshandles. Classes can add themselves as |
35 // observers. Clients can get an instance of this library class by: | 35 // observers. Clients can get an instance of this library class by: |
36 // InputMethodManager::Get(). | 36 // InputMethodManager::Get(). |
37 class UI_BASE_EXPORT InputMethodManager { | 37 class UI_BASE_IME_EXPORT InputMethodManager { |
38 public: | 38 public: |
39 enum UISessionState { | 39 enum UISessionState { |
40 STATE_LOGIN_SCREEN = 0, | 40 STATE_LOGIN_SCREEN = 0, |
41 STATE_BROWSER_SCREEN, | 41 STATE_BROWSER_SCREEN, |
42 STATE_LOCK_SCREEN, | 42 STATE_LOCK_SCREEN, |
43 STATE_TERMINATING, | 43 STATE_TERMINATING, |
44 }; | 44 }; |
45 | 45 |
46 class Observer { | 46 class Observer { |
47 public: | 47 public: |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 protected: | 174 protected: |
175 friend base::RefCounted<InputMethodManager::State>; | 175 friend base::RefCounted<InputMethodManager::State>; |
176 | 176 |
177 virtual ~State(); | 177 virtual ~State(); |
178 }; | 178 }; |
179 | 179 |
180 virtual ~InputMethodManager() {} | 180 virtual ~InputMethodManager() {} |
181 | 181 |
182 // Gets the global instance of InputMethodManager. Initialize() must be called | 182 // Gets the global instance of InputMethodManager. Initialize() must be called |
183 // first. | 183 // first. |
184 static UI_BASE_EXPORT InputMethodManager* Get(); | 184 static UI_BASE_IME_EXPORT InputMethodManager* Get(); |
185 | 185 |
186 // Sets the global instance. |instance| will be owned by the internal pointer | 186 // Sets the global instance. |instance| will be owned by the internal pointer |
187 // and deleted by Shutdown(). | 187 // and deleted by Shutdown(). |
188 // TODO(nona): Instanciate InputMethodManagerImpl inside of this function once | 188 // TODO(nona): Instanciate InputMethodManagerImpl inside of this function once |
189 // crbug.com/164375 is fixed. | 189 // crbug.com/164375 is fixed. |
190 static UI_BASE_EXPORT void Initialize(InputMethodManager* instance); | 190 static UI_BASE_IME_EXPORT void Initialize(InputMethodManager* instance); |
191 | 191 |
192 // Destroy the global instance. | 192 // Destroy the global instance. |
193 static UI_BASE_EXPORT void Shutdown(); | 193 static UI_BASE_IME_EXPORT void Shutdown(); |
194 | 194 |
195 // Get the current UI session state (e.g. login screen, lock screen, etc.). | 195 // Get the current UI session state (e.g. login screen, lock screen, etc.). |
196 virtual UISessionState GetUISessionState() = 0; | 196 virtual UISessionState GetUISessionState() = 0; |
197 | 197 |
198 // Adds an observer to receive notifications of input method related | 198 // Adds an observer to receive notifications of input method related |
199 // changes as desribed in the Observer class above. | 199 // changes as desribed in the Observer class above. |
200 virtual void AddObserver(Observer* observer) = 0; | 200 virtual void AddObserver(Observer* observer) = 0; |
201 virtual void AddCandidateWindowObserver( | 201 virtual void AddCandidateWindowObserver( |
202 CandidateWindowObserver* observer) = 0; | 202 CandidateWindowObserver* observer) = 0; |
203 virtual void RemoveObserver(Observer* observer) = 0; | 203 virtual void RemoveObserver(Observer* observer) = 0; |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 virtual scoped_refptr<InputMethodManager::State> GetActiveIMEState() = 0; | 241 virtual scoped_refptr<InputMethodManager::State> GetActiveIMEState() = 0; |
242 | 242 |
243 // Replaces active state. | 243 // Replaces active state. |
244 virtual void SetState(scoped_refptr<State> state) = 0; | 244 virtual void SetState(scoped_refptr<State> state) = 0; |
245 }; | 245 }; |
246 | 246 |
247 } // namespace input_method | 247 } // namespace input_method |
248 } // namespace chromeos | 248 } // namespace chromeos |
249 | 249 |
250 #endif // UI_BASE_IME_CHROMEOS_INPUT_METHOD_MANAGER_H_ | 250 #endif // UI_BASE_IME_CHROMEOS_INPUT_METHOD_MANAGER_H_ |
OLD | NEW |