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

Side by Side 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: Address comment from ananta. Add text_service_delegate.h, which I forgot to upload. Style fixes. 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef WIN8_METRO_DRIVER_IME_TEXT_SERVICE_H_
6 #define WIN8_METRO_DRIVER_IME_TEXT_SERVICE_H_
7
8 #include <Windows.h>
9
10 #include "base/basictypes.h"
11 #include "base/memory/scoped_ptr.h"
12
13 namespace metro_viewer {
14 struct CharacterBounds;
15 }
16
17 namespace metro_driver {
18
19 class TextServiceDelegate;
20
21 // An interface to manage a virtual text store with which an IME communicates.
22 class TextService {
23 public:
24 virtual ~TextService() {}
25
26 // Cancels on-going composition. Does nothing if there is no composition.
27 virtual void CancelComposition() = 0;
28
29 // Updates document type with |input_scopes| and caret/composition position
30 // with |character_bounds|. An empty |input_scopes| indicates that IMEs
31 // should be disabled until non-empty |input_scopes| is specified.
32 // Note: |input_scopes| is defined as std::vector<int32> here rather than
33 // std::vector<InputScope> because the wire format of IPC message
34 // MetroViewerHostMsg_ImeTextInputClientUpdated uses std::vector<int32> to
35 // avoid dependency on <InputScope.h> header.
36 virtual void OnDocumentChanged(
37 const std::vector<int32>& input_scopes,
38 const std::vector<metro_viewer::CharacterBounds>& character_bounds) = 0;
39
40 // Must be called whenever the attached window gains keyboard focus.
41 virtual void OnWindowActivated() = 0;
42 };
43
44 // Returns an instance of TextService that works together with
45 // |text_store_delegate| as if it was an text area owned by |window_handle|.
46 scoped_ptr<TextService>
47 CreateTextService(TextServiceDelegate* delegate, HWND window_handle);
48
49 } // namespace metro_driver
50
51 #endif // WIN8_METRO_DRIVER_IME_TEXT_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698