OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef UI_BASE_IME_REMOTE_INPUT_METHOD_WIN_H_ | |
6 #define UI_BASE_IME_REMOTE_INPUT_METHOD_WIN_H_ | |
7 | |
8 #include <Windows.h> | |
9 | |
10 #include <string> | |
11 | |
12 #include "base/basictypes.h" | |
13 #include "base/compiler_specific.h" | |
14 #include "base/memory/scoped_ptr.h" | |
15 #include "ui/base/ui_export.h" | |
16 | |
17 namespace ui { | |
18 namespace internal { | |
19 class InputMethodDelegate; | |
20 class RemoteInputMethodDelegateWin; | |
21 } // namespace internal | |
22 | |
23 class InputMethod; | |
24 | |
25 // RemoteInputMethodWin is a special implementation of ui::InputMethod that | |
26 // works as a proxy of an IME handler running in the metro_driver process. | |
27 // RemoteInputMethodWin works as follows. | |
28 // - Any action to RemoteInputMethodPrivateWin should be delegated to the | |
29 // metro_driver process via RemoteInputMethodDelegateWin. | |
30 // - Data retrieval from RemoteInputMethodPrivateWin is implemented with | |
31 // data cache. Whenever the IME state in the metro_driver process is changed, | |
32 // someone needs to call RemoteInputMethodPrivateWin::OnCandidatePopupChanged | |
Seigo Nonaka
2013/11/18 20:00:27
Could you add example for this "someone"?
yukawa
2013/11/19 07:17:51
Done.
| |
33 // and RemoteInputMethodPrivateWin::OnLanguageChanged to update the data | |
34 // cache. | |
35 // Caveats: RemoteInputMethodWin does not support InputMethodObserver yet. | |
36 | |
37 // Returns the public interface of RemoteInputMethodWin. | |
38 // Caveats: Currently only one instance of RemoteInputMethodWin is able to run | |
39 // at the same time. | |
40 UI_EXPORT scoped_ptr<InputMethod> CreateRemoteInputMethodWin( | |
Seigo Nonaka
2013/11/18 20:00:27
How about moving this function into static class f
yukawa
2013/11/19 07:17:51
Sorry, to which class?
1)
class UI_EXPORT RemoteI
Seigo Nonaka
2013/11/20 04:14:29
Sorry I miss understood. Current comment is fine.
| |
41 internal::InputMethodDelegate* delegate); | |
42 | |
43 // Private interface of RemoteInputMethodWin. | |
44 class UI_EXPORT RemoteInputMethodPrivateWin { | |
45 public: | |
46 RemoteInputMethodPrivateWin(); | |
47 | |
48 // Returns the private interface of RemoteInputMethodWin when and only when | |
49 // |input_method| is instanciated via CreateRemoteInputMethodWin. Caller does | |
50 // not take the ownership of the returned object. | |
51 // As you might notice, this is yet another reinplementation of dynamic_cast | |
52 // or IUnknown::QueryInterface. | |
53 static RemoteInputMethodPrivateWin* Get(InputMethod* input_method); | |
54 | |
55 // Installs additional delegate that is required by RemoteInputMethodWin. | |
Seigo Nonaka
2013/11/18 20:00:27
Sorry, I'm bit confused with this comment.
An inst
yukawa
2013/11/19 07:17:51
No, multiple delegates are not supported. Updated
| |
56 virtual void SetRemoteDelegate( | |
57 internal::RemoteInputMethodDelegateWin* delegate) = 0; | |
58 | |
59 // Synchronizes that the visibility of IME's popup window in the remote | |
60 // process. RemoteInputMethodWin::IsCandidatePopupOpen relies on this | |
61 // notification. | |
62 virtual void OnCandidatePopupChanged(bool visible) = 0; | |
63 | |
64 // Synchronizes that Win32 LANGID and the presence of IME in the remote | |
65 // process. RemoteInputMethodWin::GetInputLocale and | |
66 // RemoteInputMethodWin::GetInputLocale rely on this notification. | |
67 virtual void OnLanguageChanged(LANGID langid, bool is_ime) = 0; | |
68 | |
69 private: | |
70 DISALLOW_COPY_AND_ASSIGN(RemoteInputMethodPrivateWin); | |
71 }; | |
72 | |
73 } // namespace ui | |
74 | |
75 #endif // UI_BASE_IME_REMOTE_INPUT_METHOD_WIN_H_ | |
OLD | NEW |