OLD | NEW |
(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 |
| 10 #include "base/basictypes.h" |
| 11 #include "base/callback.h" |
| 12 #include "base/compiler_specific.h" |
| 13 #include "ui/base/ime/text_input_type.h" |
| 14 #include "ui/base/ui_export.h" |
| 15 |
| 16 struct ITfDocumentMgr; |
| 17 |
| 18 namespace ui { |
| 19 |
| 20 // This is an abstract interface that monitors events associated with TSF and |
| 21 // forwards them to the observer. In order to manage the life cycle of this |
| 22 // object by scoped_refptr and the implementation class of this interface is COM |
| 23 // class anyway, this interface is derived from IUnknown. |
| 24 class TsfEventRouter : public IUnknown { |
| 25 public: |
| 26 typedef base::Callback<void ()> TextUpdatedCallback; |
| 27 typedef base::Callback<void (size_t window_count)> |
| 28 CandidateWindowCountChangedCallback; |
| 29 |
| 30 virtual ~TsfEventRouter(); |
| 31 |
| 32 // Sets |manager| to be monitored. |manager| can be NULL. |
| 33 virtual void SetManager(ITfThreadMgr* manager) = 0; |
| 34 |
| 35 // Returns true if the IME is composing texts. |
| 36 virtual bool IsImeComposing() = 0; |
| 37 |
| 38 // Sets the callback function which is invoked when the text contents is |
| 39 // updated. |
| 40 virtual void SetTextUpdatedCallback( |
| 41 const TextUpdatedCallback& callback) = 0; |
| 42 |
| 43 // Sets the callback function which is invoked when the number of currently |
| 44 // candidate window opened is changed. |
| 45 virtual void SetCandidateWindowStatusChangedCallback( |
| 46 const CandidateWindowCountChangedCallback& callback) = 0; |
| 47 |
| 48 // Factory function, creates a new instance and retunrns ownership. |
| 49 static UI_EXPORT TsfEventRouter* Create(); |
| 50 |
| 51 protected: |
| 52 // Create should be used instead. |
| 53 TsfEventRouter(); |
| 54 |
| 55 DISALLOW_COPY_AND_ASSIGN(TsfEventRouter); |
| 56 }; |
| 57 |
| 58 } // namespace ui |
| 59 |
| 60 #endif // UI_BASE_WIN_TSF_EVENT_ROUTER_H_ |
OLD | NEW |