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

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

Issue 11148012: Introduce TsfEventRouter. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 years, 2 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
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_WIN_TSF_EVENT_ROUTER_H_
6 #define UI_BASE_WIN_TSF_EVENT_ROUTER_H_
7
8 #include <msctf.h>
9 #include "base/basictypes.h"
sky 2012/10/15 22:00:07 newline between 8 and 9
Seigo Nonaka 2012/10/16 02:20:47 Done.
10 #include "base/callback.h"
11 #include "base/compiler_specific.h"
12 #include "ui/base/ime/text_input_type.h"
13 #include "ui/base/ui_export.h"
14
15 struct ITfDocumentMgr;
16
17 namespace ui {
18
19 // This is an abstract interface that monitors events associated with TSF and
20 // forwards them to the observer. In order to manage the life cycle of this
21 // object by scoped_refptr and the implementation class of this interface is COM
22 // class anyway, this interface is derived from IUnknown.
23 class TsfEventRouter : public IUnknown {
24 public:
25 typedef base::Callback<void ()> TextUpdatedCallback;
26 typedef base::Callback<void (size_t window_count)>
27 CandidateWindowCountChangedCallback;
28 virtual ~TsfEventRouter();
sky 2012/10/15 22:00:07 nit: newline between 27/28.
Seigo Nonaka 2012/10/16 02:20:47 Done.
29
30 // Associates this class with specified |manager|.
31 virtual void Associate(ITfThreadMgr* manager) = 0;
sky 2012/10/15 22:00:07 Can you replace both Associate and EnsureDeassocia
Seigo Nonaka 2012/10/16 02:20:47 Done.
32
33 // Resets the association, this function is safe to call if there is no
34 // associated thread manager.
35 virtual void EnsureDeassociated() = 0;
36
37 // Returns true if the IME is composing texts.
38 virtual bool IsImeComposing() = 0;
39
40 // Sets the callback function which is invoked when the text contents is
41 // updated.
42 virtual void SetTextUpdatedCallback(
43 const TextUpdatedCallback& callback) = 0;
44
45 // Sets the callback function which is invoked when the number of currently
46 // candidate window opened is changed.
47 virtual void SetCandidateWindowStatusChangedCallback(
48 const CandidateWindowCountChangedCallback& callback) = 0;
49
50 // Factory function, creates a new instance and retunrns ownership.
51 static UI_EXPORT TsfEventRouter* Create();
52
53 protected:
54 // Create should be used instead.
55 TsfEventRouter();
56
57 DISALLOW_COPY_AND_ASSIGN(TsfEventRouter);
58 };
59
60 } // namespace ui
61
62 #endif // UI_BASE_WIN_TSF_EVENT_ROUTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698