Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 VIEWS_IME_CHARACTER_COMPOSER_H_ | 5 #ifndef VIEWS_IME_CHARACTER_COMPOSER_H_ |
| 6 #define VIEWS_IME_CHARACTER_COMPOSER_H_ | 6 #define VIEWS_IME_CHARACTER_COMPOSER_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
|
brettw
2011/06/29 20:31:56
Put a blank line after this (separating the "secti
hashimoto
2011/06/30 07:19:22
Fixed
| |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/string_util.h" | 11 #include "base/string_util.h" |
| 12 | 12 |
| 13 namespace views { | 13 namespace views { |
| 14 | 14 |
| 15 // A class to recognize compose and dead key sequence. | 15 // A class to recognize compose and dead key sequence. |
| 16 // Outputs composed character. | 16 // Outputs composed character. |
| 17 // | 17 // |
| 18 // TODO(hashimoto): support unicode character composition starting with | 18 // TODO(hashimoto): support unicode character composition starting with |
| 19 // Ctrl-Shift-U. http://crosbug.com/15925 | 19 // Ctrl-Shift-U. http://crosbug.com/15925 |
| 20 class CharacterComposer { | 20 class CharacterComposer { |
| 21 public: | 21 public: |
| 22 CharacterComposer(); | 22 CharacterComposer(); |
| 23 ~CharacterComposer(); | 23 ~CharacterComposer(); |
| 24 | 24 |
| 25 void Reset(); | 25 void Reset(); |
| 26 | 26 |
| 27 // Filters keypress. Returns true if the keypress is handled. | 27 // Filters keypress. Returns true if the keypress is handled. |
|
brettw
2011/06/29 20:31:56
Can you clarify in this comment what "handled" mea
hashimoto
2011/06/30 07:19:22
Fixed
| |
| 28 bool FilterKeyPress(unsigned int keycode); | 28 bool FilterKeyPress(unsigned int keycode); |
| 29 | 29 |
| 30 // Returns a string consisting of composed character. | 30 // Returns a string consisting of composed character. |
| 31 // Empty is returned when there is no composition result. | 31 // Empty is returned when there is no composition result. |
| 32 const string16& GetComposedCharacter() const { | 32 const string16& GetComposedCharacter() const { |
|
brettw
2011/06/29 20:31:56
This is valid according to the style guide, but I
hashimoto
2011/06/30 07:19:22
Fixed
| |
| 33 return composed_character_; | 33 return composed_character_; |
| 34 } | 34 } |
| 35 | 35 |
| 36 private: | 36 private: |
| 37 std::vector<unsigned int> compose_buffer_; | 37 std::vector<unsigned int> compose_buffer_; |
|
brettw
2011/06/29 20:31:56
Can you document these two members? They aren't bl
hashimoto
2011/06/30 07:19:22
Fixed
| |
| 38 string16 composed_character_; | 38 string16 composed_character_; |
| 39 | 39 |
| 40 DISALLOW_COPY_AND_ASSIGN(CharacterComposer); | 40 DISALLOW_COPY_AND_ASSIGN(CharacterComposer); |
| 41 }; | 41 }; |
| 42 | 42 |
| 43 } // namespace views | 43 } // namespace views |
| 44 | 44 |
| 45 #endif // VIEWS_IME_CHARACTER_COMPOSER_H_ | 45 #endif // VIEWS_IME_CHARACTER_COMPOSER_H_ |
| 46 // | |
| OLD | NEW |