Codebase list mozc / dbe8005
Protobuf file location refactoring part 1. This is a series of CLs to move *.proto files into protocol/ directory. Following files will be moved in this CL. - commands.proto - candidates.proto This is just a refactoring. No user-visible behavior change should occur. BUG=none TEST=unittest Hiroyuki Komatsu authored 8 years ago Yohei Yukawa committed 8 years ago
208 changed file(s) with 1731 addition(s) and 1638 deletion(s). Raw diff Collapse all Expand all
212212 'type': 'none',
213213 'variables': {
214214 'proto_files': [
215 '../session/candidates.proto',
216 '../session/commands.proto',
215 '../protocol/candidates.proto',
216 '../protocol/commands.proto',
217217 ],
218218 },
219219 'actions': [
3838 #include "base/system_util.h"
3939 #include "base/version.h"
4040 #include "engine/engine_factory.h"
41 #include "session/commands.pb.h"
41 #include "protocol/commands.pb.h"
4242 #include "session/session_handler.h"
4343 #include "session/session_usage_observer.h"
4444 #include "usage_stats/usage_stats_uploader.h"
175175 '../../dictionary/dictionary_base.gyp:user_pos',
176176 '../../net/net.gyp:http_client',
177177 '../../net/net.gyp:json_util',
178 '../../session/session_base.gyp:key_parser',
179 '../../session/session_base.gyp:session_protocol',
178 '../../protocol/protocol.gyp:commands_proto',
180179 '../../session/session.gyp:session',
181180 '../../session/session.gyp:session_handler',
182181 '../../session/session.gyp:session_usage_observer',
182 '../../session/session_base.gyp:key_parser',
183 '../../usage_stats/usage_stats.gyp:usage_stats_uploader',
183184 '../../usage_stats/usage_stats_base.gyp:usage_stats',
184 '../../usage_stats/usage_stats.gyp:usage_stats_uploader',
185185 ],
186186 },
187187 {
5454 #include "net/http_client_pepper.h"
5555 #include "net/jsoncpp.h"
5656 #include "net/json_util.h"
57 #include "session/commands.pb.h"
57 #include "protocol/commands.pb.h"
5858 #include "session/session_handler.h"
5959 #include "session/session_usage_observer.h"
6060 #include "usage_stats/usage_stats.h"
5151 #include "base/version.h"
5252 #include "config/config.pb.h"
5353 #include "ipc/ipc.h"
54 #include "session/commands.pb.h"
54 #include "protocol/commands.pb.h"
5555
5656 #ifdef OS_MACOSX
5757 #include "base/mac_process.h"
4343 '../base/base.gyp:base',
4444 '../config/config.gyp:config_protocol',
4545 '../ipc/ipc.gyp:ipc',
46 '../session/session_base.gyp:session_protocol',
46 '../protocol/protocol.gyp:commands_proto',
4747 ],
4848 },
4949 {
5555 'dependencies': [
5656 '../base/base.gyp:base',
5757 '../config/config.gyp:config_protocol',
58 '../session/session_base.gyp:session_protocol',
58 '../protocol/protocol.gyp:commands_proto',
5959 ],
6060 },
6161 ],
3636 #include "base/port.h"
3737 #include "base/scoped_ptr.h"
3838 #include "client/client_interface.h"
39 #include "session/commands.pb.h"
39 #include "protocol/commands.pb.h"
4040 #include "testing/base/public/gunit_prod.h"
4141 // for FRIEND_TEST()
4242
3333
3434 #include <string>
3535 #include "base/port.h"
36 #include "session/commands.pb.h"
36 #include "protocol/commands.pb.h"
3737
3838 namespace mozc {
3939
3232 #include <map>
3333 #include <string>
3434 #include "client/client_interface.h"
35 #include "session/commands.pb.h"
35 #include "protocol/commands.pb.h"
3636
3737 namespace mozc {
3838 namespace client {
4242 #include "base/util.h"
4343 #include "client/client.h"
4444 #include "config/config_handler.h"
45 #include "session/commands.pb.h"
45 #include "protocol/commands.pb.h"
4646 #include "session/random_keyevents_generator.h"
4747
4848 DEFINE_string(server_path, "", "specify server path");
4040 #include "base/util.h"
4141 #include "client/client.h"
4242 #include "evaluation/scorer.h"
43 #include "session/commands.pb.h"
43 #include "protocol/commands.pb.h"
4444
4545 // Test data automatically generated by gen_client_quality_test_data.py
4646 // TestCase test_cases[] is defined.
4242 #include "base/system_util.h"
4343 #include "base/util.h"
4444 #include "client/client.h"
45 #include "protocol/commands.pb.h"
46 #include "renderer/renderer_client.h"
4547 #include "renderer/renderer_command.pb.h"
46 #include "renderer/renderer_client.h"
47 #include "session/commands.pb.h"
4848 #include "session/key_parser.h"
4949
5050 DEFINE_bool(display_preedit, false, "display predit to tty");
3737 #include "base/util.h"
3838 #include "base/version.h"
3939 #include "ipc/ipc_mock.h"
40 #include "session/commands.pb.h"
40 #include "protocol/commands.pb.h"
4141 #include "testing/base/public/gunit.h"
4242
4343 namespace mozc {
4040 ],
4141 'dependencies': [
4242 '../base/base.gyp:base',
43 '../session/session_base.gyp:session_protocol',
43 '../protocol/protocol.gyp:commands_proto',
4444 'client.gyp:client',
4545 ],
4646 'actions': [
4343 #include "config/character_form_manager.h"
4444 #include "config/config.pb.h"
4545 #include "config/config_handler.h"
46 #include "session/commands.pb.h"
46 #include "protocol/commands.pb.h"
4747 #include "session/key_event_util.h"
4848
4949 // Use flags instead of constant for performance evaluation.
5656 '../config/config.gyp:config_handler',
5757 '../config/config.gyp:config_protocol',
5858 '../protobuf/protobuf.gyp:protobuf',
59 '../protocol/protocol.gyp:commands_proto',
5960 '../session/session_base.gyp:key_event_util',
6061 '../session/session_base.gyp:key_parser',
61 # This is needed. GYP is not smart enough about indirect dependencies.
62 '../session/session_base.gyp:session_protocol',
6362 '../transliteration/transliteration.gyp:transliteration',
6463 ],
6564 },
8079 'dependencies': [
8180 '../config/config.gyp:config_handler',
8281 '../config/config.gyp:config_protocol',
82 '../protocol/protocol.gyp:commands_proto',
8383 '../session/session_base.gyp:request_test_util',
84 '../session/session_base.gyp:session_protocol',
8584 '../testing/testing.gyp:gtest_main',
8685 'composer',
8786 ],
4141 #include "composer/internal/typing_corrector.h"
4242 #include "composer/internal/transliterators.h"
4343 #include "composer/type_corrected_query.h"
44 #include "session/commands.pb.h"
44 #include "protocol/commands.pb.h"
4545 #include "transliteration/transliteration.h"
4646 // for FRIEND_TEST()
4747 #include "testing/base/public/gunit_prod.h"
3535 #include "base/scoped_ptr.h"
3636 #include "composer/composition_interface.h"
3737 #include "composer/table.h"
38 #include "session/commands.pb.h"
38 #include "protocol/commands.pb.h"
3939 #include "transliteration/transliteration.h"
4040
4141 DEFINE_string(table, "system://romanji-hiragana.tsv",
4141 #include "config/character_form_manager.h"
4242 #include "config/config.pb.h"
4343 #include "config/config_handler.h"
44 #include "session/commands.pb.h"
44 #include "protocol/commands.pb.h"
4545 #include "session/key_parser.h"
4646 #include "testing/base/public/gunit.h"
4747
3535 #include "composer/table.h"
3636 #include "composer/type_corrected_query.h"
3737 #include "composer/internal/typing_model.h"
38 #include "session/commands.pb.h"
38 #include "protocol/commands.pb.h"
3939 #include "testing/base/public/gunit.h"
4040
4141 namespace mozc {
3232 #include "base/port.h"
3333 #include "base/scoped_ptr.h"
3434 #include "base/string_piece.h"
35 #include "session/commands.pb.h"
35 #include "protocol/commands.pb.h"
3636 // for FRIEND_TEST()
3737 #include "testing/base/public/gunit_prod.h"
3838
4545 #include "composer/internal/typing_model.h"
4646 #include "config/config.pb.h"
4747 #include "config/config_handler.h"
48 #include "session/commands.pb.h"
48 #include "protocol/commands.pb.h"
4949
5050 namespace mozc {
5151 namespace composer {
3434 #include "composer/internal/composition_input.h"
3535 #include "config/config.pb.h"
3636 #include "config/config_handler.h"
37 #include "protocol/commands.pb.h"
3738 #include "testing/base/public/gunit.h"
38 #include "session/commands.pb.h"
3939
4040 DECLARE_string(test_tmpdir);
4141
2929 #include "config/config_handler.h"
3030 #include "converter/conversion_request.h"
3131 #include "base/logging.h"
32 #include "session/commands.pb.h"
32 #include "protocol/commands.pb.h"
3333
3434 namespace mozc {
3535
4545 '../dictionary/dictionary_base.gyp:pos_matcher',
4646 '../prediction/prediction.gyp:prediction',
4747 '../prediction/prediction.gyp:prediction_protocol',
48 '../protocol/protocol.gyp:commands_proto',
4849 '../rewriter/rewriter.gyp:rewriter',
49 '../session/session_base.gyp:session_protocol',
5050 '../usage_stats/usage_stats_base.gyp:usage_stats',
5151 'converter_base.gyp:conversion_request',
5252 'converter_base.gyp:immutable_converter',
123123 '../dictionary/dictionary.gyp:suffix_dictionary',
124124 '../dictionary/dictionary_base.gyp:pos_matcher',
125125 '../dictionary/dictionary_base.gyp:suppression_dictionary',
126 '../protocol/protocol.gyp:commands_proto',
126127 '../rewriter/rewriter_base.gyp:gen_rewriter_files#host',
127 '../session/session_base.gyp:session_protocol',
128128 'connector',
129129 'immutable_converter_interface',
130130 'segmenter',
139139 ],
140140 'dependencies': [
141141 '../base/base.gyp:base',
142 '../session/session_base.gyp:session_protocol',
142 '../protocol/protocol.gyp:commands_proto',
143143 'segments',
144144 'conversion_request',
145145 ],
163163 ],
164164 'dependencies': [
165165 '../base/base.gyp:base',
166 '../session/session_base.gyp:session_protocol',
166 '../protocol/protocol.gyp:commands_proto',
167167 ],
168168 },
169169 {
4949 #include "engine/engine_factory.h"
5050 #include "engine/engine_interface.h"
5151 #include "engine/mock_data_engine_factory.h"
52 #include "session/commands.pb.h"
52 #include "protocol/commands.pb.h"
5353
5454 DEFINE_int32(max_conversion_candidates_size, 200, "maximum candidates size");
5555 DEFINE_string(user_profile_dir, "", "path to user profile directory");
4545 '../engine/engine.gyp:engine',
4646 '../engine/engine.gyp:engine_factory',
4747 '../engine/engine.gyp:mock_data_engine_factory',
48 '../session/session_base.gyp:session_protocol',
48 '../protocol/protocol.gyp:commands_proto',
4949 'converter.gyp:converter',
5050 'converter_base.gyp:pos_id_printer',
5151 'converter_base.gyp:segments',
4040 #include "converter/segments.h"
4141 #include "engine/engine_factory.h"
4242 #include "engine/engine_interface.h"
43 #include "session/commands.pb.h"
43 #include "protocol/commands.pb.h"
4444 #include "testing/base/public/gunit.h"
4545
4646 #ifdef OS_ANDROID
6969 #include "prediction/predictor_interface.h"
7070 #include "prediction/suggestion_filter.h"
7171 #include "prediction/user_history_predictor.h"
72 #include "protocol/commands.pb.h"
7273 #include "rewriter/rewriter.h"
7374 #include "rewriter/rewriter_interface.h"
74 #include "session/commands.pb.h"
7575 #include "testing/base/public/gunit.h"
7676 #include "transliteration/transliteration.h"
7777 #include "usage_stats/usage_stats.h"
5757 '../engine/engine.gyp:engine_factory',
5858 '../engine/engine.gyp:mock_data_engine_factory',
5959 '../prediction/prediction_base.gyp:suggestion_filter',
60 '../protocol/protocol.gyp:commands_proto',
6061 '../rewriter/rewriter.gyp:rewriter',
6162 '../session/session_base.gyp:request_test_util',
62 '../session/session_base.gyp:session_protocol',
6363 '../testing/testing.gyp:gtest_main',
6464 '../transliteration/transliteration.gyp:transliteration',
6565 '../usage_stats/usage_stats_test.gyp:usage_stats_testing_util',
8585 '../config/config.gyp:config_handler',
8686 '../engine/engine.gyp:engine',
8787 '../engine/engine.gyp:engine_factory',
88 '../protocol/protocol.gyp:commands_proto',
8889 '../session/session_base.gyp:request_test_util',
89 '../session/session_base.gyp:session_protocol',
9090 '../testing/testing.gyp:gtest_main',
9191 ],
9292 },
5858 #include "dictionary/pos_matcher.h"
5959 #include "dictionary/suppression_dictionary.h"
6060 #include "prediction/suggestion_filter.h"
61 #include "session/commands.pb.h"
61 #include "protocol/commands.pb.h"
6262
6363 using mozc::dictionary::DictionaryInterface;
6464 using mozc::dictionary::POSMatcher;
5757 #include "dictionary/system/value_dictionary.h"
5858 #include "dictionary/user_dictionary_stub.h"
5959 #include "prediction/suggestion_filter.h"
60 #include "session/commands.pb.h"
60 #include "protocol/commands.pb.h"
6161 #include "testing/base/public/gunit.h"
6262
6363 DECLARE_string(test_tmpdir);
4242 #include "engine/chromeos_engine_factory.h"
4343 #include "engine/engine_factory.h"
4444 #include "engine/engine_interface.h"
45 #include "session/commands.pb.h"
45 #include "protocol/commands.pb.h"
4646 #include "session/request_test_util.h"
4747 #include "testing/base/public/gunit.h"
4848
4343 #include "converter/conversion_request.h"
4444 #include "converter/converter_interface.h"
4545 #include "converter/segments.h"
46 #include "session/commands.pb.h"
46 #include "protocol/commands.pb.h"
4747
4848 namespace mozc {
4949 namespace quality_regression {
287287 Performed_Conversion_ReportBug
288288 Performed_Conversion_DeleteSelectedCandidate
289289
290 # The count of some SessionCommands defined in session/commands.proto
290 # The count of some SessionCommands defined in protocol/commands.proto
291291 SendCommand_Revert
292292 SendCommand_Submit
293293 SendCommand_SelectCandidate
5555 '../dictionary/system/system_dictionary.gyp:value_dictionary',
5656 '../prediction/prediction.gyp:prediction',
5757 '../prediction/prediction_base.gyp:suggestion_filter',
58 '../protocol/protocol.gyp:commands_proto',
5859 '../rewriter/rewriter.gyp:rewriter',
59 '../session/session_base.gyp:session_protocol',
6060 ],
6161 },
6262 {
120120 '../base/base.gyp:base',
121121 '../data_manager/testing/mock_data_manager.gyp:mock_data_manager',
122122 '../prediction/prediction.gyp:prediction',
123 '../session/session_base.gyp:session_protocol',
123 '../protocol/protocol.gyp:commands_proto',
124124 'engine',
125125 ],
126126 },
4343 #include "gui/character_pad/data/local_character_map.h"
4444 #include "gui/character_pad/data/unicode_blocks.h"
4545 #include "gui/character_pad/selection_handler.h"
46 #include "session/commands.pb.h"
46 #include "protocol/commands.pb.h"
4747
4848 namespace mozc {
4949 namespace gui {
5151 #include "gui/base/win_util.h"
5252 #include "handwriting/handwriting_manager.h"
5353 #include "handwriting/zinnia_handwriting.h"
54 #include "session/commands.pb.h"
54 #include "protocol/commands.pb.h"
5555
5656 namespace mozc {
5757
5252 #include "gui/config_dialog/keymap_editor.h"
5353 #include "gui/config_dialog/roman_table_editor.h"
5454 #include "ipc/ipc.h"
55 #include "session/commands.pb.h"
55 #include "protocol/commands.pb.h"
5656 #include "session/internal/keymap.h"
5757
5858 namespace {
3939 #include <vector>
4040 #include "base/file_stream.h"
4141 #include "base/util.h"
42 #include "session/commands.pb.h"
42 #include "protocol/commands.pb.h"
4343
4444 namespace mozc {
4545 namespace gui {
4444 #include "gui/base/table_util.h"
4545 #include "gui/config_dialog/combobox_delegate.h"
4646 #include "gui/config_dialog/keybinding_editor_delegate.h"
47 #include "session/commands.pb.h"
47 #include "protocol/commands.pb.h"
4848 #include "session/internal/keymap.h"
4949 #include "session/key_parser.h"
5050 // TODO(komatsu): internal files should not be used from external modules.
3737 #include "base/logging.h"
3838 #include "base/util.h"
3939 #include "gui/base/table_util.h"
40 #include "session/commands.pb.h"
40 #include "protocol/commands.pb.h"
4141
4242 namespace mozc {
4343 namespace gui {
5959 '../dictionary/dictionary_base.gyp:user_dictionary',
6060 '../ipc/ipc.gyp:ipc',
6161 '../ipc/ipc.gyp:window_info_protocol',
62 '../session/session_base.gyp:session_protocol',
62 '../protocol/protocol.gyp:commands_proto',
6363 'gen_base_files',
6464 ],
6565 'includes': [
370370 '../config/config.gyp:stats_config_util',
371371 '../handwriting/handwriting.gyp:handwriting_manager',
372372 '../handwriting/handwriting.gyp:zinnia_handwriting',
373 '../session/session_base.gyp:session_protocol',
373 '../protocol/protocol.gyp:commands_proto',
374374 'gen_character_pad_files',
375375 'gen_character_pad_cp932_data',
376376 'gen_character_pad_data',
383383 ['enable_cloud_handwriting==1', {
384384 'dependencies': [
385385 '../handwriting/handwriting.gyp:cloud_handwriting',
386 '../session/session_base.gyp:session_protocol',
386 '../protocol/protocol.gyp:commands_proto',
387387 ],
388388 }],
389389 ['use_libzinnia==1 and OS=="linux"', {
478478 '../config/config.gyp:config_handler',
479479 '../config/config.gyp:config_protocol',
480480 '../config/config.gyp:stats_config_util',
481 '../protocol/protocol.gyp:commands_proto',
481482 '../session/session_base.gyp:key_parser',
482483 '../session/session_base.gyp:keymap',
483 '../session/session_base.gyp:session_protocol',
484484 'gen_config_dialog_files',
485485 ],
486486 'includes': [
596596 '../data_manager/data_manager.gyp:user_pos_manager',
597597 '../dictionary/dictionary_base.gyp:dictionary_protocol',
598598 '../dictionary/dictionary_base.gyp:user_dictionary',
599 '../session/session_base.gyp:session_protocol',
599 '../protocol/protocol.gyp:commands_proto',
600600 'gen_config_dialog_files',
601601 'gen_dictionary_tool_files',
602602 ],
652652 '../dictionary/dictionary_base.gyp:dictionary_protocol',
653653 '../dictionary/dictionary_base.gyp:pos_matcher',
654654 '../dictionary/dictionary_base.gyp:user_dictionary',
655 '../session/session_base.gyp:session_protocol',
655 '../protocol/protocol.gyp:commands_proto',
656656 'gen_word_register_dialog_files',
657657 ],
658658 'includes': [
750750 'dependencies': [
751751 '../base/base.gyp:base',
752752 '../ipc/ipc.gyp:ipc',
753 '../session/session_base.gyp:session_protocol',
753 '../protocol/protocol.gyp:commands_proto',
754754 '../usage_stats/usage_stats_base.gyp:usage_stats',
755755 'gen_post_install_dialog_files',
756756 ],
810810 '../client/client.gyp:client',
811811 '../config/config.gyp:config_protocol',
812812 '../ipc/ipc.gyp:ipc',
813 '../session/session_base.gyp:session_protocol',
813 '../protocol/protocol.gyp:commands_proto',
814814 'gen_set_default_dialog_files',
815815 ],
816816 'conditions': [
861861 'dependencies': [
862862 '../base/base.gyp:base',
863863 '../client/client.gyp:client',
864 '../protocol/protocol.gyp:commands_proto',
864865 '../renderer/renderer.gyp:renderer_client',
865 '../session/session_base.gyp:session_protocol',
866866 ],
867867 },
868868 {
5252 #include "client/client.h"
5353 #include "config/config.pb.h"
5454 #include "ipc/ipc.h"
55 #include "protocol/commands.pb.h"
5556 #include "renderer/renderer_client.h"
56 #include "session/commands.pb.h"
5757 #include "session/ime_switch_util.h"
5858
5959 using mozc::commands::Candidates;
607607 if (selectedRange.location != NSNotFound ||
608608 selectedRange.length != NSNotFound ||
609609 selectedRange.location + deletion_range.offset() > 0) {
610 // The offset is a negative value. See session/commands.proto for
610 // The offset is a negative value. See protocol/commands.proto for
611611 // the details.
612612 selectedRange.location += deletion_range.offset();
613613 selectedRange.length += deletion_range.length();
2828
2929 @class NSURL;
3030
31 #include "session/commands.pb.h"
31 #include "protocol/commands.pb.h"
3232
3333 @interface GoogleJapaneseInputController ()
3434 // Updates |composedString_| from the result of a key event and put
3535 #include "base/const.h"
3636 #include "base/logging.h"
3737 #include "base/mutex.h"
38 #include "session/commands.pb.h"
38 #include "protocol/commands.pb.h"
3939
4040 GoogleJapaneseInputServer *g_imkServer = nil;
4141
2828
2929 #import "mac/GoogleJapaneseInputServer.h"
3030
31 #include "session/commands.pb.h"
31 #include "protocol/commands.pb.h"
3232 #include "testing/base/public/googletest.h"
3333 #include "testing/base/public/gunit.h"
3434
3434
3535 #include "base/logging.h"
3636 #include "base/mutex.h"
37 #include "session/commands.pb.h"
37 #include "protocol/commands.pb.h"
3838
3939 using mozc::commands::KeyEvent;
4040 using mozc::once_t;
3131 #import <Carbon/Carbon.h>
3232 #import <Cocoa/Cocoa.h>
3333
34 #include "session/commands.pb.h"
34 #include "protocol/commands.pb.h"
3535 #include "testing/base/public/googletest.h"
3636 #include "testing/base/public/gunit.h"
3737
4242 '../client/client.gyp:client',
4343 '../client/client.gyp:client_mock',
4444 '../config/config.gyp:config_protocol',
45 '../protocol/protocol.gyp:commands_proto',
4546 '../renderer/renderer.gyp:renderer_client',
4647 '../renderer/renderer.gyp:renderer_protocol',
4748 '../session/session_base.gyp:ime_switch_util',
48 '../session/session_base.gyp:session_protocol',
4949 '../testing/testing.gyp:gtest_main',
5050 'gen_key_mappings',
5151 ],
00 MAJOR=2
11 MINOR=17
2 BUILD=2098
2 BUILD=2099
33 REVISION=102
44 # NACL_DICTIONARY_VERSION is the target version of the system dictionary to be
55 # downloaded by NaCl Mozc.
5959 #include "prediction/suggestion_filter.h"
6060 #include "prediction/zero_query_data.h"
6161 #include "prediction/zero_query_number_data.h"
62 #include "session/commands.pb.h"
62 #include "protocol/commands.pb.h"
6363
6464 // This flag is set by predictor.cc
6565 // We can remove this after the ambiguity expansion feature get stable.
6565 #include "dictionary/suppression_dictionary.h"
6666 #include "dictionary/system/system_dictionary.h"
6767 #include "prediction/suggestion_filter.h"
68 #include "session/commands.pb.h"
68 #include "protocol/commands.pb.h"
6969 #include "session/request_test_util.h"
7070 #include "testing/base/public/gmock.h"
7171 #include "testing/base/public/googletest.h"
4444 'dependencies': [
4545 '../base/base.gyp:base',
4646 '../base/base.gyp:config_file_stream',
47 '../composer/composer.gyp:composer',
4748 '../config/config.gyp:config_handler',
48 '../composer/composer.gyp:composer',
4949 '../converter/converter_base.gyp:conversion_request',
5050 '../converter/converter_base.gyp:immutable_converter',
5151 '../converter/converter_base.gyp:segmenter',
5353 '../dictionary/dictionary.gyp:dictionary',
5454 '../dictionary/dictionary.gyp:suffix_dictionary',
5555 '../dictionary/dictionary_base.gyp:suppression_dictionary',
56 '../protocol/protocol.gyp:commands_proto',
5657 '../rewriter/rewriter.gyp:rewriter',
5758 '../session/session_base.gyp:request_test_util',
58 '../session/session_base.gyp:session_protocol',
5959 '../storage/storage.gyp:storage',
6060 '../usage_stats/usage_stats_base.gyp:usage_stats',
6161 'gen_zero_query_data#host',
4242 ],
4343 'dependencies': [
4444 '../composer/composer.gyp:composer',
45 '../config/config.gyp:config_handler',
4546 '../config/config.gyp:config_protocol',
4647 '../converter/converter_base.gyp:connector',
4748 '../converter/converter_base.gyp:converter_mock',
5657 '../dictionary/dictionary_base.gyp:pos_matcher',
5758 '../dictionary/system/system_dictionary.gyp:system_dictionary',
5859 '../dictionary/system/system_dictionary.gyp:value_dictionary',
59 '../config/config.gyp:config_handler',
60 '../protocol/protocol.gyp:commands_proto',
6061 '../session/session_base.gyp:request_test_util',
61 '../session/session_base.gyp:session_protocol',
6262 '../testing/testing.gyp:gtest_main',
6363 'prediction.gyp:prediction',
6464 ],
3636 #include "config/config.pb.h"
3737 #include "config/config_handler.h"
3838 #include "converter/segments.h"
39 #include "session/commands.pb.h"
39 #include "protocol/commands.pb.h"
4040
4141 DECLARE_bool(enable_expansion_for_dictionary_predictor);
4242 DECLARE_bool(enable_expansion_for_user_history_predictor);
4444 #include "dictionary/suppression_dictionary.h"
4545 #include "prediction/predictor_interface.h"
4646 #include "prediction/user_history_predictor.h"
47 #include "session/commands.pb.h"
47 #include "protocol/commands.pb.h"
4848 #include "session/request_test_util.h"
4949 #include "testing/base/public/gmock.h"
5050 #include "testing/base/public/googletest.h"
5050 #include "dictionary/suppression_dictionary.h"
5151 #include "prediction/predictor_interface.h"
5252 #include "prediction/user_history_predictor.pb.h"
53 #include "protocol/commands.pb.h"
5354 #include "rewriter/variants_rewriter.h"
54 #include "session/commands.pb.h"
5555 #include "storage/encrypted_string_storage.h"
5656 #include "storage/lru_cache.h"
5757 #include "usage_stats/usage_stats.h"
4747 #include "data_manager/testing/mock_data_manager.h"
4848 #include "dictionary/dictionary_mock.h"
4949 #include "dictionary/suppression_dictionary.h"
50 #include "session/commands.pb.h"
50 #include "protocol/commands.pb.h"
5151 #include "session/request_test_util.h"
5252 #include "testing/base/public/googletest.h"
5353 #include "testing/base/public/gunit.h"
0 // Copyright 2010-2015, Google Inc.
1 // All rights reserved.
2 //
3 // Redistribution and use in source and binary forms, with or without
4 // modification, are permitted provided that the following conditions are
5 // met:
6 //
7 // * Redistributions of source code must retain the above copyright
8 // notice, this list of conditions and the following disclaimer.
9 // * Redistributions in binary form must reproduce the above
10 // copyright notice, this list of conditions and the following disclaimer
11 // in the documentation and/or other materials provided with the
12 // distribution.
13 // * Neither the name of Google Inc. nor the names of its
14 // contributors may be used to endorse or promote products derived from
15 // this software without specific prior written permission.
16 //
17 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
29 // Protocol messages of candidates to be used for mozc client/server
30 // communication and client/renderer communication.
31
32 syntax = "proto2";
33
34 package mozc.commands;
35
36 option java_outer_classname = "ProtoCandidates";
37 option java_package = "org.mozc.android.inputmethod.japanese.protobuf";
38
39 // Annotation against a candidate.
40 message Annotation {
41 // Annotation prepended to the value.
42 optional string prefix = 1;
43 // Annotation appended to the value.
44 optional string suffix = 2;
45 // Type of the candidate such as [HALF][KATAKANA], [GREEK],
46 // [Black square], etc...
47 optional string description = 3;
48 // Shortcut key to select this candidate.
49 optional string shortcut = 4;
50 // Set to true if this candidate can be deleted from history.
51 optional bool deletable = 5 [default = false];
52 };
53
54 // Additional information to a candidate word. This message is
55 // used for describing a word usage for instance.
56 message Information {
57 // Unique number specifying the information.
58 optional int32 id = 1;
59
60 // Title string of the information. For usage, this value is
61 // probably equal to Candidate::value or its canonicalized value.
62 optional string title = 2;
63
64 // The content of the information. For usage, this value actually
65 // describes how to use the word.
66 optional string description = 3;
67
68 // The IDs of candidates which connect with the information.
69 repeated int32 candidate_id = 4;
70 };
71
72 // Category describes the attribute of the words.
73 enum Category {
74 CONVERSION = 0;
75 PREDICTION = 1;
76 SUGGESTION = 2;
77 TRANSLITERATION = 3;
78 USAGE = 4;
79 };
80
81 // DisplayType is a hint to UI renderers describing how the words are
82 // displayed.
83 enum DisplayType {
84 MAIN = 0;
85 CASCADE = 1;
86 };
87
88 // TODO(nona): merge to RendererCommand::Rectangle
89 message Rectangle {
90 required int32 x = 1;
91 required int32 y = 2;
92 required int32 width = 3;
93 required int32 height = 4;
94 }
95
96 message InformationList {
97 optional uint32 focused_index = 1;
98 repeated Information information = 2;
99 // Category of the infolist.
100 optional Category category = 3 [default = CONVERSION];
101
102 // Information to be used for rendering.
103 optional DisplayType display_type = 4 [default = CASCADE];
104
105 // How long rendere needs to wait before the infolist is displayed.
106 // the default setting is 500 msec.
107 optional uint32 delay = 5 [ default = 500 ];
108 };
109
110 // Message representing the footer part of the candidate window.
111 message Footer {
112 // Message shown like a status bar.
113 optional string label = 1;
114 // Whether index (e.g. 10/120) is visible or not.
115 optional bool index_visible = 2 [default = false];
116 // Whether the logo image is visible or not.
117 optional bool logo_visible = 3 [default = false];
118 // Message modestly shown. It is used for displaying the version on
119 // dev-channel now.
120 optional string sub_label = 4;
121 };
122
123 message CandidateWord {
124 // Unique number specifing the candidate. This may be a negative value.
125 optional int32 id = 1;
126 // The first index should be zero and index numbers should increase by one.
127 optional uint32 index = 2;
128 // Reading of the value. The value is only used when the key is
129 // different from the input composition (e.g. suggestion/prediction).
130 optional string key = 3;
131 // Converted value. (e.g. Kanji value).
132 optional string value = 4;
133 optional Annotation annotation = 5;
134 };
135
136 message CandidateList {
137 // This value represents the focused position of the next
138 // |candidates|. If the |candidates| is a part of the whole
139 // candidate words (as a result of paging), this value indicates the
140 // position from the beginning of that part. (ex. where
141 // |candidates| contatins 10th to 18th candidates, focused_index=0
142 // means the 10th candidate, but not 1st candidate.
143 //
144 // The existense of |focused_index| does not represents whether this
145 // candidate list is a 'suggestion' or not. |category| represents
146 // it.
147 optional uint32 focused_index = 1;
148 repeated CandidateWord candidates = 2;
149 // Category of the candidates.
150 optional Category category = 3 [default = CONVERSION];
151 };
152
153 // TODO(komatsu) rename it to CandidateWindow.
154 message Candidates {
155 // TODO(komatsu): Use CandidateList.
156 // When has_focused_index() is true, this message contains predicted and
157 // normally converted candidates. Otherwise, when the field is not set,
158 // this message contains a 'suggestion'.
159 optional uint32 focused_index = 1;
160
161 // The size of the total candidates in this candidate list. The
162 // value does not include the size of subcandidate lists. Note, the
163 // next repeated-Candidate=3 may not contain all candidates.
164 // all_candidates contains the values of subcandidate lists.
165 required uint32 size = 2;
166
167 // TODO(komatsu): Use CandidateList.
168 repeated group Candidate = 3 {
169 // The first index should be zero and index numbers should increase by one.
170 required uint32 index = 4;
171 required string value = 5;
172 optional int32 id = 9; // Unique number specifing the candidate.
173 optional Annotation annotation = 7;
174 optional int32 information_id = 10;
175 };
176 // The position on the composition in character counted by Util::CharsLen.
177 // The number represents the left edge of the candidate window. For example,
178 // if the composition is "あいう" and the cursor is the position is between
179 // "あ" and "い" (e.g. "あ|いう"), the number should be 1.
180 // Note, Util::CharsLen does not take care of IVS or combining character
181 // so much. Thus CharsLen's behavoir on those characters might be changed.
182 required uint32 position = 6;
183
184 // Nested candidates aka cascading window.
185 optional Candidates subcandidates = 8;
186
187 // Usages of candidates.
188 optional InformationList usages = 10;
189
190 // TODO(komatsu): Use CandidateList.
191 // Category of the candidates
192 optional Category category = 11 [default = CONVERSION];
193
194 // Information to be used for rendering.
195 optional DisplayType display_type = 12 [default = MAIN];
196
197 // Footer of the GUI window.
198 optional Footer footer = 13;
199
200 // The direction of candidates in the window. This is just a
201 // suggestion from the server and client does not have to follow.
202 enum Direction {
203 VERTICAL = 0;
204 HORIZONTAL = 1;
205 };
206 optional Direction direction = 14 [ default = VERTICAL ];
207
208 // This position is used for suggest window position.
209 optional Rectangle composition_rectangle = 15;
210 optional Rectangle caret_rectangle = 16;
211
212 enum CandidateWindowLocation{
213 // Shows candidate window under the caret. This is used for prediction and
214 // conversion
215 CARET = 0;
216 // Shows candidate window aligned with composition area. This is used for
217 // suggestion.
218 COMPOSITION = 1;
219 }
220 optional CandidateWindowLocation window_location = 17;
221
222 // The number of candidates per page.
223 optional uint32 page_size = 18 [ default = 9 ];
224 };
0 // Copyright 2010-2015, Google Inc.
1 // All rights reserved.
2 //
3 // Redistribution and use in source and binary forms, with or without
4 // modification, are permitted provided that the following conditions are
5 // met:
6 //
7 // * Redistributions of source code must retain the above copyright
8 // notice, this list of conditions and the following disclaimer.
9 // * Redistributions in binary form must reproduce the above
10 // copyright notice, this list of conditions and the following disclaimer
11 // in the documentation and/or other materials provided with the
12 // distribution.
13 // * Neither the name of Google Inc. nor the names of its
14 // contributors may be used to endorse or promote products derived from
15 // this software without specific prior written permission.
16 //
17 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
29 // Protocol messages to be used for mozc client/server communication.
30 //
31 // The Command message contains all the input/output values for
32 // client/server commnication. The messages structure of Command and
33 // its child messages are here:
34
35 syntax = "proto2";
36
37 import "config/config.proto";
38 import "dictionary/user_dictionary_storage.proto";
39 import "protocol/candidates.proto";
40
41 package mozc.commands;
42
43 option java_outer_classname = "ProtoCommands";
44 option java_package = "org.mozc.android.inputmethod.japanese.protobuf";
45
46 // This enum is used by SessionCommand::input_mode with
47 // CHANGE_INPUT_MODE and Output::mode.
48 enum CompositionMode {
49 DIRECT = 0;
50 HIRAGANA = 1;
51 FULL_KATAKANA = 2;
52 HALF_ASCII = 3;
53 FULL_ASCII = 4;
54 HALF_KATAKANA = 5;
55 NUM_OF_COMPOSITIONS = 6;
56 }
57
58 message KeyEvent {
59 enum SpecialKey {
60 NO_SPECIALKEY = 0;
61 DIGIT = 1;
62 // On Windows, SpecialKey::On and SpecialKey::OFF are obsolete. Use
63 // TURN_ON_IME session command should be used instead. See b/10216365.
64 // On other platforms, especially on Mac, please note that
65 // client/client.cc still relies on SpecialKey::On for session playback.
66 // We need to fix b/10250883 first.
67 // TODO(team): Unsupport SpecialKey::On and SpecialKey::OFF.
68 ON = 2;
69 OFF = 3;
70 SPACE = 4;
71 ENTER = 5;
72 LEFT = 6;
73 RIGHT = 7;
74 UP = 8;
75 DOWN = 9;
76 ESCAPE = 10;
77 DEL = 11; // not DELETE because DELETE is reserved in MSVC
78 BACKSPACE = 12;
79 HENKAN = 13;
80 MUHENKAN = 14;
81 KANA = 15; // VK_DBE_HIRAGANA(Win), kVK_JIS_Kana(Mac)
82 // TODO(toshiyuki): It is better to rename this to HIRAGANA
83 // In Windows, we have Katakana and it may confusing.
84 HOME = 16;
85 END = 17;
86 TAB = 18;
87 F1 = 19;
88 F2 = 20;
89 F3 = 21;
90 F4 = 22;
91 F5 = 23;
92 F6 = 24;
93 F7 = 25;
94 F8 = 26;
95 F9 = 27;
96 F10 = 28;
97 F11 = 29;
98 F12 = 30;
99 PAGE_UP = 31;
100 PAGE_DOWN = 32;
101 INSERT = 33;
102 F13 = 34;
103 F14 = 35;
104 F15 = 36;
105 F16 = 37;
106 F17 = 38;
107 F18 = 39;
108 F19 = 40;
109 F20 = 41;
110 F21 = 42;
111 F22 = 43;
112 F23 = 44;
113 F24 = 45;
114 EISU = 46; // alphanumeric VK_DBE_ALPHANUMERIC(Win), kVK_JIS_Eisu(Mac)
115 NUMPAD0 = 47;
116 NUMPAD1 = 48;
117 NUMPAD2 = 49;
118 NUMPAD3 = 50;
119 NUMPAD4 = 51;
120 NUMPAD5 = 52;
121 NUMPAD6 = 53;
122 NUMPAD7 = 54;
123 NUMPAD8 = 55;
124 NUMPAD9 = 56;
125 MULTIPLY = 57; // Numpad [*]
126 ADD = 58; // Numpad [+]
127 SEPARATOR = 59; // Numpad [enter]
128 SUBTRACT = 60; // Numpad [-]
129 DECIMAL = 61; // Numpad [.]
130 DIVIDE = 62; // Numpad [/]
131 EQUALS = 63; // Numpad [=]
132 TEXT_INPUT = 64; // Meta key event representing any text input.
133 HANKAKU = 65;
134 KANJI = 66;
135 KATAKANA = 67; // VK_DBE_KATAKANA(Win)
136 CAPS_LOCK = 68;
137 // Unsupported keys (e.g. PrtSc, Pause) fall back to UNDEFINED_KEY.
138 UNDEFINED_KEY = 69;
139 COMMA = 70; // Numpad [,]
140 CLEAR = 71; // Numpad [5] without NUMLOCK
141 VIRTUAL_LEFT = 72; // Left key on virtual (software) keyboard
142 VIRTUAL_RIGHT = 73; // Right key on virtual (software) keyboard
143 VIRTUAL_ENTER = 74; // Enter key on virtual (software) keyboard
144
145 NUM_SPECIALKEYS = 75;
146 };
147
148 // CTRL, ALT and SHIFT cover both LEFT and RIGHT keys. If the
149 // difference between LEFT and RIGHT is no matter, using CTRL (or ALT, SHIFT)
150 // is preferred.
151 // If LEFT (or RIGHT) CTRL(or ALT, SHIFT) is pressed, LEFT_CTRL is set on
152 // Windows or Mac client, or LEFT_CTRL and CTRL are set on Unix client.
153 // Mozc key translation logic is as follows
154 //
155 // ---- Modifier Keys -----
156 // | |
157 // | B |
158 // ---------+------ -- -----+-------
159 // | | D | | E | |
160 // | A +---- +--------+-------- C |
161 // | | F | |
162 // --Special Keys-- ---Other Keys---
163 //
164 // A:Press only a special key
165 // => Send special key event with no modifier.
166 // B:Press only modifier keys
167 // => Send modifier key event with no key_code.
168 // C:Press an other key
169 // => Send KeyEvent with no modifier.
170 // D:Press a special key with one or more modifier keys
171 // => Send special key event with modifiers.
172 // E:Press an other key with one or more modifier keys
173 // => If combined key is printable, replace keycodes. Otherwise, just send
174 // with modifier keys. Note that, unless the whole combined key is
175 // printable, keycodes are not replaced even if a subset of combined key is
176 // printable.
177 // F:Otherwise
178 // => Send nothing.
179 //
180 // Following example shows expected behaviours.
181 // E.g. )
182 // case | Pressed Key | translated key event
183 // ----------------------------------------------------
184 // A | SP | special_key = 4
185 // A | F1 | special_key = 19
186 // B | CTRL | modifier_key = {CTRL}
187 // B | SHIFT | modifier_key = {SHIFT}
188 // B | CTRL+SHIFT | modifier_key = {CTRL,SHIFT}
189 // C | 'a' | key_code = \x61 = 'a'
190 // D | CTRL+BS | special_key = 12, modifier_key = {CTRL}
191 // D | CTRL+SHIFT+BS | special_key = 12, modifier_key = {CTRL,SHIFT}
192 // E | SHIFT+'a' | key_code = \x41 = 'A'
193 // E | CTRL+'a' | key_code = \x61, modifier_key = {CTRL}
194 // E | CTRL+ALT+'a' | key_code = \x61, modifier_key = {CTRL,ALT}
195 // E | CTRL+SHIFT+'a'| key_code = \x61, modifier_key = {CTRL,SHIFT}
196 // F | CTRL+BS+SP | send nothing
197 //
198 // In addition, we treat CAPS lock independently besides alphabet keys,
199 // though it is a member of modifier keys. Following example shows currently
200 // expected behaviours with Caps lock set.
201 //
202 // E.g. ) While CAPS is set on.
203 // Pressed Key | translated key event
204 // ----------------------------------------------------
205 // 'a' | key_code = \x41 = 'A', modifier_key = {CAPS}
206 // SHIFT+'a' | key_code = \x61 = 'a', modifier_key = {CAPS}
207 // CTRL+'a' | key_code = \x41, modifier_key = {CTRL,CAPS}
208 // CTRL+ALT+'a' | key_code = \x41, modifier_key = {CTRL,ALT,CAPS}
209 // CTRL+SHIFT+'a'| key_code = \x41, modifier_key = {CTRL,SHIFT,CAPS}
210 //
211 // However, only in short-cut judgement, we should convert capital characters
212 // into lower cases.
213 // TODO(peria): Specify exceptions with CAPS, and unify with the above table.
214
215 enum ModifierKey {
216 CTRL = 1;
217 ALT = 2;
218 SHIFT = 4;
219 KEY_DOWN = 8;
220 KEY_UP = 16;
221 LEFT_CTRL = 32;
222 LEFT_ALT = 64;
223 LEFT_SHIFT = 128;
224 RIGHT_CTRL = 256;
225 RIGHT_ALT = 512;
226 RIGHT_SHIFT = 1024;
227 CAPS = 2048;
228 };
229
230 // Probable key event, mainly for touch screen.
231 // User's input has ambiguity (e.g. the touch position is merginal)
232 // so this message expresses the probable event.
233 message ProbableKeyEvent {
234 // message ID is the same as Input message.
235 optional uint32 key_code = 1;
236 optional SpecialKey special_key = 3; // Unprintable key listed above.
237 repeated ModifierKey modifier_keys = 4; // ModifierKeys
238 // Sum of probabilities must be lesser or equal than 1.
239 // 0<= probability <= 1
240 optional double probability = 10;
241 };
242
243 // Printable key in UCS4. If key_code is empty, key_string is used
244 // as a raw input.
245 optional uint32 key_code = 1;
246 optional uint32 modifiers = 2; // Going to be obsolete.
247 optional SpecialKey special_key = 3; // Unprintable key listed above.
248 repeated ModifierKey modifier_keys = 4; // ModifierKeys
249
250 // String used for preedit. Kana characters and strings typed from
251 // a software keyboard are supposed to be stored here. If key_code
252 // is also set, key_code is treated as the raw input and key_string is
253 // treated as the composition input. For example, to set Kana value,
254 // when key_string is "ち", key_code should be 'a' (97). If key_code
255 // is empty, key_string is also treated as the raw input.
256 optional string key_string = 5;
257
258 enum InputStyle {
259 // Follow the current input mode (default).
260 FOLLOW_MODE = 0;
261 // Do not transliterate key_string and use it as-is.
262 AS_IS = 1;
263 // Immediately output key_string on the precomposition mode.
264 // Same with AS_IS on the preedit mode.
265 DIRECT_INPUT = 2;
266 };
267 optional InputStyle input_style = 6 [default = FOLLOW_MODE];
268
269 // Input mode
270 // For histrical reasons, this field expects a temporary conversion
271 // mode rather than comeback input mode.
272 optional CompositionMode mode = 7;
273
274 // Probable key events
275 // Even if you can fill this field,
276 // don't omit Input.key_code and so on
277 // because preedit string is composed based on them.
278 repeated ProbableKeyEvent probable_key_event = 8;
279
280 // IME on/off mode
281 // You can use this field to change the IME on/off mode indirectly without
282 // sending SpecialKey:ON or SpecialKey:OFF events.
283 // If the internal ImeContext::State is DIRECT and this field is true, the
284 // converter will change the state to PRECONPOSITION and then handles this key
285 // event.
286 // If the internal ImeContext::State is not DIRECT and this field is false,
287 // the converter will change the state to DIRECT and then handles this key
288 // event.
289 // Implementation note: We need both |mode| and |activated| to support
290 // indirect IME off, where |mode| should contain the next mode. If this field
291 // is not set, the server will act as if indirect on/off was not supported.
292 optional bool activated = 9;
293 };
294
295 message GenericStorageEntry {
296 enum StorageType {
297 SYMBOL_HISTORY = 0;
298 EMOTICON_HISTORY = 1;
299 EMOJI_HISTORY=2;
300 }
301 optional StorageType type = 1;
302 optional string key = 2;
303 // The type must be bytes instead of string
304 // because value might have U+0000 character as a terminator.
305 // In this case, characters after the terminator are undefined.
306 // Such byte stream cannot be treaed by Java's String class, which
307 // is used for PB's string type.
308 // Instead, PB's bytes type is converted into ByteString in Java,
309 // which can treat C laguage style string described above.
310 repeated bytes value = 3;
311 }
312
313 message SessionCommand {
314 enum CommandType {
315 // Revert the session, this is usually similar to type ESC several times.
316 REVERT = 1;
317 // Commit the session, this is usually similar to type Enter.
318 // SUBMIT session command is accepted in any status.
319 // Pre-condition:
320 // - Any states of IME are acceptable.
321 // Post-condition:
322 // - Preedit text becomes empty.
323 SUBMIT = 2;
324 // Select the specified candidate word by id. This command is
325 // usually used with mouse clicking.
326 SELECT_CANDIDATE = 3;
327
328 // Set the focus to the candidate by id. This is usually used
329 // with mouse dragging. The difference from SELECT_CANDIDATE is
330 // that HIGHLIGHT_CANDIDATE does not close the candidate window
331 // while SELECT_CANDIDATE closes the candidate window.
332 HIGHLIGHT_CANDIDATE = 4;
333
334 // Specify the input mode. This command should be used with
335 // composition_mode.
336 SWITCH_INPUT_MODE = 5;
337
338 // Return the current status such as composition mode, preedit method, etc.
339 GET_STATUS = 6;
340
341 // This command is typically used for mobile IME's partial conversion,
342 // but currently it is on the way. This description is for current spec.
343 //
344 // This command requires that candidates exist.
345 //
346 // If there is a focused candidate (Conversion or Prediction state),
347 // the candidate matched with the given id in the first segment is
348 // submitted, even though the selected segment is not the first segment
349 // (Important thing is whether focused candidate exists
350 // or not. Focused index itself is ignored).
351 // This behavior should be updated because current cursor position and
352 // position of focused segment affects nothing.
353 // We should fix this non-intuitive behavior. Intuitive behavior might be
354 // submitting segments from first one to focused one (inclusive).
355 //
356 // If no focused candidate (Suggestion, including ZeroQuery suggestion),
357 // first (and only) segment's candiadte of which id is equal to id field of
358 // Input message is submitted.
359 // This behavior should be fixed because current cursor position affects
360 // nothing. In future, the characters after the cursor should be kept
361 // as preedit.
362 //
363 // This command's pre- and post- conditions are differenct from
364 // SUBMIT command's. Following conditions will be kept after updating
365 // the behavior.
366 // Pre-condition:
367 // - There should be candidate.
368 // Post-condition:
369 // - No guarantee on preedit text.
370 // TODO(yamaguchi): Update corresponding implementation please.
371 SUBMIT_CANDIDATE = 7;
372
373 // Perform reverse conversion.
374 CONVERT_REVERSE = 8;
375
376 // Perform Undo.
377 UNDO = 9;
378
379 // Reset convert history and revert current composition.
380 // This is usually used by moving cursor with mouse clicking.
381 RESET_CONTEXT = 10;
382
383 // Change cursor position in preedit.
384 MOVE_CURSOR = 11;
385
386 // Specify the input field type.
387 SWITCH_INPUT_FIELD_TYPE = 12;
388
389 // Client side event information for collecting usage statistics
390 USAGE_STATS_EVENT = 13;
391
392 // This command is used in only Android.
393 // Works UNDO or rewind HIRAGANA characters based on the state.
394 UNDO_OR_REWIND = 14;
395
396 // Expand suggestion candidates.
397 // Usual suggestion algorithm is not "rich" but "fast" because suggestion
398 // is executed every key event (On the other hand predicition is "rich"
399 // because prediction is executed only when a user types TAB key).
400 // This command expands suggestion candidate but IME state is
401 // kept as is (Note : PredictAndConvert key command does almost the same
402 // thing but it changes IME state to prediction).
403 EXPAND_SUGGESTION = 15;
404
405 // The client can send the current caret position whenever the caret
406 // position is changed. The caret position is used for suggest window
407 // position calculation. This is an optional message. If client can show
408 // suggest window on the correct position, this message can be ignored.
409 SEND_CARET_LOCATION = 16;
410
411 // Obsolete command. Don't simply remove this command for NUM_OF_COMMANDS.
412 // TODO(team): Replace this command by useful one.
413 OBSOLETE_SEND_LANGUAGE_BAR_COMMAND = 17;
414
415 // When the server is hadling asynchronous request, the server returns the
416 // message with callback request which session_command is GET_ASYNC_RESULT.
417 // After the delay_millisec, the client sends this command to the server.
418 GET_ASYNC_RESULT = 18;
419
420 // Commit the raw text of the composed string.
421 COMMIT_RAW_TEXT = 19;
422
423 // Call ConvertPrevPage session command to show the previous page of
424 // candidates.
425 CONVERT_PREV_PAGE = 20;
426
427 // Call ConvertNextPage session command to show the next page of
428 // candidates.
429 CONVERT_NEXT_PAGE = 21;
430
431 // Make sure IME is turned on. Optionally you can also provide new input
432 // mode in |composition_mode| (but you must not set DIRECT to it).
433 // |composition_mode| is honored even when IME is already turned on.
434 TURN_ON_IME = 22;
435
436 // Make sure IME is turned off. Optionally you can also provide new input
437 // mode in |composition_mode| (but you must not set DIRECT to it). If IME
438 // |composition_mode| is honored even when IME is already turned off.
439 TURN_OFF_IME = 23;
440
441 // Number of commands.
442 // When new command is added, the command should use below number
443 // and NUM_OF_COMMANDS should be incremented.
444 NUM_OF_COMMANDS = 24;
445 };
446 required CommandType type = 1;
447
448 // Unique number specifying a candidate word.
449 optional int32 id = 2;
450
451 // This is used with SWITCH_INPUT_MODE, TURN_ON_IME and TURN_OFF_IME.
452 optional CompositionMode composition_mode = 3;
453
454 // Text argument. This is used by CONVERT_REVERSE at this moment.
455 optional string text = 4;
456
457 // New cursor position in preedit. Used with MOVE_CURSOR.
458 optional uint32 cursor_position = 5;
459
460 // Client side event for collecting usage statistics
461 enum UsageStatsEvent {
462 INFOLIST_WINDOW_SHOW = 1;
463 INFOLIST_WINDOW_HIDE = 2;
464 HANDWRITING_OPEN_EVENT = 3;
465 HANDWRITING_COMMIT_EVENT = 4;
466 CHARACTER_PALETTE_OPEN_EVENT = 5;
467 CHARACTER_PALETTE_COMMIT_EVENT = 6;
468 SOFTWARE_KEYBOARD_LAYOUT_LANDSCAPE = 7;
469 SOFTWARE_KEYBOARD_LAYOUT_PORTRAIT = 8;
470 SUBMITTED_CANDIDATE_ROW_0 = 9;
471 SUBMITTED_CANDIDATE_ROW_1 = 10;
472 SUBMITTED_CANDIDATE_ROW_2 = 11;
473 SUBMITTED_CANDIDATE_ROW_3 = 12;
474 SUBMITTED_CANDIDATE_ROW_4 = 13;
475 SUBMITTED_CANDIDATE_ROW_5 = 14;
476 SUBMITTED_CANDIDATE_ROW_6 = 15;
477 SUBMITTED_CANDIDATE_ROW_7 = 16;
478 SUBMITTED_CANDIDATE_ROW_8 = 17;
479 SUBMITTED_CANDIDATE_ROW_9 = 18;
480 SUBMITTED_CANDIDATE_ROW_GE10 = 19;
481 KEYBOARD_FOLD_EVENT = 20;
482 KEYBOARD_EXPAND_EVENT = 21;
483 MUSHROOM_SELECTION_DIALOG_OPEN_EVENT = 22;
484 }
485 optional UsageStatsEvent usage_stats_event = 7;
486 optional int32 usage_stats_event_int_value = 9;
487
488 // Specify the current caret location, this is used for suggest window
489 // position calculation. Used with SEND_CARET_LOCATION.
490 optional Rectangle caret_rectangle = 8;
491
492 // Unique number specifying an asynchronous request.
493 optional int32 asynchronous_request_id = 10;
494 };
495
496 message Context {
497 // Former part of surrounding text.
498 optional string preceding_text = 1;
499
500 // Latter part of surrounding text.
501 optional string following_text = 2;
502
503 // If this is true, suggestion feature is disabled regardless the
504 // congiguration. If this is false, suggestion feature is followed
505 // by the user's configuration. If you want to omit interim
506 // suggestions during the key typing, you might want to use
507 // request_suggestion.
508 // TODO(komatsu): Delete this field and use experimental_features.
509 optional bool suppress_suggestion = 3 [default = false];
510
511 // Input field type.
512 // The types are based on the input types defined in HTML5.
513 // http://dev.w3.org/html5/spec/Overview.html#attr-input-type
514 // Other types are to be added later.
515 enum InputFieldType {
516 // No restrictions nor special functions. The IME operates as usual.
517 NORMAL = 1;
518
519 // Password field. Text is hidden after input.
520 // For Android,
521 // In order to make the last character visible to the user,
522 // the IME must not hold more than 2 characters in preedit.
523 PASSWORD = 2;
524
525 // Telephone number
526 TEL = 3;
527
528 // Number
529 NUMBER = 4;
530 };
531 // Type of the input field being focused.
532 optional InputFieldType input_field_type = 4;
533
534 // An unique revision ID to specify one specific typing session. A client can
535 // use arbitrary value for this field. The converter is expected to clear its
536 // internal history segments whenever this value is changed. A client should
537 // use the same revision ID whenever the converter should keep it internal
538 // history segments. In order to avoid unexpected history learnings, a client
539 // should update the revision whenever the input focus is changed.
540 optional int32 revision = 5 [default = 0];
541
542 // Repeated fields to be used for experimental features.
543 repeated string experimental_features = 100;
544 };
545
546 // Clients' capability.
547 // Users cannot modify this.
548 // The server has to obey this capability.
549 message Capability {
550 // Bit fields to notify what the client can do.
551 enum TextDeletionCapabilityType {
552 NO_TEXT_DELETION_CAPABILITY = 0;
553
554 // Can delete preceding text which is adjacent to preedit.
555 DELETE_PRECEDING_TEXT = 1;
556 };
557 optional TextDeletionCapabilityType text_deletion = 1
558 [default = NO_TEXT_DELETION_CAPABILITY];
559 };
560
561 // Clients' request to the server.
562 // Users cannot modify this.
563 // In the future each request may be able to be overwirtten by Config.
564 // The server does not have to obey this request.
565 message Request {
566 // Enable zero query suggestion.
567 optional bool zero_query_suggestion = 1
568 [default = false] ; // true for android
569
570 // Conversion's candidate includes suggestion, prediction and conversion.
571 optional bool mixed_conversion = 2
572 [default = false] ; // true for android
573
574 // Combine all segments like mobile IME.
575 optional bool combine_all_segments = 3
576 [default = false] ; // true for android
577
578 enum SpecialRomanjiTable {
579 // Do not use special table.
580 // Romanji table is selected based on Config.
581 DEFAULT_TABLE = 0;
582
583 // Use special table for 12keys (to hiragana).
584 TWELVE_KEYS_TO_HIRAGANA = 10;
585
586 // Use special table for 12keys (to half-width ascii).
587 TWELVE_KEYS_TO_HALFWIDTHASCII = 11;
588
589 // Use special table for flick (to hiragana).
590 FLICK_TO_HIRAGANA = 13;
591
592 // Use special table for flick (to half-width ascii).
593 FLICK_TO_HALFWIDTHASCII = 14;
594
595 // Use special table for both toggle and flick (to hiragana).
596 TOGGLE_FLICK_TO_HIRAGANA = 16;
597
598 // Use special table for both toggle and flick (to half-width ascii).
599 TOGGLE_FLICK_TO_HALFWIDTHASCII = 17;
600
601 // Use special table for Qwerty (for Mobile) (to hiragana).
602 QWERTY_MOBILE_TO_HIRAGANA = 20;
603
604 // Use special table for Qwerty (for Mobile) (to half-width ascii).
605 QWERTY_MOBILE_TO_HALFWIDTHASCII = 22;
606
607 // Use special table for Godan (to hiragana).
608 GODAN_TO_HIRAGANA = 30;
609
610 // Use special table for Godan (to half-width ascii).
611 GODAN_TO_HALFWIDTHASCII = 31;
612
613 // Use special table for Notouch (to hiragana).
614 NOTOUCH_TO_HIRAGANA = 40;
615
616 // Use special table for Notouch (to half-width ascii).
617 NOTOUCH_TO_HALFWIDTHASCII = 41;
618
619 // Obsolete items.
620 OBSOLETE_TWELVE_KEYS_TO_NUMBER = 12;
621 OBSOLETE_FLICK_TO_NUMBER = 15;
622 OBSOLETE_GODAN_TO_NUMBER = 32;
623 OBSOLETE_QWERTY_MOBILE_TO_HIRAGANA_NUMBER = 21;
624 OBSOLETE_TOGGLE_FLICK_TO_NUMBER = 18;
625 };
626
627 // Use special Romanji table.
628 optional SpecialRomanjiTable special_romanji_table = 4
629 [default = DEFAULT_TABLE] ; // TWELVE_KEYS_TO_HIRAGANA for android.
630
631
632 enum SpaceOnAlphanumeric {
633 // The first input is treated as a space, double input is treated
634 // as a conversion. If a character is input after the first
635 // input, the composition will remain. For example, "ab<space>dc"
636 // becomes "ab dc" as a single composition.
637 SPACE_OR_CONVERT_KEEPING_COMPOSITION = 0;
638
639 // The first input is treated as a space, double input is treated
640 // as a conversion. If a character is input after the first
641 // input, the previous composition will be committed. For
642 // example, "ab<space>dc" results "ab " as a committed string and
643 // "dc" as a composition.
644 SPACE_OR_CONVERT_COMMITING_COMPOSITION = 1;
645
646 // Commit the composition and a space.
647 COMMIT = 2;
648 };
649
650 optional SpaceOnAlphanumeric space_on_alphanumeric = 6
651 [default = SPACE_OR_CONVERT_KEEPING_COMPOSITION];
652
653 // Keyboard name for touch devices.
654 // For example, "TWELVE_KEY_TOGGLE_KANA", "QWERTY_KANA_NUMBER".
655 // It is used to analyze touch event usage stats.
656 optional string keyboard_name = 7;
657
658 // Enables Composer's input mode auto updating by using surrounding text.
659 // For example, when a composition string is "ad", a carret is at the end,
660 // and a user selects HIRAGANA mode, if the user moves the carret to between
661 // "a" and "d" the mode will be automatically switch to ASCII (temporarily).
662 // See details in the Composer::UpdateInputMode.
663 optional bool update_input_mode_from_surrounding_text = 8
664 [default = true];
665
666 // Enables Kana-modifier-insensitive conversion as follows:
667 // 1) Voiced/Semi-voiced kana will be hit by non-modified kana.
668 // e.g.) "ば" and "ぱ" will be hit by key "は".
669 // 2) Geminate consonant "っ" will be hit by non-modified kana "つ".
670 // 3) Palatalized kana will be hit by non-modified kana.
671 // e.g.) "ゃ" will be hit by key "や".
672 // Here is an example of the search: "学校" ("がっこう") will be hit
673 // by "かつこう".
674 optional bool kana_modifier_insensitive_conversion = 9 [default = false];
675
676 // Enables Auto partial suggestion.
677 // For Auto partial suggestion, we can see first segment only candidates
678 // adding to normal realtime conversion suggestion results.
679 // If we commit that candidate, we will show suggestions for remaining part
680 // of key.
681 //
682 // Note: This feature can be enabled only for mobile due to UX design.
683 optional bool auto_partial_suggestion = 10 [default = false];
684
685 // Nowadays, four kinds of emoji characters are used in Japan.
686 // - Unicode: Unicode based emoji (since Unicode 6.0).
687 // - Docomo: Docomo's carrier emoji.
688 // - Softbank: Softbank's carrier emoji.
689 // - Kddi: Kddi's carrier emoji.
690 // Note that especially latter three kinds are used on Mobile phones.
691 // So, it is necessary to control what kinds of emoji can be used or not
692 // based on client's (or connected application's) information.
693 // For example, on Android;
694 // - Unicode emoji characters are available only on Android 4.1 or later
695 // only.
696 // - JP mobile carriers' emoji characters depend on the devices. Also,
697 // we need to check the text field's attribute for them.
698 // The following bit set tells the emoji availability to EmojiRewriter.
699 enum EmojiCarrierType {
700 UNICODE_EMOJI = 1;
701 DOCOMO_EMOJI = 2;
702 SOFTBANK_EMOJI = 4;
703 KDDI_EMOJI = 8;
704 }
705
706 // By default, UNICODE emoji is available.
707 optional int32 available_emoji_carrier = 11 [default = 1];
708
709 // For emoji rewriter, it is necessary to control when the rewriter runs
710 // based on the clients. The following bit set is sync'ed to
711 // RewriterInterface::CapabilityType (see rewriter_interface.h, too),
712 // so that clients can fill the value.
713 enum RewriterCapability {
714 NOT_AVAILABLE = 0;
715 CONVERSION = 1;
716 PREDICTION = 2;
717 SUGGESTION = 4;
718 ALL = 7; // CONVERSION | PREDICTION | SUGGESTION.
719 }
720
721 // By default, Emoji rewriter works on conversion mode only.
722 optional int32 emoji_rewriter_capability = 12 [default = 1];
723
724 // Controls the behavior when a user types the left/right key at the edge
725 // of the preedit string (in more precise, the left key at the beginning
726 // of the preedit string, or the right key at the end).
727 enum CrossingEdgeBehavior {
728 // This is the default behavior. The cursor movement at the edge
729 // will make nothing, i.e., keeping the current cursor position (at the
730 // edge), consume the key event.
731 DO_NOTHING = 0;
732
733 // This is the behavior, especially designed for alphabet keyboards on
734 // mobile devices. Assuming the following text:
735 // XXXXabcde|YYYYY
736 // where XXXX is preceding text, abcde is composing text, YYYYY is
737 // following text and '|' is the caret, when a user sends "RIGHT"
738 // cursor key, we'd like to commit the abcde and move the caret to right.
739 // So the user will get:
740 // XXXXabcdeY|YYYY
741 // Here, what we need is commiting the "abcde" with the appropriate
742 // caret position. (Note that we need to handle the left cursor key, too).
743 // Also, we should *NOT* consume the key, so that the key event will be
744 // handled appropriately by the target application.
745 COMMIT_WITHOUT_CONSUMING = 1;
746 }
747 optional CrossingEdgeBehavior crossing_edge_behavior = 13
748 [default = DO_NOTHING];
749
750 // Controls the behavior of language aware input. Language aware input
751 // guesses the actual language regardless the input mode. For example,
752 // if user type "てst" it will be treated as "test".
753 enum LanguageAwareInputBehavior {
754 // Performs the default behavior considering the platform and channel.
755 DEFAULT_LANGUAGE_AWARE_BEHAVIOR = 0;
756
757 // Does not perform this functionarity.
758 NO_LANGUAGE_AWARE_INPUT = 1;
759
760 // Adds a language aware candidate to the suggestion.
761 LANGUAGE_AWARE_SUGGESTION = 2;
762 }
763 optional LanguageAwareInputBehavior language_aware_input = 14
764 [default = DEFAULT_LANGUAGE_AWARE_BEHAVIOR];
765
766 // Page size of the candidate list.
767 optional int32 candidate_page_size = 15 [default = 9];
768 }
769
770 // Note there is another ApplicationInfo inside RendererCommand.
771 // Since Input is not using nested message, define ApplicationInfo here.
772 message ApplicationInfo {
773 optional uint32 process_id = 1;
774 optional uint32 thread_id = 2;
775 // The time difference between local time and UTC time in seconds.
776 // This field is not supported except for NaCl.
777 // We use this field in NaCl Mozc because we can't know the local timezone in
778 // NaCl environment.
779 optional int32 timezone_offset = 3;
780 };
781
782 message Input {
783 enum CommandType {
784 NONE = 0;
785 CREATE_SESSION = 1;
786 DELETE_SESSION = 2;
787 SEND_KEY = 3;
788
789 // Check only if the key event will be consumed. This command is
790 // for TSF on Windows. You do not need to use this command, if it
791 // is not necessary.
792 TEST_SEND_KEY = 4;
793
794 // Evaluate the command specified by SessionCommand. The output
795 // format should be the same with an output of a SEND_KEY command.
796 SEND_COMMAND = 5;
797
798 // Config accessors.
799 // There are three configurations.
800 // Stored config, Imposed config, One-shot config.
801 // Stored config : Set by SET_CONFIG command.
802 // Its lifetime is permanent (stored into a storage).
803 // GET_CONFIG returns stored config.
804 // Imposed config : Set by SET_IMPOSED_CONFIG. Its lifetime is the
805 // same as the process (*not* stored into a storage as opposed to Stored
806 // config).
807 // Imposed config is prioritized over Stored config.
808 // Only the values explicitly set are effective and override ones in Stored
809 // config. In typical usage, most fields are not set.
810 // GET_CONFIG's result is *not* affected by imposed config
811 // (stored config returns).
812 // One-shot config : Set by each key events.
813 // It is effective while the key event is processed.
814 // This is prioritized over Imposed config.
815 // Like as Imposed config, some fields can be omitted.
816 // TODO(matsuzakit): Rename (GET|SET)_CONFIG to (GET|SET)_STORED_CONFIG
817 GET_CONFIG = 6;
818 SET_CONFIG = 7;
819 SET_IMPOSED_CONFIG = 22;
820
821 // Set client's request
822 SET_REQUEST = 17;
823
824 // sync dictionary/history data to local file
825 SYNC_DATA = 8;
826
827 // shutdowon server safely
828 SHUTDOWN = 9;
829
830 // reload mutable data (like config, user-dic, history)
831 RELOAD = 10;
832
833 // clear user history data
834 CLEAR_USER_HISTORY = 11;
835
836 // clear user prediction data
837 CLEAR_USER_PREDICTION = 12;
838
839 // clear unused prediction
840 CLEAR_UNUSED_USER_PREDICTION = 16;
841
842 // clean up sessions
843 // shutdwon if session is empty and
844 // mozc_server is launched with timeout mode
845 CLEANUP = 13;
846
847 // no operation
848 // can be used for pinging the server
849 NO_OPERATION = 14;
850
851 // Sync feature is deprecated since 1.13 dev.
852 // TODO(mozc-team): Remove following variables.
853 OBSOLETE_START_CLOUD_SYNC = 18;
854 OBSOLETE_GET_CLOUD_SYNC_STATUS = 23;
855 OBSOLETE_ADD_AUTH_CODE = 24;
856
857 INSERT_TO_STORAGE = 20;
858 READ_ALL_FROM_STORAGE = 21;
859 CLEAR_STORAGE = 25;
860
861 // Send a command for user dictionary session.
862 SEND_USER_DICTIONARY_COMMAND = 26;
863
864 // Number of commands.
865 // When new command is added, the command should use below number
866 // and NUM_OF_COMMANDS should be incremented.
867 //
868 // Note: This enum lack the value for 15 and 19 and it may cause a crash.
869 // Please reuse these value if you can.
870 // 15 have never been used before, and 19 was used to clear synced
871 // data on dev channel.
872 NUM_OF_COMMANDS = 27;
873 };
874 required CommandType type = 1;
875
876 // Session ID created by CREATE_SESSION.
877 optional uint64 id = 2;
878
879 // Key combinations used for SEND_KEY or TEST_SEND_KEY.
880 optional KeyEvent key = 3;
881
882 // Command sent to the session layer used with SEND_COMMAND.
883 optional SessionCommand command = 4;
884
885 // Input config
886 optional mozc.config.Config config = 5;
887
888 // Context data
889 optional Context context = 6;
890
891 // Client capability
892 optional Capability capability = 7;
893
894 // Application information, like process id.
895 // Server may be able to change the behavior by seeing the
896 // the program name.
897 optional ApplicationInfo application_info = 8;
898
899 // Client request
900 optional Request request = 9;
901
902 // If the command is INSERT_TO_STORAGE, all the fields must be filled.
903 // If READ_ALL_FROM_STORAGE, key and value fields are ignored.
904 optional GenericStorageEntry storage_entry = 10;
905
906 enum TouchAction {
907 TOUCH_DOWN = 1;
908 TOUCH_MOVE = 2;
909 TOUCH_UP = 3;
910 };
911 message TouchPosition {
912 optional TouchAction action = 1;
913 // x, y potision: keyboad left-top is (0, 0), right-bottom is (1, 1).
914 optional float x = 2;
915 optional float y = 3;
916 // timestamp (in ms) is set to zero when the touch event starts.
917 optional int64 timestamp = 4;
918 }
919 // TouchEvent contains source_id and stroke.
920 // Touch_events contain all key touch event.
921 // Statistical information are collected for each source_id
922 // by SessionUsageObserver.
923 message TouchEvent {
924 // source_id specifies the user action such as "X button pressed".
925 // It must be unique within the same keyboard_name,
926 // which is set in Request message.
927 optional uint32 source_id = 1;
928 repeated TouchPosition stroke = 2;
929 }
930 repeated TouchEvent touch_events = 12;
931
932 optional mozc.user_dictionary.UserDictionaryCommand user_dictionary_command
933 = 13;
934
935 // A flag to control if the server should return suggest-results or not.
936 // If this is set to false, regardless of other configurations,
937 // the server won't return suggestion results.
938 // This is set to true by default.
939 // Note that even if this flag is set to false, when a suggestion is shown
940 // in the previous phase, it is possible from the client to submit it.
941 // This works only for suggestions for the key insersion, but not for
942 // others commands, such as predictions or conversions.
943 // This flag is used for the performance improvement in terms of the
944 // latency. If you want to suppress the suggestions for the UX improment,
945 // you may want to use suppress_suggestion in the Context message.
946 optional bool request_suggestion = 14 [default = true];
947 };
948
949
950 // Result contains data to be submitted to the host application by the
951 // ime client.
952 message Result {
953 enum ResultType {
954 NONE = 0;
955 STRING = 1;
956 };
957 required ResultType type = 1;
958 // The result of conversion.
959 required string value = 2;
960
961 // Source of the value. It is almost always the reading of the value.
962 optional string key = 3;
963
964 // The caret position after the result submission.
965 // "0" means the end of the result, and a positive value means moving forward
966 // and a negative value backward.
967 // e.g.) "-s", where s is the length of value, means the caret position
968 // after the committing should be the beginning of the committed value.
969 optional int32 cursor_offset = 4 [default = 0];
970 };
971
972
973 // Preedit represents a composition data, which is rendered on the
974 // host application by the ime client. On Japanese IME, the both
975 // Preedit and Conversion statuses are represented by this message.
976 message Preedit {
977 required uint32 cursor = 1;
978 // The string data of Preedit is separated into Segment messages
979 // presenting the ime server's status. On Preedit status of
980 // Japanese IME, there are up to three segments; left side chars of
981 // cursor, forcused char, right side chars of cursor. On Conversion
982 // status of Japanese IME, the messages literally represent the
983 // segments of the conversion.
984 repeated group Segment = 2 {
985 enum Annotation {
986 NONE = 0;
987 UNDERLINE = 1;
988 HIGHLIGHT = 2;
989 };
990 required Annotation annotation = 3;
991 required string value = 4;
992
993 // The length of value in characters. This is NOT a number in
994 // bytes or logical character units. So, the length of "abc" and
995 // "あいう" should be 3, "ヴ" should be 1 and "ヴ" and "う゛"
996 // should be 2.
997 required uint32 value_length = 5;
998
999 // Source of the value. It is almost always the reading of the value.
1000 optional string key = 6;
1001 };
1002
1003 // The position of the first segment whose annotation is 'HIGHLIGHT'. Not set
1004 // if there are no such segments.
1005 optional uint32 highlighted_position = 3;
1006 };
1007
1008
1009 message Status {
1010 // Whether IME is ON or OFF
1011 optional bool activated = 1;
1012
1013 // Visible composition mode when IME is activated. This mode may come from a
1014 // temporary composition mode. See |comeback_mode|.
1015 // TODO(yukawa): Rename this field to "visible_mode".
1016 optional CompositionMode mode = 2;
1017
1018 // True composition mode that is suitable for system global and permanent
1019 // composition mode. When a temporary composition mode exists,
1020 // |comeback_mode| can be different from |mode|.
1021 // TODO(yukawa): Use more appropriate name.
1022 optional CompositionMode comeback_mode = 3;
1023 };
1024
1025 // This messsage contains which characters are to be deleted by client.
1026 // E.g. if current composition and surrounding text are
1027 // "この感じは漢字は"
1028 // ^^^^^^
1029 // and we send DeletionRange with offset == -3 and length == 3, then they will
1030 // be rendered like:
1031 // "この漢字は"
1032 // ^^^^^^
1033 message DeletionRange {
1034 // Offset of start of range.
1035 optional int32 offset = 1;
1036
1037 // Length of the range.
1038 optional int32 length = 2;
1039 };
1040
1041 message Output {
1042 optional uint64 id = 1;
1043
1044 // This variable is going to be obsolete.
1045 optional CompositionMode mode = 2;
1046
1047 optional bool consumed = 3;
1048 optional Result result = 4;
1049 optional Preedit preedit = 5;
1050 optional Candidates candidates = 6;
1051 optional KeyEvent key = 7;
1052
1053 // when URL is non empty, UI can open the page with a browser,
1054 // after finishing the all rendering part.
1055 // We are using this feature for bug-report system.
1056 optional string url = 8;
1057
1058 // Output config
1059 optional mozc.config.Config config = 9;
1060
1061 // PreeditMethod: this is the default input mode of the session.
1062 // If the user's config is "kana-input", it returns KANA. Only
1063 // CreateSession response will have this field.
1064 enum PreeditMethod {
1065 ASCII = 0;
1066 KANA = 1;
1067 };
1068 optional PreeditMethod preedit_method = 10 [default = ASCII];
1069
1070 // ErrorCode:
1071 // if SessionHandler::EvalCommand() returns false,
1072 // return output with error_code = SESSION_FAILURE;
1073 enum ErrorCode {
1074 SESSION_SUCCESS = 0;
1075 SESSION_FAILURE = 1;
1076 };
1077 optional ErrorCode error_code = 11 [ default = SESSION_SUCCESS ];
1078
1079 // The current IME status.
1080 optional Status status = 13;
1081
1082 // All flatten candidate words stored in 1D array. This value is
1083 // filled only when the content is changed.
1084 optional CandidateList all_candidate_words = 14;
1085
1086 // Range of characters to be deleted by client.
1087 optional DeletionRange deletion_range = 16;
1088
1089 // if launch_tool_mode is set, MozcTool is supposed to be launched
1090 // by client.
1091 enum ToolMode {
1092 NO_TOOL = 0; // no need to launch tool
1093 CONFIG_DIALOG = 1;
1094 DICTIONARY_TOOL = 2;
1095 WORD_REGISTER_DIALOG = 3;
1096 };
1097 optional ToolMode launch_tool_mode = 17 [ default = NO_TOOL ];
1098
1099 // Callback request to the client.
1100 message Callback {
1101 // Callback command to be sent from the client to the server. The
1102 // optional values such as id and composition_mode can be modified
1103 // or added by the client.
1104 optional SessionCommand session_command = 1;
1105
1106 // Callback command should be sent after this delay.
1107 optional uint32 delay_millisec = 2;
1108 };
1109 optional Callback callback = 18;
1110
1111 // Used when the command is READ_ALL_FROM_STORAGE.
1112 optional GenericStorageEntry storage_entry = 19;
1113
1114 optional mozc.user_dictionary.UserDictionaryCommandStatus
1115 user_dictionary_command_status = 21;
1116 };
1117
1118 message Command {
1119 required Input input = 1;
1120 required Output output = 2;
1121 };
1122
1123 message CommandList {
1124 // This message is used for unittest.
1125 repeated Command commands = 1;
1126 };
0 # Copyright 2010-2015, Google Inc.
1 # All rights reserved.
2 #
3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions are
5 # met:
6 #
7 # * Redistributions of source code must retain the above copyright
8 # notice, this list of conditions and the following disclaimer.
9 # * Redistributions in binary form must reproduce the above
10 # copyright notice, this list of conditions and the following disclaimer
11 # in the documentation and/or other materials provided with the
12 # distribution.
13 # * Neither the name of Google Inc. nor the names of its
14 # contributors may be used to endorse or promote products derived from
15 # this software without specific prior written permission.
16 #
17 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
29 # session_base.gyp defines targets for lower layers to link to the session
30 # modules, so modules in lower layers do not depend on ones in higher layers,
31 # avoiding circular dependencies.
32 {
33 'variables': {
34 'relative_dir': 'protocol',
35 'gen_out_dir': '<(SHARED_INTERMEDIATE_DIR)/<(relative_dir)',
36 },
37 'targets': [
38 {
39 'target_name': 'genproto_candidates_proto',
40 'type': 'none',
41 'toolsets': ['host'],
42 'sources': [
43 'candidates.proto',
44 ],
45 'includes': [
46 '../protobuf/genproto.gypi',
47 ],
48 'dependencies': [
49 '../config/config.gyp:genproto_config',
50 ],
51 },
52 {
53 'target_name': 'candidates_proto',
54 'type': 'static_library',
55 'hard_dependency': 1,
56 'sources': [
57 '<(proto_out_dir)/<(relative_dir)/candidates.pb.cc',
58 ],
59 'dependencies': [
60 '../protobuf/protobuf.gyp:protobuf',
61 'genproto_candidates_proto#host',
62 ],
63 'export_dependent_settings': [
64 'genproto_candidates_proto#host',
65 ],
66 },
67 {
68 'target_name': 'genproto_commands_proto',
69 'type': 'none',
70 'toolsets': ['host'],
71 'sources': [
72 'commands.proto',
73 ],
74 'includes': [
75 '../protobuf/genproto.gypi',
76 ],
77 'dependencies': [
78 '../config/config.gyp:genproto_config',
79 '../dictionary/dictionary_base.gyp:genproto_dictionary',
80 ],
81 },
82 {
83 'target_name': 'commands_proto',
84 'type': 'static_library',
85 'hard_dependency': 1,
86 'sources': [
87 '<(proto_out_dir)/<(relative_dir)/commands.pb.cc',
88 ],
89 'dependencies': [
90 '../config/config.gyp:config_protocol',
91 '../protobuf/protobuf.gyp:protobuf',
92 '../dictionary/dictionary_base.gyp:dictionary_protocol',
93 'candidates_proto',
94 'genproto_commands_proto#host',
95 ],
96 'export_dependent_settings': [
97 'genproto_commands_proto#host',
98 ],
99 },
100 ],
101 }
2929 #import "renderer/mac/CandidateView.h"
3030
3131 #include "base/coordinates.h"
32 #include "protocol/commands.pb.h"
3233 #include "renderer/table_layout.h"
3334 #include "renderer/window_util.h"
34 #include "session/commands.pb.h"
3535 #include "renderer/mac/CandidateController.h"
3636 #include "renderer/mac/CandidateWindow.h"
3737 #include "renderer/mac/InfolistWindow.h"
3333 #include "base/logging.h"
3434 #include "base/mutex.h"
3535 #include "client/client_interface.h"
36 #include "protocol/commands.pb.h"
3637 #include "renderer/mac/mac_view_util.h"
3738 #include "renderer/table_layout.h"
38 #include "session/commands.pb.h"
3939 #include "renderer/renderer_style.pb.h"
4040 #include "renderer/renderer_style_handler.h"
4141
3333
3434 #include "base/logging.h"
3535 #include "base/coordinates.h"
36 #include "protocol/commands.pb.h"
3637 #include "renderer/mac/CandidateWindow.h"
37 #include "session/commands.pb.h"
3838
3939 using mozc::commands::Candidates;
4040
3333 #include "base/logging.h"
3434 #include "base/mutex.h"
3535 #include "client/client_interface.h"
36 #include "protocol/commands.pb.h"
3637 #include "renderer/mac/mac_view_util.h"
3738 #include "renderer/table_layout.h"
38 #include "session/commands.pb.h"
3939 #include "renderer/renderer_style.pb.h"
4040 #include "renderer/renderer_style_handler.h"
4141
137137 title_rect.size.height;
138138
139139 if (usages.has_focused_index() && (row == usages.focused_index())) {
140 NSRect focused_rect = NSMakeRect(infostyle.window_border(), ypos,
140 NSRect focused_rect = NSMakeRect(infostyle.window_border(), ypos,
141141 infostyle.window_width() - infostyle.window_border() * 2,
142142 title_rect.size.height + desc_rect.size.height
143143 + infostyle.row_rect_padding() * 2);
154154 [NSBezierPath strokeRect:focused_rect];
155155 } else {
156156 if (title_style.has_background_color()) {
157 NSRect rect = NSMakeRect(infostyle.window_border(), ypos,
157 NSRect rect = NSMakeRect(infostyle.window_border(), ypos,
158158 infostyle.window_width() - infostyle.window_border() * 2,
159159 title_rect.size.height + infostyle.row_rect_padding());
160160 [MacViewUtil::ToNSColor(title_style.background_color()) set];
161161 [NSBezierPath fillRect:rect];
162162 }
163163 if (desc_style.has_background_color()) {
164 NSRect rect = NSMakeRect(infostyle.window_border(),
164 NSRect rect = NSMakeRect(infostyle.window_border(),
165165 ypos + title_rect.size.height + infostyle.row_rect_padding(),
166166 infostyle.window_width() - infostyle.window_border() * 2,
167167 desc_rect.size.height + infostyle.row_rect_padding());
187187 const InformationList &usages = candidates_.usages();
188188
189189 int ypos = infostyle.window_border();
190
190
191191 if (draw_flag && infostyle.has_caption_string()) {
192192 const RendererStyle::TextStyle &caption_style =
193193 infostyle.caption_style();
3434 #include "base/coordinates.h"
3535 #include "base/logging.h"
3636 #include "client/client_interface.h"
37 #include "protocol/commands.pb.h"
3738 #include "renderer/mac/InfolistWindow.h"
38 #include "session/commands.pb.h"
3939
4040 using mozc::commands::Candidates;
4141 using mozc::commands::Output;
3434 #include "base/logging.h"
3535 #include "base/mac_util.h"
3636 #include "base/port.h"
37 #include "session/commands.pb.h"
37 #include "protocol/commands.pb.h"
3838 #include "renderer/mac/RendererBaseWindow.h"
3939
4040
3636 #include "base/logging.h"
3737 #include "base/mutex.h"
3838 #include "base/util.h"
39 #include "session/commands.pb.h"
39 #include "protocol/commands.pb.h"
4040 #include "renderer/mac/mac_server_send_command.h"
4141 #include "renderer/mac/CandidateController.h"
4242
3333 #import "mac/common.h"
3434
3535 #include "base/const.h"
36 #include "session/commands.pb.h"
36 #include "protocol/commands.pb.h"
3737
3838 namespace mozc {
3939 namespace renderer {
6969 '../base/base.gyp:base',
7070 '../config/config.gyp:config_protocol',
7171 '../ipc/ipc.gyp:ipc',
72 '../session/session_base.gyp:session_protocol',
72 '../protocol/protocol.gyp:commands_proto',
7373 'renderer_protocol',
7474 ],
7575 },
8484 '../client/client.gyp:client',
8585 '../config/config.gyp:config_handler',
8686 '../ipc/ipc.gyp:ipc',
87 '../session/session_base.gyp:session_protocol',
87 '../protocol/protocol.gyp:commands_proto',
8888 'renderer_protocol',
8989 ],
9090 },
197197 'dependencies': [
198198 '../config/config.gyp:config_protocol',
199199 '../protobuf/protobuf.gyp:protobuf',
200 '../session/session_base.gyp:session_protocol',
200 '../protocol/protocol.gyp:commands_proto',
201201 'genproto_renderer#host'
202202 ],
203203 'export_dependent_settings': [
260260 'dependencies': [
261261 '../base/base.gyp:base',
262262 '../config/config.gyp:config_protocol',
263 '../session/session_base.gyp:session_protocol',
263 '../protocol/protocol.gyp:commands_proto',
264264 'renderer_protocol',
265265 ],
266266 },
288288 'dependencies': [
289289 '../base/base.gyp:base',
290290 '../config/config.gyp:config_protocol',
291 '../session/session_base.gyp:session_protocol',
291 '../protocol/protocol.gyp:commands_proto',
292292 'renderer_protocol',
293293 'win32_font_util',
294294 ],
411411 '../config/config.gyp:config_protocol',
412412 '../config/config.gyp:stats_config_util',
413413 '../ipc/ipc.gyp:ipc',
414 '../session/session_base.gyp:session_protocol',
414 '../protocol/protocol.gyp:commands_proto',
415415 'gen_mozc_renderer_resource_header#host',
416416 'renderer_protocol',
417417 'renderer_server',
472472 '../config/config.gyp:config_protocol',
473473 '../config/config.gyp:stats_config_util',
474474 '../ipc/ipc.gyp:ipc',
475 '../session/session_base.gyp:session_protocol',
475 '../protocol/protocol.gyp:commands_proto',
476476 'gen_renderer_files#host',
477477 'renderer_protocol',
478478 'renderer_server',
578578 '../config/config.gyp:genproto_config#host',
579579 '../config/config.gyp:stats_config_util',
580580 '../ipc/ipc.gyp:ipc',
581 '../session/session_base.gyp:genproto_session#host',
582581 'renderer_protocol',
583582 'gtk2_build_environment',
584583 'renderer_server',
3434
3535 syntax = "proto2";
3636
37 import "session/commands.proto";
37 import "protocol/commands.proto";
3838
3939 package mozc.commands;
4040
3939 #include "converter/converter_interface.h"
4040 #include "converter/segments.h"
4141 #include "rewriter/calculator/calculator_interface.h"
42 #include "session/commands.pb.h"
42 #include "protocol/commands.pb.h"
4343
4444 namespace mozc {
4545
4141 #include "converter/segments.h"
4242 #include "engine/engine_interface.h"
4343 #include "engine/mock_data_engine_factory.h"
44 #include "protocol/commands.pb.h"
4445 #include "rewriter/calculator/calculator_interface.h"
4546 #include "rewriter/calculator/calculator_mock.h"
46 #include "session/commands.pb.h"
4747 #include "testing/base/public/gunit.h"
4848
4949 DECLARE_string(test_tmpdir);
5151 #include "config/config_handler.h"
5252 #include "converter/conversion_request.h"
5353 #include "converter/segments.h"
54 #include "session/commands.pb.h"
54 #include "protocol/commands.pb.h"
5555
5656 namespace mozc {
5757
4141 #include "config/config.pb.h"
4242 #include "converter/conversion_request.h"
4343 #include "converter/segments.h"
44 #include "session/commands.pb.h"
44 #include "protocol/commands.pb.h"
4545 #include "testing/base/public/gunit.h"
4646
4747 DECLARE_string(test_tmpdir);
4141 #include "config/config_handler.h"
4242 #include "converter/conversion_request.h"
4343 #include "converter/segments.h"
44 #include "session/commands.pb.h"
44 #include "protocol/commands.pb.h"
4545 #include "usage_stats/usage_stats.h"
4646
4747 // EmojiRewriter:
4141 #include "converter/segments.h"
4242 #include "data_manager/user_pos_manager.h"
4343 #include "dictionary/pos_matcher.h"
44 #include "protocol/commands.pb.h"
4445 #include "rewriter/variants_rewriter.h"
45 #include "session/commands.pb.h"
4646 #include "testing/base/public/gunit.h"
4747 #include "usage_stats/usage_stats.h"
4848 #include "usage_stats/usage_stats_testing_util.h"
4040 #include "config/config_handler.h"
4141 #include "converter/conversion_request.h"
4242 #include "converter/segments.h"
43 #include "protocol/commands.pb.h"
4344 #include "rewriter/embedded_dictionary.h"
4445 #include "rewriter/rewriter_interface.h"
45 #include "session/commands.pb.h"
4646
4747 namespace mozc {
4848 namespace {
3838 #include "config/config_handler.h"
3939 #include "converter/conversion_request.h"
4040 #include "converter/segments.h"
41 #include "session/commands.pb.h"
41 #include "protocol/commands.pb.h"
4242 #include "testing/base/public/gunit.h"
4343
4444 DECLARE_string(test_tmpdir);
3535 #include "base/util.h"
3636 #include "converter/conversion_request.h"
3737 #include "converter/segments.h"
38 #include "session/commands.pb.h"
38 #include "protocol/commands.pb.h"
3939
4040 namespace mozc {
4141
3535 #include "base/system_util.h"
3636 #include "converter/conversion_request.h"
3737 #include "converter/segments.h"
38 #include "session/commands.pb.h"
38 #include "protocol/commands.pb.h"
3939 #include "testing/base/public/gunit.h"
4040
4141 DECLARE_string(test_tmpdir);
3939 #include "converter/segments.h"
4040 #include "dictionary/dictionary_interface.h"
4141 #include "dictionary/pos_matcher.h"
42 #include "session/commands.pb.h"
42 #include "protocol/commands.pb.h"
4343 #include "usage_stats/usage_stats.h"
4444
4545 using mozc::dictionary::DictionaryInterface;
4747 #include "data_manager/user_pos_manager.h"
4848 #include "dictionary/dictionary_mock.h"
4949 #include "dictionary/pos_matcher.h"
50 #include "session/commands.pb.h"
50 #include "protocol/commands.pb.h"
5151 #include "testing/base/public/gunit.h"
5252 #include "usage_stats/usage_stats.h"
5353 #include "usage_stats/usage_stats_testing_util.h"
3636 #include "config/config_handler.h"
3737 #include "converter/conversion_request.h"
3838 #include "converter/segments.h"
39 #include "protocol/commands.pb.h"
3940 #include "rewriter/rewriter_interface.h"
40 #include "session/commands.pb.h"
4141
4242 namespace mozc {
4343
4343 #include "converter/segments.h"
4444 #include "data_manager/data_manager_interface.h"
4545 #include "dictionary/pos_matcher.h"
46 #include "protocol/commands.pb.h"
4647 #include "rewriter/number_compound_util.h"
47 #include "session/commands.pb.h"
4848
4949 using mozc::dictionary::POSMatcher;
5050
4545 #endif // MOZC_USE_PACKED_DICTIONARY
4646 #include "data_manager/testing/mock_data_manager.h"
4747 #include "dictionary/pos_matcher.h"
48 #include "session/commands.pb.h"
48 #include "protocol/commands.pb.h"
4949 #include "testing/base/public/gunit.h"
5050
5151 DECLARE_string(test_tmpdir);
3030
3131 #include "converter/conversion_request.h"
3232 #include "converter/segments.h"
33 #include "session/commands.pb.h"
33 #include "protocol/commands.pb.h"
3434
3535 namespace mozc {
3636
2828
2929 #include "converter/conversion_request.h"
3030 #include "converter/segments.h"
31 #include "protocol/commands.pb.h"
3132 #include "rewriter/remove_redundant_candidate_rewriter.h"
3233 #include "testing/base/public/gunit.h"
33 #include "session/commands.pb.h"
3434
3535 namespace mozc {
3636 TEST(RemoveRedundantCandidateRewriterTest, RemoveTest) {
8888 '../data_manager/data_manager.gyp:user_pos_manager',
8989 '../dictionary/dictionary.gyp:dictionary',
9090 '../dictionary/dictionary_base.gyp:pos_matcher',
91 '../session/session_base.gyp:session_protocol',
91 '../protocol/protocol.gyp:commands_proto',
9292 '../storage/storage.gyp:storage',
9393 '../usage_stats/usage_stats_base.gyp:usage_stats',
9494 'calculator/calculator.gyp:calculator',
7171 '../data_manager/data_manager.gyp:user_pos_manager',
7272 '../data_manager/testing/mock_data_manager.gyp:mock_data_manager',
7373 '../engine/engine.gyp:mock_data_engine_factory',
74 '../protocol/protocol.gyp:commands_proto',
7475 '../session/session_base.gyp:request_test_util',
75 '../session/session_base.gyp:session_protocol',
7676 '../testing/testing.gyp:gtest_main',
7777 'calculator/calculator.gyp:calculator_mock',
7878 'rewriter.gyp:rewriter',
145145 '../data_manager/testing/mock_data_manager.gyp:mock_data_manager',
146146 '../dictionary/dictionary.gyp:dictionary_mock',
147147 '../dictionary/dictionary_base.gyp:pos_matcher',
148 '../session/session_base.gyp:session_protocol',
148 '../protocol/protocol.gyp:commands_proto',
149149 '../testing/testing.gyp:gtest_main',
150150 '../usage_stats/usage_stats_test.gyp:usage_stats_testing_util',
151151 'rewriter.gyp:rewriter',
175175 '../base/base.gyp:base',
176176 '../composer/composer.gyp:composer',
177177 '../data_manager/testing/mock_data_manager.gyp:mock_data_manager',
178 '../protocol/protocol.gyp:commands_proto',
178179 '../session/session_base.gyp:request_test_util',
179 '../session/session_base.gyp:session_protocol',
180180 '../testing/testing.gyp:gtest_main',
181181 '../usage_stats/usage_stats_test.gyp:usage_stats_testing_util',
182182 'rewriter.gyp:rewriter',
4141 #include "converter/conversion_request.h"
4242 #include "converter/segments.h"
4343 #include "dictionary/pos_matcher.h"
44 #include "protocol/commands.pb.h"
4445 #include "rewriter/embedded_dictionary.h"
4546 #include "rewriter/rewriter_interface.h"
46 #include "session/commands.pb.h"
4747
4848 using mozc::dictionary::POSMatcher;
4949
4040 #include "converter/segments.h"
4141 #include "data_manager/testing/mock_data_manager.h"
4242 #include "dictionary/pos_matcher.h"
43 #include "session/commands.pb.h"
43 #include "protocol/commands.pb.h"
4444 #include "testing/base/public/gunit.h"
4545
4646 DECLARE_string(test_tmpdir);
4242 #include "converter/converter_interface.h"
4343 #include "converter/segments.h"
4444 #include "data_manager/data_manager_interface.h"
45 #include "protocol/commands.pb.h"
4546 #include "rewriter/embedded_dictionary.h"
4647 #include "rewriter/rewriter_interface.h"
47 #include "session/commands.pb.h"
4848
4949 // SymbolRewriter:
5050 // When updating the rule
4141 #include "data_manager/testing/mock_data_manager.h"
4242 #include "engine/engine_interface.h"
4343 #include "engine/mock_data_engine_factory.h"
44 #include "session/commands.pb.h"
44 #include "protocol/commands.pb.h"
4545 #include "testing/base/public/gunit.h"
4646
4747 DECLARE_string(test_tmpdir);
3939 #include "converter/conversion_request.h"
4040 #include "converter/segments.h"
4141 #include "dictionary/pos_matcher.h"
42 #include "session/commands.pb.h"
42 #include "protocol/commands.pb.h"
4343 // For T13n normalize
4444 #include "transliteration/transliteration.h"
4545 #include "usage_stats/usage_stats.h"
4848 #endif // MOZC_USE_PACKED_DICTIONARY
4949 #include "data_manager/user_pos_manager.h"
5050 #include "dictionary/pos_matcher.h"
51 #include "session/commands.pb.h"
51 #include "protocol/commands.pb.h"
5252 #include "testing/base/public/gunit.h"
5353 #include "transliteration/transliteration.h"
5454 #include "usage_stats/usage_stats.h"
4242 #include "converter/segments.h"
4343 #include "engine/engine_interface.h"
4444 #include "engine/mock_data_engine_factory.h"
45 #include "session/commands.pb.h"
45 #include "protocol/commands.pb.h"
4646 #include "testing/base/public/gunit.h"
4747
4848 DECLARE_string(test_tmpdir);
3838 #include "converter/conversion_request.h"
3939 #include "converter/segments.h"
4040 #include "dictionary/pos_matcher.h"
41 #include "session/commands.pb.h"
41 #include "protocol/commands.pb.h"
4242
4343 using mozc::config::CharacterFormManager;
4444 using mozc::dictionary::POSMatcher;
3939 #include "base/version.h"
4040 #include "converter/conversion_request.h"
4141 #include "converter/segments.h"
42 #include "session/commands.pb.h"
42 #include "protocol/commands.pb.h"
4343
4444 namespace mozc {
4545 namespace {
3737 #include "config/config_handler.h"
3838 #include "converter/conversion_request.h"
3939 #include "converter/segments.h"
40 #include "session/commands.pb.h"
40 #include "protocol/commands.pb.h"
4141 #include "testing/base/public/gunit.h"
4242
4343 DECLARE_string(test_tmpdir);
5252 #include "base/scoped_ptr.h"
5353 #include "base/system_util.h"
5454 #include "engine/engine_factory.h"
55 #include "session/commands.pb.h"
55 #include "protocol/commands.pb.h"
5656 #include "session/random_keyevents_generator.h"
5757 #include "session/session_handler.h"
5858 #include "session/session_usage_observer.h"
+0
-225
src/session/candidates.proto less more
0 // Copyright 2010-2015, Google Inc.
1 // All rights reserved.
2 //
3 // Redistribution and use in source and binary forms, with or without
4 // modification, are permitted provided that the following conditions are
5 // met:
6 //
7 // * Redistributions of source code must retain the above copyright
8 // notice, this list of conditions and the following disclaimer.
9 // * Redistributions in binary form must reproduce the above
10 // copyright notice, this list of conditions and the following disclaimer
11 // in the documentation and/or other materials provided with the
12 // distribution.
13 // * Neither the name of Google Inc. nor the names of its
14 // contributors may be used to endorse or promote products derived from
15 // this software without specific prior written permission.
16 //
17 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
29 // Protocol messages of candidates to be used for mozc client/server
30 // communication and client/renderer communication.
31
32 syntax = "proto2";
33
34 package mozc.commands;
35
36 option java_outer_classname = "ProtoCandidates";
37 option java_package = "org.mozc.android.inputmethod.japanese.protobuf";
38
39 // Annotation against a candidate.
40 message Annotation {
41 // Annotation prepended to the value.
42 optional string prefix = 1;
43 // Annotation appended to the value.
44 optional string suffix = 2;
45 // Type of the candidate such as [HALF][KATAKANA], [GREEK],
46 // [Black square], etc...
47 optional string description = 3;
48 // Shortcut key to select this candidate.
49 optional string shortcut = 4;
50 // Set to true if this candidate can be deleted from history.
51 optional bool deletable = 5 [default = false];
52 };
53
54 // Additional information to a candidate word. This message is
55 // used for describing a word usage for instance.
56 message Information {
57 // Unique number specifying the information.
58 optional int32 id = 1;
59
60 // Title string of the information. For usage, this value is
61 // probably equal to Candidate::value or its canonicalized value.
62 optional string title = 2;
63
64 // The content of the information. For usage, this value actually
65 // describes how to use the word.
66 optional string description = 3;
67
68 // The IDs of candidates which connect with the information.
69 repeated int32 candidate_id = 4;
70 };
71
72 // Category describes the attribute of the words.
73 enum Category {
74 CONVERSION = 0;
75 PREDICTION = 1;
76 SUGGESTION = 2;
77 TRANSLITERATION = 3;
78 USAGE = 4;
79 };
80
81 // DisplayType is a hint to UI renderers describing how the words are
82 // displayed.
83 enum DisplayType {
84 MAIN = 0;
85 CASCADE = 1;
86 };
87
88 // TODO(nona): merge to RendererCommand::Rectangle
89 message Rectangle {
90 required int32 x = 1;
91 required int32 y = 2;
92 required int32 width = 3;
93 required int32 height = 4;
94 }
95
96 message InformationList {
97 optional uint32 focused_index = 1;
98 repeated Information information = 2;
99 // Category of the infolist.
100 optional Category category = 3 [default = CONVERSION];
101
102 // Information to be used for rendering.
103 optional DisplayType display_type = 4 [default = CASCADE];
104
105 // How long rendere needs to wait before the infolist is displayed.
106 // the default setting is 500 msec.
107 optional uint32 delay = 5 [ default = 500 ];
108 };
109
110 // Message representing the footer part of the candidate window.
111 message Footer {
112 // Message shown like a status bar.
113 optional string label = 1;
114 // Whether index (e.g. 10/120) is visible or not.
115 optional bool index_visible = 2 [default = false];
116 // Whether the logo image is visible or not.
117 optional bool logo_visible = 3 [default = false];
118 // Message modestly shown. It is used for displaying the version on
119 // dev-channel now.
120 optional string sub_label = 4;
121 };
122
123 message CandidateWord {
124 // Unique number specifing the candidate. This may be a negative value.
125 optional int32 id = 1;
126 // The first index should be zero and index numbers should increase by one.
127 optional uint32 index = 2;
128 // Reading of the value. The value is only used when the key is
129 // different from the input composition (e.g. suggestion/prediction).
130 optional string key = 3;
131 // Converted value. (e.g. Kanji value).
132 optional string value = 4;
133 optional Annotation annotation = 5;
134 };
135
136 message CandidateList {
137 // This value represents the focused position of the next
138 // |candidates|. If the |candidates| is a part of the whole
139 // candidate words (as a result of paging), this value indicates the
140 // position from the beginning of that part. (ex. where
141 // |candidates| contatins 10th to 18th candidates, focused_index=0
142 // means the 10th candidate, but not 1st candidate.
143 //
144 // The existense of |focused_index| does not represents whether this
145 // candidate list is a 'suggestion' or not. |category| represents
146 // it.
147 optional uint32 focused_index = 1;
148 repeated CandidateWord candidates = 2;
149 // Category of the candidates.
150 optional Category category = 3 [default = CONVERSION];
151 };
152
153 // TODO(komatsu) rename it to CandidateWindow.
154 message Candidates {
155 // TODO(komatsu): Use CandidateList.
156 // When has_focused_index() is true, this message contains predicted and
157 // normally converted candidates. Otherwise, when the field is not set,
158 // this message contains a 'suggestion'.
159 optional uint32 focused_index = 1;
160
161 // The size of the total candidates in this candidate list. The
162 // value does not include the size of subcandidate lists. Note, the
163 // next repeated-Candidate=3 may not contain all candidates.
164 // all_candidates contains the values of subcandidate lists.
165 required uint32 size = 2;
166
167 // TODO(komatsu): Use CandidateList.
168 repeated group Candidate = 3 {
169 // The first index should be zero and index numbers should increase by one.
170 required uint32 index = 4;
171 required string value = 5;
172 optional int32 id = 9; // Unique number specifing the candidate.
173 optional Annotation annotation = 7;
174 optional int32 information_id = 10;
175 };
176 // The position on the composition in character counted by Util::CharsLen.
177 // The number represents the left edge of the candidate window. For example,
178 // if the composition is "あいう" and the cursor is the position is between
179 // "あ" and "い" (e.g. "あ|いう"), the number should be 1.
180 // Note, Util::CharsLen does not take care of IVS or combining character
181 // so much. Thus CharsLen's behavoir on those characters might be changed.
182 required uint32 position = 6;
183
184 // Nested candidates aka cascading window.
185 optional Candidates subcandidates = 8;
186
187 // Usages of candidates.
188 optional InformationList usages = 10;
189
190 // TODO(komatsu): Use CandidateList.
191 // Category of the candidates
192 optional Category category = 11 [default = CONVERSION];
193
194 // Information to be used for rendering.
195 optional DisplayType display_type = 12 [default = MAIN];
196
197 // Footer of the GUI window.
198 optional Footer footer = 13;
199
200 // The direction of candidates in the window. This is just a
201 // suggestion from the server and client does not have to follow.
202 enum Direction {
203 VERTICAL = 0;
204 HORIZONTAL = 1;
205 };
206 optional Direction direction = 14 [ default = VERTICAL ];
207
208 // This position is used for suggest window position.
209 optional Rectangle composition_rectangle = 15;
210 optional Rectangle caret_rectangle = 16;
211
212 enum CandidateWindowLocation{
213 // Shows candidate window under the caret. This is used for prediction and
214 // conversion
215 CARET = 0;
216 // Shows candidate window aligned with composition area. This is used for
217 // suggestion.
218 COMPOSITION = 1;
219 }
220 optional CandidateWindowLocation window_location = 17;
221
222 // The number of candidates per page.
223 optional uint32 page_size = 18 [ default = 9 ];
224 };
+0
-1127
src/session/commands.proto less more
0 // Copyright 2010-2015, Google Inc.
1 // All rights reserved.
2 //
3 // Redistribution and use in source and binary forms, with or without
4 // modification, are permitted provided that the following conditions are
5 // met:
6 //
7 // * Redistributions of source code must retain the above copyright
8 // notice, this list of conditions and the following disclaimer.
9 // * Redistributions in binary form must reproduce the above
10 // copyright notice, this list of conditions and the following disclaimer
11 // in the documentation and/or other materials provided with the
12 // distribution.
13 // * Neither the name of Google Inc. nor the names of its
14 // contributors may be used to endorse or promote products derived from
15 // this software without specific prior written permission.
16 //
17 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28
29 // Protocol messages to be used for mozc client/server communication.
30 //
31 // The Command message contains all the input/output values for
32 // client/server commnication. The messages structure of Command and
33 // its child messages are here:
34
35 syntax = "proto2";
36
37 import "config/config.proto";
38 import "session/candidates.proto";
39 import "dictionary/user_dictionary_storage.proto";
40
41 package mozc.commands;
42
43 option java_outer_classname = "ProtoCommands";
44 option java_package = "org.mozc.android.inputmethod.japanese.protobuf";
45
46 // This enum is used by SessionCommand::input_mode with
47 // CHANGE_INPUT_MODE and Output::mode.
48 enum CompositionMode {
49 DIRECT = 0;
50 HIRAGANA = 1;
51 FULL_KATAKANA = 2;
52 HALF_ASCII = 3;
53 FULL_ASCII = 4;
54 HALF_KATAKANA = 5;
55 NUM_OF_COMPOSITIONS = 6;
56 }
57
58 message KeyEvent {
59 enum SpecialKey {
60 NO_SPECIALKEY = 0;
61 DIGIT = 1;
62 // On Windows, SpecialKey::On and SpecialKey::OFF are obsolete. Use
63 // TURN_ON_IME session command should be used instead. See b/10216365.
64 // On other platforms, especially on Mac, please note that
65 // client/client.cc still relies on SpecialKey::On for session playback.
66 // We need to fix b/10250883 first.
67 // TODO(team): Unsupport SpecialKey::On and SpecialKey::OFF.
68 ON = 2;
69 OFF = 3;
70 SPACE = 4;
71 ENTER = 5;
72 LEFT = 6;
73 RIGHT = 7;
74 UP = 8;
75 DOWN = 9;
76 ESCAPE = 10;
77 DEL = 11; // not DELETE because DELETE is reserved in MSVC
78 BACKSPACE = 12;
79 HENKAN = 13;
80 MUHENKAN = 14;
81 KANA = 15; // VK_DBE_HIRAGANA(Win), kVK_JIS_Kana(Mac)
82 // TODO(toshiyuki): It is better to rename this to HIRAGANA
83 // In Windows, we have Katakana and it may confusing.
84 HOME = 16;
85 END = 17;
86 TAB = 18;
87 F1 = 19;
88 F2 = 20;
89 F3 = 21;
90 F4 = 22;
91 F5 = 23;
92 F6 = 24;
93 F7 = 25;
94 F8 = 26;
95 F9 = 27;
96 F10 = 28;
97 F11 = 29;
98 F12 = 30;
99 PAGE_UP = 31;
100 PAGE_DOWN = 32;
101 INSERT = 33;
102 F13 = 34;
103 F14 = 35;
104 F15 = 36;
105 F16 = 37;
106 F17 = 38;
107 F18 = 39;
108 F19 = 40;
109 F20 = 41;
110 F21 = 42;
111 F22 = 43;
112 F23 = 44;
113 F24 = 45;
114 EISU = 46; // alphanumeric VK_DBE_ALPHANUMERIC(Win), kVK_JIS_Eisu(Mac)
115 NUMPAD0 = 47;
116 NUMPAD1 = 48;
117 NUMPAD2 = 49;
118 NUMPAD3 = 50;
119 NUMPAD4 = 51;
120 NUMPAD5 = 52;
121 NUMPAD6 = 53;
122 NUMPAD7 = 54;
123 NUMPAD8 = 55;
124 NUMPAD9 = 56;
125 MULTIPLY = 57; // Numpad [*]
126 ADD = 58; // Numpad [+]
127 SEPARATOR = 59; // Numpad [enter]
128 SUBTRACT = 60; // Numpad [-]
129 DECIMAL = 61; // Numpad [.]
130 DIVIDE = 62; // Numpad [/]
131 EQUALS = 63; // Numpad [=]
132 TEXT_INPUT = 64; // Meta key event representing any text input.
133 HANKAKU = 65;
134 KANJI = 66;
135 KATAKANA = 67; // VK_DBE_KATAKANA(Win)
136 CAPS_LOCK = 68;
137 // Unsupported keys (e.g. PrtSc, Pause) fall back to UNDEFINED_KEY.
138 UNDEFINED_KEY = 69;
139 COMMA = 70; // Numpad [,]
140 CLEAR = 71; // Numpad [5] without NUMLOCK
141 VIRTUAL_LEFT = 72; // Left key on virtual (software) keyboard
142 VIRTUAL_RIGHT = 73; // Right key on virtual (software) keyboard
143 VIRTUAL_ENTER = 74; // Enter key on virtual (software) keyboard
144
145 NUM_SPECIALKEYS = 75;
146 };
147
148 // CTRL, ALT and SHIFT cover both LEFT and RIGHT keys. If the
149 // difference between LEFT and RIGHT is no matter, using CTRL (or ALT, SHIFT)
150 // is preferred.
151 // If LEFT (or RIGHT) CTRL(or ALT, SHIFT) is pressed, LEFT_CTRL is set on
152 // Windows or Mac client, or LEFT_CTRL and CTRL are set on Unix client.
153 // Mozc key translation logic is as follows
154 //
155 // ---- Modifier Keys -----
156 // | |
157 // | B |
158 // ---------+------ -- -----+-------
159 // | | D | | E | |
160 // | A +---- +--------+-------- C |
161 // | | F | |
162 // --Special Keys-- ---Other Keys---
163 //
164 // A:Press only a special key
165 // => Send special key event with no modifier.
166 // B:Press only modifier keys
167 // => Send modifier key event with no key_code.
168 // C:Press an other key
169 // => Send KeyEvent with no modifier.
170 // D:Press a special key with one or more modifier keys
171 // => Send special key event with modifiers.
172 // E:Press an other key with one or more modifier keys
173 // => If combined key is printable, replace keycodes. Otherwise, just send
174 // with modifier keys. Note that, unless the whole combined key is
175 // printable, keycodes are not replaced even if a subset of combined key is
176 // printable.
177 // F:Otherwise
178 // => Send nothing.
179 //
180 // Following example shows expected behaviours.
181 // E.g. )
182 // case | Pressed Key | translated key event
183 // ----------------------------------------------------
184 // A | SP | special_key = 4
185 // A | F1 | special_key = 19
186 // B | CTRL | modifier_key = {CTRL}
187 // B | SHIFT | modifier_key = {SHIFT}
188 // B | CTRL+SHIFT | modifier_key = {CTRL,SHIFT}
189 // C | 'a' | key_code = \x61 = 'a'
190 // D | CTRL+BS | special_key = 12, modifier_key = {CTRL}
191 // D | CTRL+SHIFT+BS | special_key = 12, modifier_key = {CTRL,SHIFT}
192 // E | SHIFT+'a' | key_code = \x41 = 'A'
193 // E | CTRL+'a' | key_code = \x61, modifier_key = {CTRL}
194 // E | CTRL+ALT+'a' | key_code = \x61, modifier_key = {CTRL,ALT}
195 // E | CTRL+SHIFT+'a'| key_code = \x61, modifier_key = {CTRL,SHIFT}
196 // F | CTRL+BS+SP | send nothing
197 //
198 // In addition, we treat CAPS lock independently besides alphabet keys,
199 // though it is a member of modifier keys. Following example shows currently
200 // expected behaviours with Caps lock set.
201 //
202 // E.g. ) While CAPS is set on.
203 // Pressed Key | translated key event
204 // ----------------------------------------------------
205 // 'a' | key_code = \x41 = 'A', modifier_key = {CAPS}
206 // SHIFT+'a' | key_code = \x61 = 'a', modifier_key = {CAPS}
207 // CTRL+'a' | key_code = \x41, modifier_key = {CTRL,CAPS}
208 // CTRL+ALT+'a' | key_code = \x41, modifier_key = {CTRL,ALT,CAPS}
209 // CTRL+SHIFT+'a'| key_code = \x41, modifier_key = {CTRL,SHIFT,CAPS}
210 //
211 // However, only in short-cut judgement, we should convert capital characters
212 // into lower cases.
213 // TODO(peria): Specify exceptions with CAPS, and unify with the above table.
214
215 enum ModifierKey {
216 CTRL = 1;
217 ALT = 2;
218 SHIFT = 4;
219 KEY_DOWN = 8;
220 KEY_UP = 16;
221 LEFT_CTRL = 32;
222 LEFT_ALT = 64;
223 LEFT_SHIFT = 128;
224 RIGHT_CTRL = 256;
225 RIGHT_ALT = 512;
226 RIGHT_SHIFT = 1024;
227 CAPS = 2048;
228 };
229
230 // Probable key event, mainly for touch screen.
231 // User's input has ambiguity (e.g. the touch position is merginal)
232 // so this message expresses the probable event.
233 message ProbableKeyEvent {
234 // message ID is the same as Input message.
235 optional uint32 key_code = 1;
236 optional SpecialKey special_key = 3; // Unprintable key listed above.
237 repeated ModifierKey modifier_keys = 4; // ModifierKeys
238 // Sum of probabilities must be lesser or equal than 1.
239 // 0<= probability <= 1
240 optional double probability = 10;
241 };
242
243 // Printable key in UCS4. If key_code is empty, key_string is used
244 // as a raw input.
245 optional uint32 key_code = 1;
246 optional uint32 modifiers = 2; // Going to be obsolete.
247 optional SpecialKey special_key = 3; // Unprintable key listed above.
248 repeated ModifierKey modifier_keys = 4; // ModifierKeys
249
250 // String used for preedit. Kana characters and strings typed from
251 // a software keyboard are supposed to be stored here. If key_code
252 // is also set, key_code is treated as the raw input and key_string is
253 // treated as the composition input. For example, to set Kana value,
254 // when key_string is "ち", key_code should be 'a' (97). If key_code
255 // is empty, key_string is also treated as the raw input.
256 optional string key_string = 5;
257
258 enum InputStyle {
259 // Follow the current input mode (default).
260 FOLLOW_MODE = 0;
261 // Do not transliterate key_string and use it as-is.
262 AS_IS = 1;
263 // Immediately output key_string on the precomposition mode.
264 // Same with AS_IS on the preedit mode.
265 DIRECT_INPUT = 2;
266 };
267 optional InputStyle input_style = 6 [default = FOLLOW_MODE];
268
269 // Input mode
270 // For histrical reasons, this field expects a temporary conversion
271 // mode rather than comeback input mode.
272 optional CompositionMode mode = 7;
273
274 // Probable key events
275 // Even if you can fill this field,
276 // don't omit Input.key_code and so on
277 // because preedit string is composed based on them.
278 repeated ProbableKeyEvent probable_key_event = 8;
279
280 // IME on/off mode
281 // You can use this field to change the IME on/off mode indirectly without
282 // sending SpecialKey:ON or SpecialKey:OFF events.
283 // If the internal ImeContext::State is DIRECT and this field is true, the
284 // converter will change the state to PRECONPOSITION and then handles this key
285 // event.
286 // If the internal ImeContext::State is not DIRECT and this field is false,
287 // the converter will change the state to DIRECT and then handles this key
288 // event.
289 // Implementation note: We need both |mode| and |activated| to support
290 // indirect IME off, where |mode| should contain the next mode. If this field
291 // is not set, the server will act as if indirect on/off was not supported.
292 optional bool activated = 9;
293 };
294
295 message GenericStorageEntry {
296 enum StorageType {
297 SYMBOL_HISTORY = 0;
298 EMOTICON_HISTORY = 1;
299 EMOJI_HISTORY=2;
300 }
301 optional StorageType type = 1;
302 optional string key = 2;
303 // The type must be bytes instead of string
304 // because value might have U+0000 character as a terminator.
305 // In this case, characters after the terminator are undefined.
306 // Such byte stream cannot be treaed by Java's String class, which
307 // is used for PB's string type.
308 // Instead, PB's bytes type is converted into ByteString in Java,
309 // which can treat C laguage style string described above.
310 repeated bytes value = 3;
311 }
312
313 message SessionCommand {
314 enum CommandType {
315 // Revert the session, this is usually similar to type ESC several times.
316 REVERT = 1;
317 // Commit the session, this is usually similar to type Enter.
318 // SUBMIT session command is accepted in any status.
319 // Pre-condition:
320 // - Any states of IME are acceptable.
321 // Post-condition:
322 // - Preedit text becomes empty.
323 SUBMIT = 2;
324 // Select the specified candidate word by id. This command is
325 // usually used with mouse clicking.
326 SELECT_CANDIDATE = 3;
327
328 // Set the focus to the candidate by id. This is usually used
329 // with mouse dragging. The difference from SELECT_CANDIDATE is
330 // that HIGHLIGHT_CANDIDATE does not close the candidate window
331 // while SELECT_CANDIDATE closes the candidate window.
332 HIGHLIGHT_CANDIDATE = 4;
333
334 // Specify the input mode. This command should be used with
335 // composition_mode.
336 SWITCH_INPUT_MODE = 5;
337
338 // Return the current status such as composition mode, preedit method, etc.
339 GET_STATUS = 6;
340
341 // This command is typically used for mobile IME's partial conversion,
342 // but currently it is on the way. This description is for current spec.
343 //
344 // This command requires that candidates exist.
345 //
346 // If there is a focused candidate (Conversion or Prediction state),
347 // the candidate matched with the given id in the first segment is
348 // submitted, even though the selected segment is not the first segment
349 // (Important thing is whether focused candidate exists
350 // or not. Focused index itself is ignored).
351 // This behavior should be updated because current cursor position and
352 // position of focused segment affects nothing.
353 // We should fix this non-intuitive behavior. Intuitive behavior might be
354 // submitting segments from first one to focused one (inclusive).
355 //
356 // If no focused candidate (Suggestion, including ZeroQuery suggestion),
357 // first (and only) segment's candiadte of which id is equal to id field of
358 // Input message is submitted.
359 // This behavior should be fixed because current cursor position affects
360 // nothing. In future, the characters after the cursor should be kept
361 // as preedit.
362 //
363 // This command's pre- and post- conditions are differenct from
364 // SUBMIT command's. Following conditions will be kept after updating
365 // the behavior.
366 // Pre-condition:
367 // - There should be candidate.
368 // Post-condition:
369 // - No guarantee on preedit text.
370 // TODO(yamaguchi): Update corresponding implementation please.
371 SUBMIT_CANDIDATE = 7;
372
373 // Perform reverse conversion.
374 CONVERT_REVERSE = 8;
375
376 // Perform Undo.
377 UNDO = 9;
378
379 // Reset convert history and revert current composition.
380 // This is usually used by moving cursor with mouse clicking.
381 RESET_CONTEXT = 10;
382
383 // Change cursor position in preedit.
384 MOVE_CURSOR = 11;
385
386 // Specify the input field type.
387 SWITCH_INPUT_FIELD_TYPE = 12;
388
389 // Client side event information for collecting usage statistics
390 USAGE_STATS_EVENT = 13;
391
392 // This command is used in only Android.
393 // Works UNDO or rewind HIRAGANA characters based on the state.
394 UNDO_OR_REWIND = 14;
395
396 // Expand suggestion candidates.
397 // Usual suggestion algorithm is not "rich" but "fast" because suggestion
398 // is executed every key event (On the other hand predicition is "rich"
399 // because prediction is executed only when a user types TAB key).
400 // This command expands suggestion candidate but IME state is
401 // kept as is (Note : PredictAndConvert key command does almost the same
402 // thing but it changes IME state to prediction).
403 EXPAND_SUGGESTION = 15;
404
405 // The client can send the current caret position whenever the caret
406 // position is changed. The caret position is used for suggest window
407 // position calculation. This is an optional message. If client can show
408 // suggest window on the correct position, this message can be ignored.
409 SEND_CARET_LOCATION = 16;
410
411 // Obsolete command. Don't simply remove this command for NUM_OF_COMMANDS.
412 // TODO(team): Replace this command by useful one.
413 OBSOLETE_SEND_LANGUAGE_BAR_COMMAND = 17;
414
415 // When the server is hadling asynchronous request, the server returns the
416 // message with callback request which session_command is GET_ASYNC_RESULT.
417 // After the delay_millisec, the client sends this command to the server.
418 GET_ASYNC_RESULT = 18;
419
420 // Commit the raw text of the composed string.
421 COMMIT_RAW_TEXT = 19;
422
423 // Call ConvertPrevPage session command to show the previous page of
424 // candidates.
425 CONVERT_PREV_PAGE = 20;
426
427 // Call ConvertNextPage session command to show the next page of
428 // candidates.
429 CONVERT_NEXT_PAGE = 21;
430
431 // Make sure IME is turned on. Optionally you can also provide new input
432 // mode in |composition_mode| (but you must not set DIRECT to it).
433 // |composition_mode| is honored even when IME is already turned on.
434 TURN_ON_IME = 22;
435
436 // Make sure IME is turned off. Optionally you can also provide new input
437 // mode in |composition_mode| (but you must not set DIRECT to it). If IME
438 // |composition_mode| is honored even when IME is already turned off.
439 TURN_OFF_IME = 23;
440
441 // Number of commands.
442 // When new command is added, the command should use below number
443 // and NUM_OF_COMMANDS should be incremented.
444 NUM_OF_COMMANDS = 24;
445 };
446 required CommandType type = 1;
447
448 // Unique number specifying a candidate word.
449 optional int32 id = 2;
450
451 // This is used with SWITCH_INPUT_MODE, TURN_ON_IME and TURN_OFF_IME.
452 optional CompositionMode composition_mode = 3;
453
454 // Text argument. This is used by CONVERT_REVERSE at this moment.
455 optional string text = 4;
456
457 // New cursor position in preedit. Used with MOVE_CURSOR.
458 optional uint32 cursor_position = 5;
459
460 // Client side event for collecting usage statistics
461 enum UsageStatsEvent {
462 INFOLIST_WINDOW_SHOW = 1;
463 INFOLIST_WINDOW_HIDE = 2;
464 HANDWRITING_OPEN_EVENT = 3;
465 HANDWRITING_COMMIT_EVENT = 4;
466 CHARACTER_PALETTE_OPEN_EVENT = 5;
467 CHARACTER_PALETTE_COMMIT_EVENT = 6;
468 SOFTWARE_KEYBOARD_LAYOUT_LANDSCAPE = 7;
469 SOFTWARE_KEYBOARD_LAYOUT_PORTRAIT = 8;
470 SUBMITTED_CANDIDATE_ROW_0 = 9;
471 SUBMITTED_CANDIDATE_ROW_1 = 10;
472 SUBMITTED_CANDIDATE_ROW_2 = 11;
473 SUBMITTED_CANDIDATE_ROW_3 = 12;
474 SUBMITTED_CANDIDATE_ROW_4 = 13;
475 SUBMITTED_CANDIDATE_ROW_5 = 14;
476 SUBMITTED_CANDIDATE_ROW_6 = 15;
477 SUBMITTED_CANDIDATE_ROW_7 = 16;
478 SUBMITTED_CANDIDATE_ROW_8 = 17;
479 SUBMITTED_CANDIDATE_ROW_9 = 18;
480 SUBMITTED_CANDIDATE_ROW_GE10 = 19;
481 KEYBOARD_FOLD_EVENT = 20;
482 KEYBOARD_EXPAND_EVENT = 21;
483 MUSHROOM_SELECTION_DIALOG_OPEN_EVENT = 22;
484 }
485 optional UsageStatsEvent usage_stats_event = 7;
486 optional int32 usage_stats_event_int_value = 9;
487
488 // Specify the current caret location, this is used for suggest window
489 // position calculation. Used with SEND_CARET_LOCATION.
490 optional Rectangle caret_rectangle = 8;
491
492 // Unique number specifying an asynchronous request.
493 optional int32 asynchronous_request_id = 10;
494 };
495
496 message Context {
497 // Former part of surrounding text.
498 optional string preceding_text = 1;
499
500 // Latter part of surrounding text.
501 optional string following_text = 2;
502
503 // If this is true, suggestion feature is disabled regardless the
504 // congiguration. If this is false, suggestion feature is followed
505 // by the user's configuration. If you want to omit interim
506 // suggestions during the key typing, you might want to use
507 // request_suggestion.
508 // TODO(komatsu): Delete this field and use experimental_features.
509 optional bool suppress_suggestion = 3 [default = false];
510
511 // Input field type.
512 // The types are based on the input types defined in HTML5.
513 // http://dev.w3.org/html5/spec/Overview.html#attr-input-type
514 // Other types are to be added later.
515 enum InputFieldType {
516 // No restrictions nor special functions. The IME operates as usual.
517 NORMAL = 1;
518
519 // Password field. Text is hidden after input.
520 // For Android,
521 // In order to make the last character visible to the user,
522 // the IME must not hold more than 2 characters in preedit.
523 PASSWORD = 2;
524
525 // Telephone number
526 TEL = 3;
527
528 // Number
529 NUMBER = 4;
530 };
531 // Type of the input field being focused.
532 optional InputFieldType input_field_type = 4;
533
534 // An unique revision ID to specify one specific typing session. A client can
535 // use arbitrary value for this field. The converter is expected to clear its
536 // internal history segments whenever this value is changed. A client should
537 // use the same revision ID whenever the converter should keep it internal
538 // history segments. In order to avoid unexpected history learnings, a client
539 // should update the revision whenever the input focus is changed.
540 optional int32 revision = 5 [default = 0];
541
542 // Repeated fields to be used for experimental features.
543 repeated string experimental_features = 100;
544 };
545
546 // Clients' capability.
547 // Users cannot modify this.
548 // The server has to obey this capability.
549 message Capability {
550 // Bit fields to notify what the client can do.
551 enum TextDeletionCapabilityType {
552 NO_TEXT_DELETION_CAPABILITY = 0;
553
554 // Can delete preceding text which is adjacent to preedit.
555 DELETE_PRECEDING_TEXT = 1;
556 };
557 optional TextDeletionCapabilityType text_deletion = 1
558 [default = NO_TEXT_DELETION_CAPABILITY];
559 };
560
561 // Clients' request to the server.
562 // Users cannot modify this.
563 // In the future each request may be able to be overwirtten by Config.
564 // The server does not have to obey this request.
565 message Request {
566 // Enable zero query suggestion.
567 optional bool zero_query_suggestion = 1
568 [default = false] ; // true for android
569
570 // Conversion's candidate includes suggestion, prediction and conversion.
571 optional bool mixed_conversion = 2
572 [default = false] ; // true for android
573
574 // Combine all segments like mobile IME.
575 optional bool combine_all_segments = 3
576 [default = false] ; // true for android
577
578 enum SpecialRomanjiTable {
579 // Do not use special table.
580 // Romanji table is selected based on Config.
581 DEFAULT_TABLE = 0;
582
583 // Use special table for 12keys (to hiragana).
584 TWELVE_KEYS_TO_HIRAGANA = 10;
585
586 // Use special table for 12keys (to half-width ascii).
587 TWELVE_KEYS_TO_HALFWIDTHASCII = 11;
588
589 // Use special table for flick (to hiragana).
590 FLICK_TO_HIRAGANA = 13;
591
592 // Use special table for flick (to half-width ascii).
593 FLICK_TO_HALFWIDTHASCII = 14;
594
595 // Use special table for both toggle and flick (to hiragana).
596 TOGGLE_FLICK_TO_HIRAGANA = 16;
597
598 // Use special table for both toggle and flick (to half-width ascii).
599 TOGGLE_FLICK_TO_HALFWIDTHASCII = 17;
600
601 // Use special table for Qwerty (for Mobile) (to hiragana).
602 QWERTY_MOBILE_TO_HIRAGANA = 20;
603
604 // Use special table for Qwerty (for Mobile) (to half-width ascii).
605 QWERTY_MOBILE_TO_HALFWIDTHASCII = 22;
606
607 // Use special table for Godan (to hiragana).
608 GODAN_TO_HIRAGANA = 30;
609
610 // Use special table for Godan (to half-width ascii).
611 GODAN_TO_HALFWIDTHASCII = 31;
612
613 // Use special table for Notouch (to hiragana).
614 NOTOUCH_TO_HIRAGANA = 40;
615
616 // Use special table for Notouch (to half-width ascii).
617 NOTOUCH_TO_HALFWIDTHASCII = 41;
618
619 // Obsolete items.
620 OBSOLETE_TWELVE_KEYS_TO_NUMBER = 12;
621 OBSOLETE_FLICK_TO_NUMBER = 15;
622 OBSOLETE_GODAN_TO_NUMBER = 32;
623 OBSOLETE_QWERTY_MOBILE_TO_HIRAGANA_NUMBER = 21;
624 OBSOLETE_TOGGLE_FLICK_TO_NUMBER = 18;
625 };
626
627 // Use special Romanji table.
628 optional SpecialRomanjiTable special_romanji_table = 4
629 [default = DEFAULT_TABLE] ; // TWELVE_KEYS_TO_HIRAGANA for android.
630
631
632 enum SpaceOnAlphanumeric {
633 // The first input is treated as a space, double input is treated
634 // as a conversion. If a character is input after the first
635 // input, the composition will remain. For example, "ab<space>dc"
636 // becomes "ab dc" as a single composition.
637 SPACE_OR_CONVERT_KEEPING_COMPOSITION = 0;
638
639 // The first input is treated as a space, double input is treated
640 // as a conversion. If a character is input after the first
641 // input, the previous composition will be committed. For
642 // example, "ab<space>dc" results "ab " as a committed string and
643 // "dc" as a composition.
644 SPACE_OR_CONVERT_COMMITING_COMPOSITION = 1;
645
646 // Commit the composition and a space.
647 COMMIT = 2;
648 };
649
650 optional SpaceOnAlphanumeric space_on_alphanumeric = 6
651 [default = SPACE_OR_CONVERT_KEEPING_COMPOSITION];
652
653 // Keyboard name for touch devices.
654 // For example, "TWELVE_KEY_TOGGLE_KANA", "QWERTY_KANA_NUMBER".
655 // It is used to analyze touch event usage stats.
656 optional string keyboard_name = 7;
657
658 // Enables Composer's input mode auto updating by using surrounding text.
659 // For example, when a composition string is "ad", a carret is at the end,
660 // and a user selects HIRAGANA mode, if the user moves the carret to between
661 // "a" and "d" the mode will be automatically switch to ASCII (temporarily).
662 // See details in the Composer::UpdateInputMode.
663 optional bool update_input_mode_from_surrounding_text = 8
664 [default = true];
665
666 // Enables Kana-modifier-insensitive conversion as follows:
667 // 1) Voiced/Semi-voiced kana will be hit by non-modified kana.
668 // e.g.) "ば" and "ぱ" will be hit by key "は".
669 // 2) Geminate consonant "っ" will be hit by non-modified kana "つ".
670 // 3) Palatalized kana will be hit by non-modified kana.
671 // e.g.) "ゃ" will be hit by key "や".
672 // Here is an example of the search: "学校" ("がっこう") will be hit
673 // by "かつこう".
674 optional bool kana_modifier_insensitive_conversion = 9 [default = false];
675
676 // Enables Auto partial suggestion.
677 // For Auto partial suggestion, we can see first segment only candidates
678 // adding to normal realtime conversion suggestion results.
679 // If we commit that candidate, we will show suggestions for remaining part
680 // of key.
681 //
682 // Note: This feature can be enabled only for mobile due to UX design.
683 optional bool auto_partial_suggestion = 10 [default = false];
684
685 // Nowadays, four kinds of emoji characters are used in Japan.
686 // - Unicode: Unicode based emoji (since Unicode 6.0).
687 // - Docomo: Docomo's carrier emoji.
688 // - Softbank: Softbank's carrier emoji.
689 // - Kddi: Kddi's carrier emoji.
690 // Note that especially latter three kinds are used on Mobile phones.
691 // So, it is necessary to control what kinds of emoji can be used or not
692 // based on client's (or connected application's) information.
693 // For example, on Android;
694 // - Unicode emoji characters are available only on Android 4.1 or later
695 // only.
696 // - JP mobile carriers' emoji characters depend on the devices. Also,
697 // we need to check the text field's attribute for them.
698 // The following bit set tells the emoji availability to EmojiRewriter.
699 enum EmojiCarrierType {
700 UNICODE_EMOJI = 1;
701 DOCOMO_EMOJI = 2;
702 SOFTBANK_EMOJI = 4;
703 KDDI_EMOJI = 8;
704 }
705
706 // By default, UNICODE emoji is available.
707 optional int32 available_emoji_carrier = 11 [default = 1];
708
709 // For emoji rewriter, it is necessary to control when the rewriter runs
710 // based on the clients. The following bit set is sync'ed to
711 // RewriterInterface::CapabilityType (see rewriter_interface.h, too),
712 // so that clients can fill the value.
713 enum RewriterCapability {
714 NOT_AVAILABLE = 0;
715 CONVERSION = 1;
716 PREDICTION = 2;
717 SUGGESTION = 4;
718 ALL = 7; // CONVERSION | PREDICTION | SUGGESTION.
719 }
720
721 // By default, Emoji rewriter works on conversion mode only.
722 optional int32 emoji_rewriter_capability = 12 [default = 1];
723
724 // Controls the behavior when a user types the left/right key at the edge
725 // of the preedit string (in more precise, the left key at the beginning
726 // of the preedit string, or the right key at the end).
727 enum CrossingEdgeBehavior {
728 // This is the default behavior. The cursor movement at the edge
729 // will make nothing, i.e., keeping the current cursor position (at the
730 // edge), consume the key event.
731 DO_NOTHING = 0;
732
733 // This is the behavior, especially designed for alphabet keyboards on
734 // mobile devices. Assuming the following text:
735 // XXXXabcde|YYYYY
736 // where XXXX is preceding text, abcde is composing text, YYYYY is
737 // following text and '|' is the caret, when a user sends "RIGHT"
738 // cursor key, we'd like to commit the abcde and move the caret to right.
739 // So the user will get:
740 // XXXXabcdeY|YYYY
741 // Here, what we need is commiting the "abcde" with the appropriate
742 // caret position. (Note that we need to handle the left cursor key, too).
743 // Also, we should *NOT* consume the key, so that the key event will be
744 // handled appropriately by the target application.
745 COMMIT_WITHOUT_CONSUMING = 1;
746 }
747 optional CrossingEdgeBehavior crossing_edge_behavior = 13
748 [default = DO_NOTHING];
749
750 // Controls the behavior of language aware input. Language aware input
751 // guesses the actual language regardless the input mode. For example,
752 // if user type "てst" it will be treated as "test".
753 enum LanguageAwareInputBehavior {
754 // Performs the default behavior considering the platform and channel.
755 DEFAULT_LANGUAGE_AWARE_BEHAVIOR = 0;
756
757 // Does not perform this functionarity.
758 NO_LANGUAGE_AWARE_INPUT = 1;
759
760 // Adds a language aware candidate to the suggestion.
761 LANGUAGE_AWARE_SUGGESTION = 2;
762 }
763 optional LanguageAwareInputBehavior language_aware_input = 14
764 [default = DEFAULT_LANGUAGE_AWARE_BEHAVIOR];
765
766 // Page size of the candidate list.
767 optional int32 candidate_page_size = 15 [default = 9];
768 }
769
770 // Note there is another ApplicationInfo inside RendererCommand.
771 // Since Input is not using nested message, define ApplicationInfo here.
772 message ApplicationInfo {
773 optional uint32 process_id = 1;
774 optional uint32 thread_id = 2;
775 // The time difference between local time and UTC time in seconds.
776 // This field is not supported except for NaCl.
777 // We use this field in NaCl Mozc because we can't know the local timezone in
778 // NaCl environment.
779 optional int32 timezone_offset = 3;
780 };
781
782 message Input {
783 enum CommandType {
784 NONE = 0;
785 CREATE_SESSION = 1;
786 DELETE_SESSION = 2;
787 SEND_KEY = 3;
788
789 // Check only if the key event will be consumed. This command is
790 // for TSF on Windows. You do not need to use this command, if it
791 // is not necessary.
792 TEST_SEND_KEY = 4;
793
794 // Evaluate the command specified by SessionCommand. The output
795 // format should be the same with an output of a SEND_KEY command.
796 SEND_COMMAND = 5;
797
798 // Config accessors.
799 // There are three configurations.
800 // Stored config, Imposed config, One-shot config.
801 // Stored config : Set by SET_CONFIG command.
802 // Its lifetime is permanent (stored into a storage).
803 // GET_CONFIG returns stored config.
804 // Imposed config : Set by SET_IMPOSED_CONFIG. Its lifetime is the
805 // same as the process (*not* stored into a storage as opposed to Stored
806 // config).
807 // Imposed config is prioritized over Stored config.
808 // Only the values explicitly set are effective and override ones in Stored
809 // config. In typical usage, most fields are not set.
810 // GET_CONFIG's result is *not* affected by imposed config
811 // (stored config returns).
812 // One-shot config : Set by each key events.
813 // It is effective while the key event is processed.
814 // This is prioritized over Imposed config.
815 // Like as Imposed config, some fields can be omitted.
816 // TODO(matsuzakit): Rename (GET|SET)_CONFIG to (GET|SET)_STORED_CONFIG
817 GET_CONFIG = 6;
818 SET_CONFIG = 7;
819 SET_IMPOSED_CONFIG = 22;
820
821 // Set client's request
822 SET_REQUEST = 17;
823
824 // sync dictionary/history data to local file
825 SYNC_DATA = 8;
826
827 // shutdowon server safely
828 SHUTDOWN = 9;
829
830 // reload mutable data (like config, user-dic, history)
831 RELOAD = 10;
832
833 // clear user history data
834 CLEAR_USER_HISTORY = 11;
835
836 // clear user prediction data
837 CLEAR_USER_PREDICTION = 12;
838
839 // clear unused prediction
840 CLEAR_UNUSED_USER_PREDICTION = 16;
841
842 // clean up sessions
843 // shutdwon if session is empty and
844 // mozc_server is launched with timeout mode
845 CLEANUP = 13;
846
847 // no operation
848 // can be used for pinging the server
849 NO_OPERATION = 14;
850
851 // Sync feature is deprecated since 1.13 dev.
852 // TODO(mozc-team): Remove following variables.
853 OBSOLETE_START_CLOUD_SYNC = 18;
854 OBSOLETE_GET_CLOUD_SYNC_STATUS = 23;
855 OBSOLETE_ADD_AUTH_CODE = 24;
856
857 INSERT_TO_STORAGE = 20;
858 READ_ALL_FROM_STORAGE = 21;
859 CLEAR_STORAGE = 25;
860
861 // Send a command for user dictionary session.
862 SEND_USER_DICTIONARY_COMMAND = 26;
863
864 // Number of commands.
865 // When new command is added, the command should use below number
866 // and NUM_OF_COMMANDS should be incremented.
867 //
868 // Note: This enum lack the value for 15 and 19 and it may cause a crash.
869 // Please reuse these value if you can.
870 // 15 have never been used before, and 19 was used to clear synced
871 // data on dev channel.
872 NUM_OF_COMMANDS = 27;
873 };
874 required CommandType type = 1;
875
876 // Session ID created by CREATE_SESSION.
877 optional uint64 id = 2;
878
879 // Key combinations used for SEND_KEY or TEST_SEND_KEY.
880 optional KeyEvent key = 3;
881
882 // Command sent to the session layer used with SEND_COMMAND.
883 optional SessionCommand command = 4;
884
885 // Input config
886 optional mozc.config.Config config = 5;
887
888 // Context data
889 optional Context context = 6;
890
891 // Client capability
892 optional Capability capability = 7;
893
894 // Application information, like process id.
895 // Server may be able to change the behavior by seeing the
896 // the program name.
897 optional ApplicationInfo application_info = 8;
898
899 // Client request
900 optional Request request = 9;
901
902 // If the command is INSERT_TO_STORAGE, all the fields must be filled.
903 // If READ_ALL_FROM_STORAGE, key and value fields are ignored.
904 optional GenericStorageEntry storage_entry = 10;
905
906 enum TouchAction {
907 TOUCH_DOWN = 1;
908 TOUCH_MOVE = 2;
909 TOUCH_UP = 3;
910 };
911 message TouchPosition {
912 optional TouchAction action = 1;
913 // x, y potision: keyboad left-top is (0, 0), right-bottom is (1, 1).
914 optional float x = 2;
915 optional float y = 3;
916 // timestamp (in ms) is set to zero when the touch event starts.
917 optional int64 timestamp = 4;
918 }
919 // TouchEvent contains source_id and stroke.
920 // Touch_events contain all key touch event.
921 // Statistical information are collected for each source_id
922 // by SessionUsageObserver.
923 message TouchEvent {
924 // source_id specifies the user action such as "X button pressed".
925 // It must be unique within the same keyboard_name,
926 // which is set in Request message.
927 optional uint32 source_id = 1;
928 repeated TouchPosition stroke = 2;
929 }
930 repeated TouchEvent touch_events = 12;
931
932 optional mozc.user_dictionary.UserDictionaryCommand user_dictionary_command
933 = 13;
934
935 // A flag to control if the server should return suggest-results or not.
936 // If this is set to false, regardless of other configurations,
937 // the server won't return suggestion results.
938 // This is set to true by default.
939 // Note that even if this flag is set to false, when a suggestion is shown
940 // in the previous phase, it is possible from the client to submit it.
941 // This works only for suggestions for the key insersion, but not for
942 // others commands, such as predictions or conversions.
943 // This flag is used for the performance improvement in terms of the
944 // latency. If you want to suppress the suggestions for the UX improment,
945 // you may want to use suppress_suggestion in the Context message.
946 optional bool request_suggestion = 14 [default = true];
947 };
948
949
950 // Result contains data to be submitted to the host application by the
951 // ime client.
952 message Result {
953 enum ResultType {
954 NONE = 0;
955 STRING = 1;
956 };
957 required ResultType type = 1;
958 // The result of conversion.
959 required string value = 2;
960
961 // Source of the value. It is almost always the reading of the value.
962 optional string key = 3;
963
964 // The caret position after the result submission.
965 // "0" means the end of the result, and a positive value means moving forward
966 // and a negative value backward.
967 // e.g.) "-s", where s is the length of value, means the caret position
968 // after the committing should be the beginning of the committed value.
969 optional int32 cursor_offset = 4 [default = 0];
970 };
971
972
973 // Preedit represents a composition data, which is rendered on the
974 // host application by the ime client. On Japanese IME, the both
975 // Preedit and Conversion statuses are represented by this message.
976 message Preedit {
977 required uint32 cursor = 1;
978 // The string data of Preedit is separated into Segment messages
979 // presenting the ime server's status. On Preedit status of
980 // Japanese IME, there are up to three segments; left side chars of
981 // cursor, forcused char, right side chars of cursor. On Conversion
982 // status of Japanese IME, the messages literally represent the
983 // segments of the conversion.
984 repeated group Segment = 2 {
985 enum Annotation {
986 NONE = 0;
987 UNDERLINE = 1;
988 HIGHLIGHT = 2;
989 };
990 required Annotation annotation = 3;
991 required string value = 4;
992
993 // The length of value in characters. This is NOT a number in
994 // bytes or logical character units. So, the length of "abc" and
995 // "あいう" should be 3, "ヴ" should be 1 and "ヴ" and "う゛"
996 // should be 2.
997 required uint32 value_length = 5;
998
999 // Source of the value. It is almost always the reading of the value.
1000 optional string key = 6;
1001 };
1002
1003 // The position of the first segment whose annotation is 'HIGHLIGHT'. Not set
1004 // if there are no such segments.
1005 optional uint32 highlighted_position = 3;
1006 };
1007
1008
1009 message Status {
1010 // Whether IME is ON or OFF
1011 optional bool activated = 1;
1012
1013 // Visible composition mode when IME is activated. This mode may come from a
1014 // temporary composition mode. See |comeback_mode|.
1015 // TODO(yukawa): Rename this field to "visible_mode".
1016 optional CompositionMode mode = 2;
1017
1018 // True composition mode that is suitable for system global and permanent
1019 // composition mode. When a temporary composition mode exists,
1020 // |comeback_mode| can be different from |mode|.
1021 // TODO(yukawa): Use more appropriate name.
1022 optional CompositionMode comeback_mode = 3;
1023 };
1024
1025 // This messsage contains which characters are to be deleted by client.
1026 // E.g. if current composition and surrounding text are
1027 // "この感じは漢字は"
1028 // ^^^^^^
1029 // and we send DeletionRange with offset == -3 and length == 3, then they will
1030 // be rendered like:
1031 // "この漢字は"
1032 // ^^^^^^
1033 message DeletionRange {
1034 // Offset of start of range.
1035 optional int32 offset = 1;
1036
1037 // Length of the range.
1038 optional int32 length = 2;
1039 };
1040
1041 message Output {
1042 optional uint64 id = 1;
1043
1044 // This variable is going to be obsolete.
1045 optional CompositionMode mode = 2;
1046
1047 optional bool consumed = 3;
1048 optional Result result = 4;
1049 optional Preedit preedit = 5;
1050 optional Candidates candidates = 6;
1051 optional KeyEvent key = 7;
1052
1053 // when URL is non empty, UI can open the page with a browser,
1054 // after finishing the all rendering part.
1055 // We are using this feature for bug-report system.
1056 optional string url = 8;
1057
1058 // Output config
1059 optional mozc.config.Config config = 9;
1060
1061 // PreeditMethod: this is the default input mode of the session.
1062 // If the user's config is "kana-input", it returns KANA. Only
1063 // CreateSession response will have this field.
1064 enum PreeditMethod {
1065 ASCII = 0;
1066 KANA = 1;
1067 };
1068 optional PreeditMethod preedit_method = 10 [default = ASCII];
1069
1070 // ErrorCode:
1071 // if SessionHandler::EvalCommand() returns false,
1072 // return output with error_code = SESSION_FAILURE;
1073 enum ErrorCode {
1074 SESSION_SUCCESS = 0;
1075 SESSION_FAILURE = 1;
1076 };
1077 optional ErrorCode error_code = 11 [ default = SESSION_SUCCESS ];
1078
1079 // The current IME status.
1080 optional Status status = 13;
1081
1082 // All flatten candidate words stored in 1D array. This value is
1083 // filled only when the content is changed.
1084 optional CandidateList all_candidate_words = 14;
1085
1086 // Range of characters to be deleted by client.
1087 optional DeletionRange deletion_range = 16;
1088
1089 // if launch_tool_mode is set, MozcTool is supposed to be launched
1090 // by client.
1091 enum ToolMode {
1092 NO_TOOL = 0; // no need to launch tool
1093 CONFIG_DIALOG = 1;
1094 DICTIONARY_TOOL = 2;
1095 WORD_REGISTER_DIALOG = 3;
1096 };
1097 optional ToolMode launch_tool_mode = 17 [ default = NO_TOOL ];
1098
1099 // Callback request to the client.
1100 message Callback {
1101 // Callback command to be sent from the client to the server. The
1102 // optional values such as id and composition_mode can be modified
1103 // or added by the client.
1104 optional SessionCommand session_command = 1;
1105
1106 // Callback command should be sent after this delay.
1107 optional uint32 delay_millisec = 2;
1108 };
1109 optional Callback callback = 18;
1110
1111 // Used when the command is READ_ALL_FROM_STORAGE.
1112 optional GenericStorageEntry storage_entry = 19;
1113
1114 optional mozc.user_dictionary.UserDictionaryCommandStatus
1115 user_dictionary_command_status = 21;
1116 };
1117
1118 message Command {
1119 required Input input = 1;
1120 required Output output = 2;
1121 };
1122
1123 message CommandList {
1124 // This message is used for unittest.
1125 repeated Command commands = 1;
1126 };
3131
3232 #include "base/port.h"
3333 #include "base/scoped_ptr.h"
34 #include "session/commands.pb.h"
34 #include "protocol/commands.pb.h"
3535
3636 namespace mozc {
3737
3333 #include "base/system_util.h"
3434 #include "config/config.pb.h"
3535 #include "config/config_handler.h"
36 #include "session/commands.pb.h"
36 #include "protocol/commands.pb.h"
3737 #include "session/internal/keymap.h"
3838 #include "session/key_parser.h"
3939 #include "testing/base/public/googletest.h"
3434
3535 #include "base/port.h"
3636 #include "base/scoped_ptr.h"
37 #include "session/commands.pb.h"
37 #include "protocol/commands.pb.h"
3838
3939 namespace mozc {
4040
3636 #include "converter/converter_interface.h"
3737 #include "converter/converter_mock.h"
3838 #include "engine/mock_converter_engine.h"
39 #include "session/commands.pb.h"
39 #include "protocol/commands.pb.h"
4040 #include "session/session_converter.h"
4141 #include "testing/base/public/googletest.h"
4242 #include "testing/base/public/gunit.h"
3636 #include "base/util.h"
3737 #include "config/config.pb.h"
3838 #include "config/config_handler.h"
39 #include "session/commands.pb.h"
39 #include "protocol/commands.pb.h"
4040 #include "session/key_event_util.h"
4141
4242 namespace mozc {
3838 #include "base/port.h"
3939 #include "base/singleton.h"
4040 #include "config/config.pb.h"
41 #include "session/commands.pb.h"
41 #include "protocol/commands.pb.h"
4242
4343 namespace mozc {
4444 namespace session {
3131 #include "base/port.h"
3232 #include "base/singleton.h"
3333 #include "config/config.pb.h"
34 #include "session/commands.pb.h"
34 #include "protocol/commands.pb.h"
3535
3636 #include "testing/base/public/gunit.h"
3737
4343 #include "base/util.h"
4444 #include "config/config.pb.h"
4545 #include "config/config_handler.h"
46 #include "session/commands.pb.h"
46 #include "protocol/commands.pb.h"
4747 #include "session/internal/keymap-inl.h"
4848 #include "session/key_event_util.h"
4949 #include "session/key_parser.h"
3232
3333 #include "config/config.pb.h"
3434 #include "config/config_handler.h"
35 #include "session/commands.pb.h"
35 #include "protocol/commands.pb.h"
3636 #include "session/internal/keymap.h"
3737 #include "session/key_parser.h"
3838 #include "testing/base/public/gunit.h"
3535 #include "base/system_util.h"
3636 #include "config/config.pb.h"
3737 #include "config/config_handler.h"
38 #include "session/commands.pb.h"
38 #include "protocol/commands.pb.h"
3939 #include "session/internal/keymap.h"
4040 #include "session/internal/keymap-inl.h"
4141 #include "session/internal/keymap_factory.h"
3434 #include <string>
3535
3636 #include "base/port.h"
37 #include "session/commands.pb.h"
37 #include "protocol/commands.pb.h"
3838
3939 namespace mozc {
4040
3434 #include "base/text_normalizer.h"
3535 #include "base/util.h"
3636 #include "converter/segments.h"
37 #include "session/commands.pb.h"
37 #include "protocol/commands.pb.h"
3838 #include "session/internal/candidate_list.h"
3939 #include "testing/base/public/gunit.h"
4040
3232
3333 #include "base/logging.h"
3434 #include "base/port.h"
35 #include "session/commands.pb.h"
35 #include "protocol/commands.pb.h"
3636
3737 namespace mozc {
3838 using commands::KeyEvent;
3030
3131 #include "base/number_util.h"
3232 #include "base/util.h"
33 #include "session/commands.pb.h"
33 #include "protocol/commands.pb.h"
3434 #include "session/key_parser.h"
3535 #include "testing/base/public/gunit.h"
3636
3939 #include "base/util.h"
4040 #include "config/config.pb.h"
4141 #include "config/config_handler.h"
42 #include "session/commands.pb.h"
42 #include "protocol/commands.pb.h"
4343 #include "session/internal/keymap.h"
4444 #include "session/key_parser.h"
4545
3030
3131 #include "config/config.pb.h"
3232 #include "config/config_handler.h"
33 #include "session/commands.pb.h"
33 #include "protocol/commands.pb.h"
3434 #include "session/key_parser.h"
3535 #include "testing/base/public/googletest.h"
3636 #include "testing/base/public/gunit.h"
3939 #include "base/port.h"
4040 #include "base/singleton.h"
4141 #include "base/util.h"
42 #include "session/commands.pb.h"
42 #include "protocol/commands.pb.h"
4343
4444 namespace mozc {
4545 using commands::KeyEvent;
3232 #include <utility>
3333
3434 #include "base/port.h"
35 #include "session/commands.pb.h"
35 #include "protocol/commands.pb.h"
3636 #include "session/key_event_util.h"
3737 #include "testing/base/public/gunit.h"
3838
3030
3131 #include "base/logging.h"
3232 #include "base/port.h"
33 #include "session/commands.pb.h"
33 #include "protocol/commands.pb.h"
3434
3535 namespace mozc {
3636
2929 #include "session/output_util.h"
3030
3131 #include "base/port.h"
32 #include "session/commands.pb.h"
32 #include "protocol/commands.pb.h"
3333 #include "testing/base/public/googletest.h"
3434 #include "testing/base/public/gunit.h"
3535
3535 #include "base/mutex.h"
3636 #include "base/port.h"
3737 #include "base/util.h"
38 #include "session/commands.pb.h"
38 #include "protocol/commands.pb.h"
3939
4040 namespace mozc {
4141 namespace session {
3131
3232 #include <vector>
3333 #include "base/port.h"
34 #include "session/commands.pb.h"
34 #include "protocol/commands.pb.h"
3535
3636 namespace mozc {
3737 namespace session {
3131 #include <string>
3232 #include <vector>
3333
34 #include "session/commands.pb.h"
34 #include "protocol/commands.pb.h"
3535 #include "testing/base/public/gunit.h"
3636
3737 namespace mozc {
3030
3131 #include "session/request_test_util.h"
3232
33 #include "session/commands.pb.h"
33 #include "protocol/commands.pb.h"
3434
3535 namespace mozc {
3636 namespace commands {
2626 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2727 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828
29 #include "session/commands.pb.h"
29 #include "protocol/commands.pb.h"
3030 #include "session/request_test_util.h"
3131 #include "testing/base/public/gunit.h"
3232
4646 #include "config/config_handler.h"
4747 #include "engine/engine_interface.h"
4848 #include "engine/user_data_manager_interface.h"
49 #include "session/commands.pb.h"
49 #include "protocol/commands.pb.h"
5050 #include "session/internal/ime_context.h"
5151 #include "session/internal/key_event_transformer.h"
5252 #include "session/internal/keymap-inl.h"
4444 '../config/config.gyp:config_handler',
4545 '../config/config.gyp:config_protocol',
4646 '../converter/converter_base.gyp:converter_util',
47 '../protocol/protocol.gyp:commands_proto',
4748 '../transliteration/transliteration.gyp:transliteration',
4849 '../usage_stats/usage_stats_base.gyp:usage_stats',
4950 'session_base.gyp:key_parser',
5051 'session_base.gyp:keymap',
5152 'session_base.gyp:keymap_factory',
52 'session_base.gyp:session_protocol',
5353 'session_base.gyp:session_usage_stats_util',
5454 'session_internal',
5555 ],
6969 '../composer/composer.gyp:composer',
7070 '../config/config.gyp:config_handler',
7171 '../config/config.gyp:config_protocol',
72 'session_base.gyp:session_protocol',
72 '../protocol/protocol.gyp:commands_proto',
7373 ],
7474 },
7575 {
9090 '../dictionary/dictionary_base.gyp:user_dictionary',
9191 '../usage_stats/usage_stats_base.gyp:usage_stats',
9292 'session_base.gyp:generic_storage_manager',
93 'session_base.gyp:session_protocol',
93 '../protocol/protocol.gyp:commands_proto',
9494 ],
9595 'conditions': [
9696 ['(target_platform=="NaCl" and _toolset=="target") or target_platform=="Android"', {
115115 '../config/config.gyp:stats_config_util',
116116 '../usage_stats/usage_stats_base.gyp:usage_stats',
117117 '../usage_stats/usage_stats_base.gyp:usage_stats_protocol',
118 'session_base.gyp:session_protocol',
118 'session_base.gyp:state_proto',
119119 ],
120120 },
121121 {
130130 # dependency list you will have to update Android's.
131131 '../base/base.gyp:base',
132132 '../usage_stats/usage_stats.gyp:usage_stats_uploader',
133 'session_base.gyp:session_protocol',
133 '../protocol/protocol.gyp:commands_proto',
134134 'session_handler',
135135 'session_usage_observer',
136136 ],
144144 ],
145145 'dependencies': [
146146 '../config/config.gyp:config_protocol',
147 '../protocol/protocol.gyp:commands_proto',
147148 'gen_session_stress_test_data#host',
148149 'session',
149 'session_base.gyp:session_protocol',
150150 ],
151151 },
152152 {
4343 ],
4444 'dependencies': [
4545 '../config/config.gyp:config_protocol',
46 'session_protocol',
46 '../protocol/protocol.gyp:commands_proto',
4747 ],
4848 },
4949 {
5555 'dependencies': [
5656 '../base/base.gyp:base',
5757 '../config/config.gyp:config_protocol',
58 'session_protocol',
58 '../protocol/protocol.gyp:commands_proto',
5959 ],
6060 },
6161 {
6868 '../base/base.gyp:base',
6969 '../config/config.gyp:config_handler',
7070 '../config/config.gyp:config_protocol',
71 '../protocol/protocol.gyp:commands_proto',
7172 'key_event_util',
7273 'key_parser',
73 'session_protocol',
7474 ],
7575 },
7676 {
8282 'dependencies': [
8383 '../base/base.gyp:base',
8484 '../config/config.gyp:config_protocol',
85 '../protocol/protocol.gyp:commands_proto',
8586 'keymap',
86 'session_protocol',
8787 ],
8888 },
8989 {
9696 '../base/base.gyp:base',
9797 '../config/config.gyp:config_handler',
9898 '../config/config.gyp:config_protocol',
99 '../protocol/protocol.gyp:commands_proto',
99100 'key_info_util',
100 'session_protocol',
101101 ],
102102 },
103103 {
108108 ],
109109 'dependencies': [
110110 '../base/base.gyp:base',
111 'session_protocol',
111 '../protocol/protocol.gyp:commands_proto',
112112 ],
113113 },
114114 {
122122 '../base/base.gyp:config_file_stream',
123123 '../config/config.gyp:config_handler',
124124 '../config/config.gyp:config_protocol',
125 '../protocol/protocol.gyp:commands_proto',
125126 'key_event_util',
126127 'key_parser',
127128 'keymap',
128 'session_protocol',
129129 ],
130130 },
131131 {
136136 ],
137137 'dependencies': [
138138 '../base/base.gyp:base',
139 'session_protocol',
139 '../protocol/protocol.gyp:commands_proto',
140140 ],
141141 },
142142 {
148148 'dependencies': [
149149 '../base/base.gyp:base',
150150 '../protobuf/protobuf.gyp:protobuf',
151 '../protocol/protocol.gyp:commands_proto',
151152 '../usage_stats/usage_stats_base.gyp:usage_stats',
152 'session_protocol',
153153 ],
154154 },
155155 {
161161 'dependencies': [
162162 '../base/base.gyp:base',
163163 '../base/base.gyp:config_file_stream',
164 '../protocol/protocol.gyp:commands_proto',
164165 '../storage/storage.gyp:storage',
165 'session_protocol',
166166 ]
167167 },
168168 {
169 'target_name': 'genproto_session',
169 'target_name': 'genproto_state_proto',
170170 'type': 'none',
171171 'toolsets': ['host'],
172172 'sources': [
173 'candidates.proto',
174 'commands.proto',
175173 'state.proto',
176174 ],
177175 'includes': [
178176 '../protobuf/genproto.gypi',
179177 ],
180178 'dependencies': [
181 '../config/config.gyp:genproto_config',
182 '../dictionary/dictionary_base.gyp:genproto_dictionary',
183 ],
184 },
185 {
186 'target_name': 'session_protocol',
179 '../protocol/protocol.gyp:genproto_candidates_proto',
180 '../protocol/protocol.gyp:genproto_commands_proto',
181 ],
182 },
183 {
184 'target_name': 'state_proto',
187185 'type': 'static_library',
188186 'hard_dependency': 1,
189187 'sources': [
190 '<(proto_out_dir)/<(relative_dir)/candidates.pb.cc',
191 '<(proto_out_dir)/<(relative_dir)/commands.pb.cc',
192188 '<(proto_out_dir)/<(relative_dir)/state.pb.cc',
193189 ],
194190 'dependencies': [
195 '../config/config.gyp:config_protocol',
196191 '../protobuf/protobuf.gyp:protobuf',
197 '../dictionary/dictionary_base.gyp:dictionary_protocol',
198 'genproto_session#host',
192 '../protocol/protocol.gyp:candidates_proto',
193 '../protocol/protocol.gyp:commands_proto',
194 'genproto_state_proto#host',
199195 ],
200196 'export_dependent_settings': [
201 'genproto_session#host',
197 'genproto_state_proto#host',
202198 ],
203199 },
204200 ],
3838 #include "base/util.h"
3939 #include "engine/engine_factory.h"
4040 #include "engine/engine_interface.h"
41 #include "session/commands.pb.h"
41 #include "protocol/commands.pb.h"
4242 #include "session/key_parser.h"
4343 #include "session/session.h"
4444
4444 #include "converter/converter_interface.h"
4545 #include "converter/converter_util.h"
4646 #include "converter/segments.h"
47 #include "session/commands.pb.h"
47 #include "protocol/commands.pb.h"
4848 #include "session/internal/candidate_list.h"
4949 #include "session/internal/session_output.h"
5050 #include "session/session_usage_stats_util.h"
3939 #include "config/config_handler.h"
4040 #include "engine/engine_interface.h"
4141 #include "engine/mock_data_engine_factory.h"
42 #include "session/commands.pb.h"
42 #include "protocol/commands.pb.h"
4343 #include "testing/base/public/googletest.h"
4444 #include "testing/base/public/gunit.h"
4545
4848 #include "config/config_handler.h"
4949 #include "converter/converter_mock.h"
5050 #include "converter/segments.h"
51 #include "session/candidates.pb.h"
52 #include "session/commands.pb.h"
51 #include "protocol/candidates.pb.h"
52 #include "protocol/commands.pb.h"
5353 #include "session/internal/candidate_list.h"
5454 #include "session/internal/keymap.h"
5555 #include "session/request_test_util.h"
4949 #include "dictionary/user_dictionary_storage.pb.h"
5050 #include "engine/engine_interface.h"
5151 #include "engine/user_data_manager_interface.h"
52 #include "session/commands.pb.h"
52 #include "protocol/commands.pb.h"
5353 #include "session/generic_storage_manager.h"
5454 #include "session/session.h"
5555 #include "session/session_observer_handler.h"
4040 #include "converter/converter_interface.h"
4141 #include "engine/mock_data_engine_factory.h"
4242 #include "engine/user_data_manager_interface.h"
43 #include "session/commands.pb.h"
43 #include "protocol/commands.pb.h"
4444 #include "session/key_parser.h"
4545 #include "session/request_test_util.h"
4646 #include "session/session_handler_test_util.h"
3636 #include "base/port.h"
3737 #include "base/scoped_ptr.h"
3838 #include "engine/engine_factory.h"
39 #include "session/commands.pb.h"
39 #include "protocol/commands.pb.h"
4040 #include "session/random_keyevents_generator.h"
4141 #include "session/session_handler_test_util.h"
4242 #include "testing/base/public/gunit.h"
3939 #include "engine/mock_converter_engine.h"
4040 #include "engine/mock_data_engine_factory.h"
4141 #include "engine/user_data_manager_mock.h"
42 #include "session/commands.pb.h"
42 #include "protocol/commands.pb.h"
4343 #include "session/generic_storage_manager.h"
4444 #include "session/session_handler.h"
4545 #include "session/session_handler_test_util.h"
3636 #include "converter/converter_interface.h"
3737 #include "engine/engine_interface.h"
3838 #include "prediction/user_history_predictor.h"
39 #include "session/commands.pb.h"
39 #include "protocol/commands.pb.h"
4040 #include "session/session_handler.h"
4141 #include "session/session_handler_interface.h"
4242 #include "session/session_usage_observer.h"
3535 #include "base/port.h"
3636 #include "base/scoped_ptr.h"
3737 #include "config/config.pb.h"
38 #include "session/commands.pb.h"
38 #include "protocol/commands.pb.h"
3939 #include "testing/base/public/gunit.h"
4040 #include "usage_stats/usage_stats_testing_util.h"
4141
2626 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2727 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828
29 #include "session/commands.pb.h"
29 #include "protocol/commands.pb.h"
3030 #include "session/session_observer_handler.h"
3131 #include "session/session_observer_interface.h"
3232 #include "testing/base/public/gunit.h"
4141 #include "converter/segments.h"
4242 #include "engine/engine_factory.h"
4343 #include "rewriter/rewriter_interface.h"
44 #include "session/commands.pb.h"
44 #include "protocol/candidates.pb.h"
45 #include "protocol/commands.pb.h"
4546 #include "session/internal/ime_context.h"
4647 #include "session/internal/keymap.h"
4748 #include "session/key_parser.h"
48 #include "session/candidates.pb.h"
4949 #include "session/session.h"
5050 #include "session/session_converter_interface.h"
5151 #include "session/session_handler.h"
3838 #include "engine/engine_factory.h"
3939 #include "ipc/ipc.h"
4040 #include "ipc/named_event.h"
41 #include "session/commands.pb.h"
41 #include "protocol/commands.pb.h"
4242 #include "session/session_handler.h"
4343 #include "session/session_usage_observer.h"
4444 #include "usage_stats/usage_stats_uploader.h"
2929 // Mocked Session Server runner used just for testing.
3030 #include <stdio.h>
3131
32 #include "protocol/commands.pb.h"
3233 #include "session/session_server.h"
33 #include "session/commands.pb.h"
3434
3535 static const int kMaxBufSize = 1024;
3636
4545 #include "engine/engine_interface.h"
4646 #include "engine/mock_converter_engine.h"
4747 #include "engine/mock_data_engine_factory.h"
48 #include "protocol/candidates.pb.h"
49 #include "protocol/commands.pb.h"
4850 #include "rewriter/transliteration_rewriter.h"
49 #include "session/candidates.pb.h"
50 #include "session/commands.pb.h"
5151 #include "session/internal/ime_context.h"
5252 #include "session/internal/keymap.h"
5353 #include "session/key_parser.h"
4444 '../config/config.gyp:config_protocol',
4545 '../engine/engine.gyp:engine_factory',
4646 '../engine/engine.gyp:mock_data_engine_factory',
47 '../protocol/protocol.gyp:commands_proto',
4748 '../testing/testing.gyp:testing',
4849 '../usage_stats/usage_stats_test.gyp:usage_stats_testing_util',
4950 'session.gyp:session',
5051 'session.gyp:session_handler',
5152 'session.gyp:session_usage_observer',
52 'session_base.gyp:session_protocol',
5353 ],
5454 },
5555 {
160160 '../client/client.gyp:client_mock',
161161 '../config/config.gyp:config_handler',
162162 '../config/config.gyp:stats_config_util',
163 '../protocol/protocol.gyp:commands_proto',
163164 '../testing/testing.gyp:gtest_main',
164165 '../usage_stats/usage_stats_base.gyp:usage_stats',
165166 '../usage_stats/usage_stats_test.gyp:usage_stats_testing_util',
168169 'session_base.gyp:keymap',
169170 'session_base.gyp:keymap_factory',
170171 'session_base.gyp:output_util',
171 'session_base.gyp:session_protocol',
172172 'session_base.gyp:session_usage_stats_util',
173173 ],
174174 'conditions': [
194194 'dependencies': [
195195 '../base/base.gyp:base',
196196 '../config/config.gyp:config_handler',
197 '../protocol/protocol.gyp:commands_proto',
197198 '../testing/testing.gyp:gtest_main',
198199 'session_base.gyp:ime_switch_util',
199200 'session_base.gyp:key_event_util',
200201 'session_base.gyp:key_parser',
201 'session_base.gyp:session_protocol',
202202 ],
203203 'variables': {
204204 'test_size': 'small',
223223 '../testing/testing.gyp:gtest_main',
224224 '../testing/testing.gyp:testing_util',
225225 'session.gyp:session',
226 'session_base.gyp:session_protocol',
226 '../protocol/protocol.gyp:commands_proto',
227227 ],
228228 'variables': {
229229 'test_size': 'small',
254254 'random_keyevents_generator_test.cc',
255255 ],
256256 'dependencies': [
257 '../protocol/protocol.gyp:commands_proto',
257258 '../testing/testing.gyp:gtest_main',
258259 'session.gyp:random_keyevents_generator',
259 'session_base.gyp:session_protocol',
260260 ],
261261 'variables': {
262262 'test_size': 'large',
317317 '../base/base.gyp:base',
318318 '../data/test/session/scenario/scenario.gyp:install_session_handler_scenario_test_data',
319319 '../data/test/session/scenario/usage_stats/usage_stats.gyp:install_session_handler_usage_stats_scenario_test_data',
320 '../protocol/protocol.gyp:commands_proto',
320321 '../testing/testing.gyp:gtest_main',
321322 '../usage_stats/usage_stats_test.gyp:usage_stats_testing_util',
322323 'session.gyp:session_handler',
323324 'session_base.gyp:request_test_util',
324 'session_base.gyp:session_protocol',
325325 'session_handler_test_util',
326326 ],
327327 'variables': {
4141 #include "base/singleton.h"
4242 #include "base/util.h"
4343 #include "config/stats_config_util.h"
44 #include "session/commands.pb.h"
44 #include "protocol/commands.pb.h"
4545 #include "session/state.pb.h"
4646 #include "usage_stats/usage_stats.h"
4747 #include "usage_stats/usage_stats.pb.h"
3838 #include "base/util.h"
3939 #include "config/stats_config_util.h"
4040 #include "config/stats_config_util_mock.h"
41 #include "session/commands.pb.h"
41 #include "protocol/commands.pb.h"
4242 #include "testing/base/public/googletest.h"
4343 #include "testing/base/public/gunit.h"
4444 #include "usage_stats/usage_stats.h"
3535 #include "base/protobuf/descriptor.h"
3636 #include "base/protobuf/message.h"
3737 #include "base/util.h"
38 #include "session/commands.pb.h"
38 #include "protocol/commands.pb.h"
3939 #include "usage_stats/usage_stats.h"
4040
4141 using mozc::commands::Command;
2828
2929 #include "session/session_usage_stats_util.h"
3030
31 #include "session/commands.pb.h"
31 #include "protocol/commands.pb.h"
3232 #include "session/key_parser.h"
3333 #include "testing/base/public/gunit.h"
3434 #include "usage_stats/usage_stats.h"
3636 #include "base/mutex.h"
3737 #include "base/util.h"
3838 #include "client/client_mock.h"
39 #include "session/commands.pb.h"
39 #include "protocol/commands.pb.h"
4040 #include "testing/base/public/gunit.h"
4141 #include "testing/base/public/googletest.h"
4242
2929 // Protocol messages for session state
3030 syntax = "proto2";
3131
32 import "session/candidates.proto";
33 import "session/commands.proto";
32 import "protocol/candidates.proto";
33 import "protocol/commands.proto";
3434
3535 package mozc.session;
3636
4242 '../../config/config.gyp:config_handler',
4343 '../../config/config.gyp:config_protocol',
4444 '../../ipc/ipc.gyp:ipc',
45 '../../session/session_base.gyp:session_protocol',
45 '../../protocol/protocol.gyp:commands_proto',
4646 'mozc_emacs_helper_lib',
4747 ],
4848 },
5757 '../../base/base.gyp:base',
5858 '../../client/client.gyp:client',
5959 '../../config/config.gyp:config_protocol',
60 '../../protocol/protocol.gyp:commands_proto',
6061 '../../session/session_base.gyp:key_parser',
61 '../../session/session_base.gyp:session_protocol',
6262 '../../storage/storage.gyp:storage',
6363 ],
6464 },
3838 #include "base/version.h"
3939 #include "client/client.h"
4040 #include "config/config_handler.h"
41 #include "session/commands.pb.h"
41 #include "protocol/commands.pb.h"
4242 #include "unix/emacs/client_pool.h"
4343
4444 DEFINE_bool(suppress_stderr, false,
3838 #include "base/port.h"
3939 #include "base/protobuf/descriptor.h"
4040 #include "base/util.h"
41 #include "session/commands.pb.h"
41 #include "protocol/commands.pb.h"
4242 #include "session/key_parser.h"
4343
4444 namespace mozc {
3232
3333 #include "base/protobuf/message.h"
3434 #include "base/util.h"
35 #include "session/commands.pb.h"
35 #include "protocol/commands.pb.h"
3636 #include "testing/base/public/googletest.h"
3737 #include "testing/base/public/gunit.h"
3838
9797 ],
9898 'dependencies': [
9999 '../../base/base.gyp:base',
100 '../../session/session_base.gyp:session_protocol',
100 '../../protocol/protocol.gyp:commands_proto',
101101 'ibus_build_environment',
102102 ],
103103 },
108108 'property_handler.cc',
109109 ],
110110 'dependencies': [
111 '../../session/session_base.gyp:session_protocol',
111 '../../protocol/protocol.gyp:commands_proto',
112112 'ibus_build_environment',
113113 'message_translator',
114114 'path_util',
148148 ],
149149 'dependencies': [
150150 '../../client/client.gyp:client',
151 '../../protocol/protocol.gyp:commands_proto',
151152 '../../session/session_base.gyp:ime_switch_util',
152 '../../session/session_base.gyp:session_protocol',
153153 'ibus_property_handler',
154154 'message_translator',
155155 'path_util',
216216 '../../base/base.gyp:base',
217217 '../../client/client.gyp:client',
218218 '../../client/client.gyp:client_mock',
219 '../../protocol/protocol.gyp:commands_proto',
219220 '../../session/session_base.gyp:key_event_util',
220 '../../session/session_base.gyp:session_protocol',
221221 '../../testing/testing.gyp:gtest_main',
222222 'ibus_mozc_lib',
223223 'ibus_mozc_metadata',
3232 #include <cstdlib>
3333
3434 #include "base/logging.h"
35 #include "session/commands.pb.h"
35 #include "protocol/commands.pb.h"
3636 #include "unix/ibus/mozc_engine_property.h"
3737
3838 namespace mozc {
3434
3535 #include "base/port.h"
3636 #include "config/config.pb.h"
37 #include "session/commands.pb.h"
37 #include "protocol/commands.pb.h"
3838 #include "unix/ibus/key_translator.h"
3939
4040 namespace mozc {
3434 #include "base/port.h"
3535 #include "base/util.h"
3636 #include "config/config.pb.h"
37 #include "session/commands.pb.h"
37 #include "protocol/commands.pb.h"
3838 #include "session/key_event_util.h"
3939 #include "testing/base/public/gunit.h"
4040
3232 #include <map>
3333
3434 #include "base/port.h"
35 #include "session/commands.pb.h"
35 #include "protocol/commands.pb.h"
3636 #include "unix/ibus/ibus_header.h"
3737
3838 namespace mozc {
3131 #include <memory>
3232 #include <set>
3333
34 #include "session/commands.pb.h"
34 #include "protocol/commands.pb.h"
3535 #include "testing/base/public/gunit.h"
3636
3737 namespace mozc {
4646 #include "base/util.h"
4747 #include "client/client.h"
4848 #include "config/config.pb.h"
49 #include "session/commands.pb.h"
49 #include "protocol/commands.pb.h"
5050 #include "session/ime_switch_util.h"
5151 #include "unix/ibus/engine_registrar.h"
5252 #include "unix/ibus/ibus_candidate_window_handler.h"
3434 #include <vector>
3535
3636 #include "base/port.h"
37 #include "session/commands.pb.h"
37 #include "protocol/commands.pb.h"
3838 #include "testing/base/public/gunit_prod.h"
3939 #include "unix/ibus/engine_interface.h"
4040
2929 #include "unix/ibus/mozc_engine_property.h"
3030
3131 #include "base/port.h"
32 #include "session/commands.pb.h"
32 #include "protocol/commands.pb.h"
3333
3434 namespace mozc {
3535 namespace ibus {
2929 #ifndef MOZC_UNIX_IBUS_MOZC_ENGINE_PROPERTY_H_
3030 #define MOZC_UNIX_IBUS_MOZC_ENGINE_PROPERTY_H_
3131
32 #include "session/commands.pb.h"
32 #include "protocol/commands.pb.h"
3333
3434 namespace mozc {
3535 namespace ibus {
3232
3333 #include "base/port.h"
3434 #include "client/client_mock.h"
35 #include "session/commands.pb.h"
35 #include "protocol/commands.pb.h"
3636 #include "testing/base/public/gunit.h"
3737
3838 using std::unique_ptr;
3131 #include <string>
3232
3333 #include "base/logging.h"
34 #include "session/commands.pb.h"
34 #include "protocol/commands.pb.h"
3535
3636 namespace mozc {
3737 namespace ibus {
3131
3232 #include "base/port.h"
3333 // TODO(nona): remove this header.
34 #include "session/commands.pb.h" // For CompositionMode
34 #include "protocol/commands.pb.h" // For CompositionMode
3535
3636 namespace mozc {
3737 namespace ibus {
3636 #include "base/util.h"
3737 #include "config/config.pb.h"
3838 #include "config/config_handler.h"
39 #include "session/commands.pb.h"
39 #include "protocol/commands.pb.h"
4040 #include "testing/base/public/gunit.h"
4141 #include "usage_stats/usage_stats.h"
4242 #include "usage_stats/usage_stats_testing_util.h"
3434 #include <Windows.h> // for DWORD
3535
3636 #include "base/port.h"
37 #include "session/commands.pb.h"
37 #include "protocol/commands.pb.h"
3838
3939 namespace mozc {
4040 namespace win32 {
3131 #include <imm.h>
3232 #endif // OS_WIN
3333
34 #include "session/commands.pb.h"
34 #include "protocol/commands.pb.h"
3535 #include "testing/base/public/googletest.h"
3636 #include "testing/base/public/gunit.h"
3737 #include "win32/base/conversion_mode_util.h"
3232 #include <vector>
3333
3434 #include "base/logging.h"
35 #include "session/commands.pb.h"
35 #include "protocol/commands.pb.h"
3636 #include "win32/base/input_state.h"
3737 #include "win32/base/keyboard.h"
3838
2929 #include "testing/base/public/googletest.h"
3030 #include "testing/base/public/gunit.h"
3131
32 #include "session/commands.pb.h"
32 #include "protocol/commands.pb.h"
3333 #include "win32/base/deleter.h"
3434 #include "win32/base/input_state.h"
3535 #include "win32/base/keyboard.h"
3838 #include "base/util.h"
3939 #include "client/client_interface.h"
4040 #include "config/config_handler.h"
41 #include "session/commands.pb.h"
41 #include "protocol/commands.pb.h"
4242 #include "session/key_info_util.h"
4343 #include "win32/base/conversion_mode_util.h"
4444 #include "win32/base/input_state.h"
3939 #include "client/client_interface.h"
4040 #include "config/config_handler.h"
4141 #include "ipc/ipc_mock.h"
42 #include "session/commands.pb.h"
42 #include "protocol/commands.pb.h"
4343 #include "testing/base/public/googletest.h"
4444 #include "testing/base/public/gunit.h"
4545 #include "win32/base/input_state.h"
3131 #include <memory>
3232
3333 #include "base/util.h"
34 #include "session/commands.pb.h"
34 #include "protocol/commands.pb.h"
3535
3636 namespace mozc {
3737 namespace win32 {
2727 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828
2929 #include <string>
30 #include "session/commands.pb.h"
30 #include "protocol/commands.pb.h"
3131 #include "testing/base/public/googletest.h"
3232 #include "testing/base/public/gunit.h"
3333 #include "win32/base/string_util.h"
9090 ],
9191 'dependencies': [
9292 '../../base/base.gyp:base',
93 '../../session/session_base.gyp:session_protocol',
93 '../../protocol/protocol.gyp:commands_proto',
9494 '../../testing/testing.gyp:gtest_main',
9595 'imframework_util',
9696 ],
121121 '../../base/base.gyp:base',
122122 '../../config/config.gyp:config_handler',
123123 '../../config/config.gyp:config_protocol',
124 '../../protocol/protocol.gyp:commands_proto',
124125 '../../session/session_base.gyp:key_info_util',
125 '../../session/session_base.gyp:session_protocol',
126126 '../../session/session_base.gyp:output_util',
127127 ],
128128 'link_settings': {
180180 ],
181181 'dependencies': [
182182 '../../base/base.gyp:base',
183 '../../session/session_base.gyp:session_protocol',
183 '../../protocol/protocol.gyp:commands_proto',
184184 '../../testing/testing.gyp:gtest_main',
185185 'ime_base',
186186 ],
4747 '../../client/client.gyp:client',
4848 '../../config/config.gyp:config_protocol',
4949 '../../config/config.gyp:stats_config_util',
50 '../../ipc/ipc.gyp:ipc',
5150 '../../renderer/renderer.gyp:renderer_client',
52 '../../session/session_base.gyp:session_protocol',
5351 '../base/win32_base.gyp:ime_base',
5452 '../base/win32_base.gyp:win32_file_verifier',
5553 'gen_mozc_broker_resource_header',
4444 #include "base/system_util.h"
4545 #include "base/url.h"
4646 #include "base/util.h"
47 #include "base/version.h"
4748 #include "base/win_util.h"
48 #include "base/version.h"
4949 #include "client/client_interface.h"
5050 #include "config/stats_config_util.h"
51 #include "protocol/commands.pb.h"
5152 #include "renderer/renderer_client.h"
5253 #include "server/cache_service_manager.h"
53 #include "session/commands.pb.h"
5454 #include "win32/base/imm_registrar.h"
5555 #include "win32/base/imm_util.h"
5656 #include "win32/base/keyboard_layout_id.h"
5858 #include "win32/base/tsf_registrar.h"
5959 #include "win32/base/uninstall_helper.h"
6060 #include "win32/custom_action/resource.h"
61
6261
6362 #ifdef _DEBUG
6463 #define DEBUG_BREAK_FOR_DEBUGGER() \
118118 '../../config/config.gyp:config_handler',
119119 '../../config/config.gyp:config_protocol',
120120 '../../ipc/ipc.gyp:ipc',
121 '../../protocol/protocol.gyp:commands_proto',
121122 '../../renderer/renderer.gyp:renderer_protocol',
122123 '../../renderer/renderer.gyp:win32_font_util',
123124 '../../renderer/renderer.gyp:win32_renderer_client',
124 '../../session/session_base.gyp:session_protocol',
125125 '../base/win32_base.gyp:ime_base',
126126 '../base/win32_base.gyp:ime_impl_base',
127127 ],
145145 '../../client/client.gyp:client',
146146 '../../config/config.gyp:stats_config_util',
147147 '../../ipc/ipc.gyp:ipc',
148 '../../session/session_base.gyp:session_protocol',
148 '../../protocol/protocol.gyp:commands_proto',
149149 '../base/win32_base.gyp:ime_base',
150150 '../base/win32_base.gyp:text_icon',
151151 'gen_mozc_ime_resource_header',
3737 #include "google/protobuf/stubs/common.h"
3838 #include "base/logging.h"
3939 #include "base/util.h"
40 #include "session/commands.pb.h"
40 #include "protocol/commands.pb.h"
4141 #include "win32/ime/ime_ui_window.h"
4242
4343 namespace mozc {
3030 #include "testing/base/public/gunit.h"
3131
3232 #include "base/util.h"
33 #include "session/commands.pb.h"
33 #include "protocol/commands.pb.h"
3434 #include "win32/ime/ime_candidate_info.h"
3535
3636 namespace mozc {
3434 #include "google/protobuf/stubs/common.h"
3535 #include "base/logging.h"
3636 #include "base/util.h"
37 #include "session/commands.pb.h"
37 #include "protocol/commands.pb.h"
3838 #include "win32/base/immdev.h"
3939 #include "win32/base/string_util.h"
4040 #include "win32/ime/ime_message_queue.h"
3030 #include "testing/base/public/gunit.h"
3131
3232 #include "base/util.h"
33 #include "session/commands.pb.h"
33 #include "protocol/commands.pb.h"
3434 #include "win32/ime/ime_composition_string.h"
3535
3636 namespace mozc {
3737 #include "base/util.h"
3838 #include "client/client_interface.h"
3939 #include "config/config_handler.h"
40 #include "session/commands.pb.h"
40 #include "protocol/commands.pb.h"
4141 #include "session/output_util.h"
4242 #include "win32/base/conversion_mode_util.h"
4343 #include "win32/base/deleter.h"
3838 #include "client/client.h"
3939 #include "config/config_handler.h"
4040 #include "ipc/ipc_mock.h"
41 #include "session/commands.pb.h"
41 #include "protocol/commands.pb.h"
4242 #include "testing/base/public/googletest.h"
4343 #include "testing/base/public/gunit.h"
4444 #include "win32/base/input_state.h"
3636 #include <atlbase.h>
3737
3838 #include "base/port.h"
39 #include "session/commands.pb.h"
39 #include "protocol/commands.pb.h"
4040
4141 class ImeSystemLangBarMenu;
4242 class ImeCandidateList;
3030
3131 #include "base/run_level.h"
3232 #include "client/client_interface.h"
33 #include "session/commands.pb.h"
33 #include "protocol/commands.pb.h"
3434 #include "win32/base/config_snapshot.h"
3535 #include "win32/base/deleter.h"
3636 #include "win32/base/focus_hierarchy_observer.h"
101101 '../../config/config.gyp:config_handler',
102102 '../../config/config.gyp:stats_config_util',
103103 '../../protobuf/protobuf.gyp:protobuf',
104 '../../protocol/protocol.gyp:commands_proto',
104105 '../../renderer/renderer.gyp:renderer_protocol',
105106 '../../renderer/renderer.gyp:renderer_style_handler',
106107 '../../renderer/renderer.gyp:table_layout',
109110 '../../renderer/renderer.gyp:win32_text_renderer',
110111 '../../renderer/renderer.gyp:window_util',
111112 '../../session/session_base.gyp:output_util',
112 '../../session/session_base.gyp:session_protocol',
113113 '../base/win32_base.gyp:ime_base',
114114 '../base/win32_base.gyp:ime_impl_base',
115115 '../base/win32_base.gyp:imframework_util',
3939
4040 #include "base/util.h"
4141 #include "client/client_interface.h"
42 #include "session/commands.pb.h"
42 #include "protocol/commands.pb.h"
4343 #include "win32/base/conversion_mode_util.h"
4444 #include "win32/base/deleter.h"
4545 #include "win32/base/input_state.h"
3939
4040 #include "base/util.h"
4141 #include "client/client_interface.h"
42 #include "session/commands.pb.h"
42 #include "protocol/commands.pb.h"
4343 #include "win32/base/conversion_mode_util.h"
4444 #include "win32/base/input_state.h"
4545 #include "win32/base/string_util.h"
4040
4141 #include "base/util.h"
4242 #include "client/client_interface.h"
43 #include "session/commands.pb.h"
43 #include "protocol/commands.pb.h"
4444 #include "win32/base/browser_info.h"
4545 #include "win32/base/conversion_mode_util.h"
4646 #include "win32/base/deleter.h"
3131 #include "base/logging.h"
3232 #include "base/system_util.h"
3333 #include "base/win_util.h"
34 #include "session/commands.pb.h"
34 #include "protocol/commands.pb.h"
3535 #include "win32/tip/tip_dll_module.h"
3636 #include "win32/tip/tip_lang_bar_menu.h"
3737 #include "win32/tip/tip_resource.h"
3434
3535 #include "base/win_util.h"
3636 #include "client/client_interface.h"
37 #include "session/commands.pb.h"
37 #include "protocol/commands.pb.h"
3838 #include "session/key_info_util.h"
3939 #include "win32/base/config_snapshot.h"
4040 #include "win32/base/deleter.h"
3333
3434 #include "base/util.h"
3535 #include "client/client_interface.h"
36 #include "session/commands.pb.h"
36 #include "protocol/commands.pb.h"
3737 #include "win32/tip/tip_ref_count.h"
3838
3939 using ::mozc::client::ClientFactory;
3636 #include <string>
3737
3838 #include "base/logging.h"
39 #include "session/commands.pb.h"
39 #include "protocol/commands.pb.h"
4040 #include "win32/base/conversion_mode_util.h"
4141 #include "win32/tip/tip_compartment_util.h"
4242
4646 #include "base/update_util.h"
4747 #include "base/util.h"
4848 #include "base/win_util.h"
49 #include "session/commands.pb.h"
49 #include "protocol/commands.pb.h"
5050 #include "win32/base/conversion_mode_util.h"
5151 #include "win32/base/indicator_visibility_tracker.h"
5252 #include "win32/base/input_state.h"
3939 #include <string>
4040
4141 #include "base/util.h"
42 #include "session/commands.pb.h"
42 #include "protocol/commands.pb.h"
4343 #include "win32/tip/tip_dll_module.h"
4444 #include "win32/tip/tip_private_context.h"
4545 #include "win32/tip/tip_ref_count.h"
3939
4040 #include "base/util.h"
4141 #include "renderer/renderer_command.pb.h"
42 #include "session/commands.pb.h"
42 #include "protocol/commands.pb.h"
4343 #include "win32/base/conversion_mode_util.h"
4444 #include "win32/base/input_state.h"
4545 #include "win32/tip/tip_dll_module.h"
4242 #include <unordered_map>
4343
4444 #include "base/util.h"
45 #include "protocol/commands.pb.h"
4546 #include "renderer/table_layout.h"
4647 #include "renderer/win32/text_renderer.h"
4748 #include "renderer/win32/win32_renderer_util.h"
4849 #include "renderer/window_util.h"
49 #include "session/commands.pb.h"
5050 #include "win32/tip/tip_composition_util.h"
5151 #include "win32/tip/tip_dll_module.h"
5252 #include "win32/tip/tip_edit_session.h"
3737
3838 #include <unordered_map>
3939
40 #include "protocol/commands.pb.h"
4041 #include "renderer/renderer_command.pb.h"
41 #include "session/commands.pb.h"
4242 #include "win32/base/input_state.h"
4343 #include "win32/tip/tip_input_mode_manager.h"
4444 #include "win32/tip/tip_private_context.h"
4040 #include <unordered_map>
4141
4242 #include "base/util.h"
43 #include "session/commands.pb.h"
43 #include "protocol/commands.pb.h"
4444 #include "win32/tip/tip_composition_util.h"
4545 #include "win32/tip/tip_private_context.h"
4646 #include "win32/tip/tip_text_service.h"
3737 #include <memory>
3838
3939 #include "base/util.h"
40 #include "session/commands.pb.h"
40 #include "protocol/commands.pb.h"
4141 #include "renderer/table_layout.h"
4242 #include "renderer/win32/text_renderer.h"
4343