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 CHROMEOS_IME_INPUT_METHOD_MANAGER_H_ | 5 #ifndef UI_BASE_IME_CHROMEOS_INPUT_METHOD_MANAGER_H_ |
6 #define CHROMEOS_IME_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 "chromeos/chromeos_export.h" | 14 #include "ui/base/ime/chromeos/input_method_descriptor.h" |
15 #include "chromeos/ime/input_method_descriptor.h" | 15 #include "ui/base/ui_base_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 CHROMEOS_EXPORT InputMethodManager { | 37 class UI_BASE_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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 protected: | 166 protected: |
167 friend base::RefCounted<InputMethodManager::State>; | 167 friend base::RefCounted<InputMethodManager::State>; |
168 | 168 |
169 virtual ~State(); | 169 virtual ~State(); |
170 }; | 170 }; |
171 | 171 |
172 virtual ~InputMethodManager() {} | 172 virtual ~InputMethodManager() {} |
173 | 173 |
174 // Gets the global instance of InputMethodManager. Initialize() must be called | 174 // Gets the global instance of InputMethodManager. Initialize() must be called |
175 // first. | 175 // first. |
176 static CHROMEOS_EXPORT InputMethodManager* Get(); | 176 static UI_BASE_EXPORT InputMethodManager* Get(); |
177 | 177 |
178 // Sets the global instance. |instance| will be owned by the internal pointer | 178 // Sets the global instance. |instance| will be owned by the internal pointer |
179 // and deleted by Shutdown(). | 179 // and deleted by Shutdown(). |
180 // TODO(nona): Instanciate InputMethodManagerImpl inside of this function once | 180 // TODO(nona): Instanciate InputMethodManagerImpl inside of this function once |
181 // crbug.com/164375 is fixed. | 181 // crbug.com/164375 is fixed. |
182 static CHROMEOS_EXPORT void Initialize(InputMethodManager* instance); | 182 static UI_BASE_EXPORT void Initialize(InputMethodManager* instance); |
183 | 183 |
184 // Destroy the global instance. | 184 // Destroy the global instance. |
185 static CHROMEOS_EXPORT void Shutdown(); | 185 static UI_BASE_EXPORT void Shutdown(); |
186 | 186 |
187 // Get the current UI session state (e.g. login screen, lock screen, etc.). | 187 // Get the current UI session state (e.g. login screen, lock screen, etc.). |
188 virtual UISessionState GetUISessionState() = 0; | 188 virtual UISessionState GetUISessionState() = 0; |
189 | 189 |
190 // Adds an observer to receive notifications of input method related | 190 // Adds an observer to receive notifications of input method related |
191 // changes as desribed in the Observer class above. | 191 // changes as desribed in the Observer class above. |
192 virtual void AddObserver(Observer* observer) = 0; | 192 virtual void AddObserver(Observer* observer) = 0; |
193 virtual void AddCandidateWindowObserver( | 193 virtual void AddCandidateWindowObserver( |
194 CandidateWindowObserver* observer) = 0; | 194 CandidateWindowObserver* observer) = 0; |
195 virtual void RemoveObserver(Observer* observer) = 0; | 195 virtual void RemoveObserver(Observer* observer) = 0; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 // Returns active state. | 232 // Returns active state. |
233 virtual scoped_refptr<InputMethodManager::State> GetActiveIMEState() = 0; | 233 virtual scoped_refptr<InputMethodManager::State> GetActiveIMEState() = 0; |
234 | 234 |
235 // Replaces active state. | 235 // Replaces active state. |
236 virtual void SetState(scoped_refptr<State> state) = 0; | 236 virtual void SetState(scoped_refptr<State> state) = 0; |
237 }; | 237 }; |
238 | 238 |
239 } // namespace input_method | 239 } // namespace input_method |
240 } // namespace chromeos | 240 } // namespace chromeos |
241 | 241 |
242 #endif // CHROMEOS_IME_INPUT_METHOD_MANAGER_H_ | 242 #endif // UI_BASE_IME_CHROMEOS_INPUT_METHOD_MANAGER_H_ |
OLD | NEW |