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

Side by Side Diff: ui/base/ime/win/tsf_event_router.h

Issue 149073009: Remove InputMethodTSF, TSFEventRouter, TSFTextStore, TSFBridge (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: revert input_method_imm32 changes Created 6 years, 10 months 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 | Annotate | Revision Log
« no previous file with comments | « ui/base/ime/win/tsf_bridge.cc ('k') | ui/base/ime/win/tsf_event_router.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 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 UI_BASE_IME_WIN_TSF_EVENT_ROUTER_H_
6 #define UI_BASE_IME_WIN_TSF_EVENT_ROUTER_H_
7
8 #include <atlbase.h>
9 #include <atlcom.h>
10 #include <msctf.h>
11
12 #include <set>
13
14 #include "base/basictypes.h"
15 #include "base/callback.h"
16 #include "base/compiler_specific.h"
17 #include "ui/base/ime/text_input_type.h"
18 #include "ui/base/ui_base_export.h"
19 #include "ui/gfx/range/range.h"
20
21 struct ITfDocumentMgr;
22
23 namespace ui {
24
25 class TSFEventRouterObserver {
26 public:
27 TSFEventRouterObserver() {}
28
29 // Called when the number of currently opened candidate windows changes.
30 virtual void OnCandidateWindowCountChanged(size_t window_count) {}
31
32 // Called when a composition is started.
33 virtual void OnTSFStartComposition() {}
34
35 // Called when the text contents are updated. If there is no composition,
36 // gfx::Range::InvalidRange is passed to |composition_range|.
37 virtual void OnTextUpdated(const gfx::Range& composition_range) {}
38
39 // Called when a composition is terminated.
40 virtual void OnTSFEndComposition() {}
41
42 protected:
43 virtual ~TSFEventRouterObserver() {}
44
45 private:
46 DISALLOW_COPY_AND_ASSIGN(TSFEventRouterObserver);
47 };
48
49 // This class monitores TSF related events and forwards them to given
50 // |observer|.
51 class UI_BASE_EXPORT TSFEventRouter {
52 public:
53 // Do not pass NULL to |observer|.
54 explicit TSFEventRouter(TSFEventRouterObserver* observer);
55 virtual ~TSFEventRouter();
56
57 // Returns true if the IME is composing text.
58 bool IsImeComposing();
59
60 // Callbacks from the TSFEventRouterDelegate:
61 void OnCandidateWindowCountChanged(size_t window_count);
62 void OnTSFStartComposition();
63 void OnTextUpdated(const gfx::Range& composition_range);
64 void OnTSFEndComposition();
65
66 // Sets |thread_manager| to be monitored. |thread_manager| can be NULL.
67 void SetManager(ITfThreadMgr* thread_manager);
68
69 private:
70 class Delegate;
71
72 CComPtr<Delegate> delegate_;
73
74 TSFEventRouterObserver* observer_;
75
76 DISALLOW_COPY_AND_ASSIGN(TSFEventRouter);
77 };
78
79 } // namespace ui
80
81 #endif // UI_BASE_IME_WIN_TSF_EVENT_ROUTER_H_
OLDNEW
« no previous file with comments | « ui/base/ime/win/tsf_bridge.cc ('k') | ui/base/ime/win/tsf_event_router.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698