Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1500)

Unified Diff: win8/metro_driver/ime/text_service.h

Issue 83233002: Enable basic IME functionality under Ash on Windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix warnings (that are treated as an error) on 64-bit build Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « win8/metro_driver/ime/input_scope.cc ('k') | win8/metro_driver/ime/text_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: win8/metro_driver/ime/text_service.h
diff --git a/win8/metro_driver/ime/text_service.h b/win8/metro_driver/ime/text_service.h
new file mode 100644
index 0000000000000000000000000000000000000000..fe497ab2655c174740b446ca30d3969b9888211a
--- /dev/null
+++ b/win8/metro_driver/ime/text_service.h
@@ -0,0 +1,53 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef WIN8_METRO_DRIVER_IME_TEXT_SERVICE_H_
+#define WIN8_METRO_DRIVER_IME_TEXT_SERVICE_H_
+
+#include <Windows.h>
+
+#include <vector>
+
+#include "base/basictypes.h"
+#include "base/memory/scoped_ptr.h"
+
+namespace metro_viewer {
+struct CharacterBounds;
+}
+
+namespace metro_driver {
+
+class TextServiceDelegate;
+
+// An interface to manage a virtual text store with which an IME communicates.
+class TextService {
+ public:
+ virtual ~TextService() {}
+
+ // Cancels on-going composition. Does nothing if there is no composition.
+ virtual void CancelComposition() = 0;
+
+ // Updates document type with |input_scopes| and caret/composition position
+ // with |character_bounds|. An empty |input_scopes| indicates that IMEs
+ // should be disabled until non-empty |input_scopes| is specified.
+ // Note: |input_scopes| is defined as std::vector<int32> here rather than
+ // std::vector<InputScope> because the wire format of IPC message
+ // MetroViewerHostMsg_ImeTextInputClientUpdated uses std::vector<int32> to
+ // avoid dependency on <InputScope.h> header.
+ virtual void OnDocumentChanged(
+ const std::vector<int32>& input_scopes,
+ const std::vector<metro_viewer::CharacterBounds>& character_bounds) = 0;
+
+ // Must be called whenever the attached window gains keyboard focus.
+ virtual void OnWindowActivated() = 0;
+};
+
+// Returns an instance of TextService that works together with
+// |text_store_delegate| as if it was an text area owned by |window_handle|.
+scoped_ptr<TextService>
+CreateTextService(TextServiceDelegate* delegate, HWND window_handle);
+
+} // namespace metro_driver
+
+#endif // WIN8_METRO_DRIVER_IME_TEXT_SERVICE_H_
« no previous file with comments | « win8/metro_driver/ime/input_scope.cc ('k') | win8/metro_driver/ime/text_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698