OLD | NEW |
1 // Copyright (c) 2011 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium OS 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_INPUT_METHOD_H_ | 5 #ifndef CHROMEOS_INPUT_METHOD_H_ |
6 #define CHROMEOS_INPUT_METHOD_H_ | 6 #define CHROMEOS_INPUT_METHOD_H_ |
7 | 7 |
8 #include <sstream> | 8 #include <sstream> |
9 #include <string> | 9 #include <string> |
| 10 #include <utility> |
10 #include <vector> | 11 #include <vector> |
11 | 12 |
12 #include <base/basictypes.h> | 13 #include <base/basictypes.h> |
13 #include <base/logging.h> // DCHECK | 14 #include <base/logging.h> // DCHECK |
14 | 15 |
15 namespace chromeos { | 16 namespace chromeos { |
16 | 17 |
17 // A structure which represents an input method. All methods in this class have | 18 // A structure which represents an input method. All methods in this class have |
18 // to be in chromeos_input_method.h since Chrome also creates an instance of | 19 // to be in chromeos_input_method.h since Chrome also creates an instance of |
19 // the class. | 20 // the class. |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 extern bool (*SetImeConfig)(InputMethodStatusConnection* connection, | 272 extern bool (*SetImeConfig)(InputMethodStatusConnection* connection, |
272 const char* section, | 273 const char* section, |
273 const char* config_name, | 274 const char* config_name, |
274 const ImeConfigValue& value); | 275 const ImeConfigValue& value); |
275 | 276 |
276 // Returns the keyboard overlay ID corresponding to |input_method_id|. | 277 // Returns the keyboard overlay ID corresponding to |input_method_id|. |
277 // Returns an empty string if there is no corresponding keyboard overlay ID. | 278 // Returns an empty string if there is no corresponding keyboard overlay ID. |
278 extern std::string (*GetKeyboardOverlayId)( | 279 extern std::string (*GetKeyboardOverlayId)( |
279 const std::string& input_method_id); | 280 const std::string& input_method_id); |
280 | 281 |
| 282 // Sends handwriting strokes to ibus-daemon. The std::pair contains x and y |
| 283 // coordinates. (0.0, 0.0) represents the top-left corner of a handwriting area, |
| 284 // and (1.0, 1.0) does the bottom-right. For example, the second stroke for ロ |
| 285 // (Katakana character Ro) would be something like [(0,0), (1,0), (1,1)]. |
| 286 // strokes.size() should always be >= 2 (i.e. a single dot is not allowed). |
| 287 typedef std::vector<std::pair<double, double> > HandwritingStrokes; |
| 288 extern void (*SendHandwritingStrokes)( |
| 289 InputMethodStatusConnection* connection, const HandwritingStrokes& strokes); |
| 290 |
| 291 // Clears the last N handwriting strokes. Pass zero for clearing all strokes. |
| 292 // TODO(yusukes): Currently ibus-daemon only accepts 0 for |n_strokes|. |
| 293 extern void (*CancelHandwriting)(InputMethodStatusConnection* connection, |
| 294 int n_strokes); |
| 295 |
281 // | 296 // |
282 // FUNCTIONS BELOW ARE ONLY FOR UNIT TESTS. DO NOT USE THEM. | 297 // FUNCTIONS BELOW ARE ONLY FOR UNIT TESTS. DO NOT USE THEM. |
283 // | 298 // |
284 bool InputMethodIdIsWhitelisted(const std::string& input_method_id); | 299 bool InputMethodIdIsWhitelisted(const std::string& input_method_id); |
285 bool XkbLayoutIsSupported(const std::string& xkb_layout); | 300 bool XkbLayoutIsSupported(const std::string& xkb_layout); |
286 InputMethodDescriptor CreateInputMethodDescriptor( | 301 InputMethodDescriptor CreateInputMethodDescriptor( |
287 const std::string& id, | 302 const std::string& id, |
288 const std::string& display_name, | 303 const std::string& display_name, |
289 const std::string& raw_layout, | 304 const std::string& raw_layout, |
290 const std::string& language_code); | 305 const std::string& language_code); |
291 | 306 |
292 } // namespace chromeos | 307 } // namespace chromeos |
293 | 308 |
294 #endif // CHROMEOS_INPUT_METHOD_H_ | 309 #endif // CHROMEOS_INPUT_METHOD_H_ |
OLD | NEW |