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 CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_ENGINE_IBUS_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_ENGINE_IBUS_H_ |
6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_ENGINE_IBUS_H_ | 6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_ENGINE_IBUS_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 virtual void SetSurroundingText(const std::string& text, uint32 cursor_pos, | 96 virtual void SetSurroundingText(const std::string& text, uint32 cursor_pos, |
97 uint32 anchor_pos) OVERRIDE; | 97 uint32 anchor_pos) OVERRIDE; |
98 | 98 |
99 // Called when the connection with ibus-daemon is connected. | 99 // Called when the connection with ibus-daemon is connected. |
100 void OnConnected(); | 100 void OnConnected(); |
101 | 101 |
102 // Called whtn the connection with ibus-daemon is disconnected. | 102 // Called whtn the connection with ibus-daemon is disconnected. |
103 void OnDisconnected(); | 103 void OnDisconnected(); |
104 | 104 |
105 private: | 105 private: |
106 // Returns true if the connection to ibus-daemon is avaiable. | |
107 bool IsConnected(); | |
108 | |
109 // Converts MenuItem to InputMethodProperty. | 106 // Converts MenuItem to InputMethodProperty. |
110 void MenuItemToProperty(const MenuItem& item, | 107 void MenuItemToProperty(const MenuItem& item, |
111 input_method::InputMethodProperty* property); | 108 input_method::InputMethodProperty* property); |
112 | 109 |
113 // Registers the engine component. | 110 // Registers the engine component. |
114 void RegisterComponent(); | 111 void RegisterComponent(); |
115 | 112 |
116 // Called when the RegisterComponent is failed. | |
117 void OnComponentRegistrationFailed(); | |
118 | |
119 // Called when the RegisterComponent is succeeded. | |
120 void OnComponentRegistered(); | |
121 | |
122 // Called when the ibus-daemon sends CreateEngine message with corresponding | 113 // Called when the ibus-daemon sends CreateEngine message with corresponding |
123 // engine id. | 114 // engine id. |
124 void CreateEngineHandler( | 115 void CreateEngineHandler( |
125 const IBusEngineFactoryService::CreateEngineResponseSender& sender); | 116 const IBusEngineFactoryService::CreateEngineResponseSender& sender); |
126 | 117 |
127 // Returns current IBusEngineService, if there is no available service, this | 118 // Returns current IBusEngineService, if there is no available service, this |
128 // function returns NULL. | 119 // function returns NULL. |
129 IBusEngineService* GetCurrentService(); | 120 IBusEngineService* GetCurrentService(); |
130 | 121 |
131 // True if the current context has focus. | 122 // True if the current context has focus. |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 scoped_ptr<IBusEngineService> ibus_engine_service_; | 172 scoped_ptr<IBusEngineService> ibus_engine_service_; |
182 scoped_ptr<IBusEngineFactoryService> ibus_engine_factory_service_; | 173 scoped_ptr<IBusEngineFactoryService> ibus_engine_factory_service_; |
183 | 174 |
184 // Used for making callbacks. | 175 // Used for making callbacks. |
185 base::WeakPtrFactory<InputMethodEngineIBus> weak_ptr_factory_; | 176 base::WeakPtrFactory<InputMethodEngineIBus> weak_ptr_factory_; |
186 }; | 177 }; |
187 | 178 |
188 } // namespace chromeos | 179 } // namespace chromeos |
189 | 180 |
190 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_ENGINE_IBUS_H_ | 181 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_INPUT_METHOD_ENGINE_IBUS_H_ |
OLD | NEW |