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

Unified 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: Fix win build break 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/base/win/tsf_bridge.cc ('k') | ui/base/win/tsf_event_router.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/win/tsf_event_router.h
diff --git a/ui/base/win/tsf_event_router.h b/ui/base/win/tsf_event_router.h
new file mode 100644
index 0000000000000000000000000000000000000000..e4eb2584e700214dedea4826ae445196f299e7ec
--- /dev/null
+++ b/ui/base/win/tsf_event_router.h
@@ -0,0 +1,60 @@
+// Copyright (c) 2012 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 UI_BASE_WIN_TSF_EVENT_ROUTER_H_
+#define UI_BASE_WIN_TSF_EVENT_ROUTER_H_
+
+#include <msctf.h>
+
+#include "base/basictypes.h"
+#include "base/callback.h"
+#include "base/compiler_specific.h"
+#include "ui/base/ime/text_input_type.h"
+#include "ui/base/ui_export.h"
+
+struct ITfDocumentMgr;
+
+namespace ui {
+
+// This is an abstract interface that monitors events associated with TSF and
+// forwards them to the observer. In order to manage the life cycle of this
+// object by scoped_refptr and the implementation class of this interface is COM
+// class anyway, this interface is derived from IUnknown.
+class TsfEventRouter : public IUnknown {
+ public:
+ typedef base::Callback<void ()> TextUpdatedCallback;
+ typedef base::Callback<void (size_t window_count)>
+ CandidateWindowCountChangedCallback;
+
+ virtual ~TsfEventRouter();
+
+ // Sets |manager| to be monitored. |manager| can be NULL.
+ virtual void SetManager(ITfThreadMgr* manager) = 0;
+
+ // Returns true if the IME is composing texts.
+ virtual bool IsImeComposing() = 0;
+
+ // Sets the callback function which is invoked when the text contents is
+ // updated.
+ virtual void SetTextUpdatedCallback(
+ const TextUpdatedCallback& callback) = 0;
+
+ // Sets the callback function which is invoked when the number of currently
+ // candidate window opened is changed.
+ virtual void SetCandidateWindowStatusChangedCallback(
+ const CandidateWindowCountChangedCallback& callback) = 0;
+
+ // Factory function, creates a new instance and retunrns ownership.
+ static UI_EXPORT TsfEventRouter* Create();
+
+ protected:
+ // Create should be used instead.
+ TsfEventRouter();
+
+ DISALLOW_COPY_AND_ASSIGN(TsfEventRouter);
+};
+
+} // namespace ui
+
+#endif // UI_BASE_WIN_TSF_EVENT_ROUTER_H_
« no previous file with comments | « ui/base/win/tsf_bridge.cc ('k') | ui/base/win/tsf_event_router.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698