OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_BASE_IME_WIN_TSF_TEXT_STORE_H_ | 5 #ifndef UI_BASE_IME_WIN_TSF_TEXT_STORE_H_ |
6 #define UI_BASE_IME_WIN_TSF_TEXT_STORE_H_ | 6 #define UI_BASE_IME_WIN_TSF_TEXT_STORE_H_ |
7 | 7 |
8 #include <msctf.h> | 8 #include <msctf.h> |
9 #include <deque> | 9 #include <deque> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
14 #include "base/win/scoped_comptr.h" | 14 #include "base/win/scoped_comptr.h" |
15 #include "ui/base/ime/composition_underline.h" | 15 #include "ui/base/ime/composition_underline.h" |
16 #include "ui/base/ui_export.h" | 16 #include "ui/base/ui_base_export.h" |
17 #include "ui/gfx/range/range.h" | 17 #include "ui/gfx/range/range.h" |
18 | 18 |
19 namespace ui { | 19 namespace ui { |
20 class TextInputClient; | 20 class TextInputClient; |
21 | 21 |
22 // TSFTextStore is used to interact with the input method via TSF manager. | 22 // TSFTextStore is used to interact with the input method via TSF manager. |
23 // TSFTextStore have a string buffer which is manipulated by TSF manager through | 23 // TSFTextStore have a string buffer which is manipulated by TSF manager through |
24 // ITextStoreACP interface methods such as SetText(). | 24 // ITextStoreACP interface methods such as SetText(). |
25 // When the input method updates the composition, TSFTextStore calls | 25 // When the input method updates the composition, TSFTextStore calls |
26 // TextInputClient::SetCompositionText(). And when the input method finishes the | 26 // TextInputClient::SetCompositionText(). And when the input method finishes the |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 // RequestLock() is called from only one thread, but called recursively in | 74 // RequestLock() is called from only one thread, but called recursively in |
75 // OnLockGranted() or OnSelectionChange() or OnLayoutChange() or OnTextChange(). | 75 // OnLockGranted() or OnSelectionChange() or OnLayoutChange() or OnTextChange(). |
76 // If the document is locked and the lock request is asynchronous, TSFTextStore | 76 // If the document is locked and the lock request is asynchronous, TSFTextStore |
77 // queues the request. The queued requests will be handled after the current | 77 // queues the request. The queued requests will be handled after the current |
78 // lock is removed. | 78 // lock is removed. |
79 // More information about document locks can be found here: | 79 // More information about document locks can be found here: |
80 // http://msdn.microsoft.com/en-us/library/ms538064 | 80 // http://msdn.microsoft.com/en-us/library/ms538064 |
81 // | 81 // |
82 // More information about TSF can be found here: | 82 // More information about TSF can be found here: |
83 // http://msdn.microsoft.com/en-us/library/ms629032 | 83 // http://msdn.microsoft.com/en-us/library/ms629032 |
84 class UI_EXPORT TSFTextStore : public ITextStoreACP, | 84 class UI_BASE_EXPORT TSFTextStore : public ITextStoreACP, |
85 public ITfContextOwnerCompositionSink, | 85 public ITfContextOwnerCompositionSink, |
86 public ITfTextEditSink { | 86 public ITfTextEditSink { |
87 public: | 87 public: |
88 TSFTextStore(); | 88 TSFTextStore(); |
89 virtual ~TSFTextStore(); | 89 virtual ~TSFTextStore(); |
90 | 90 |
91 // ITextStoreACP: | 91 // ITextStoreACP: |
92 STDMETHOD_(ULONG, AddRef)() OVERRIDE; | 92 STDMETHOD_(ULONG, AddRef)() OVERRIDE; |
93 STDMETHOD_(ULONG, Release)() OVERRIDE; | 93 STDMETHOD_(ULONG, Release)() OVERRIDE; |
94 STDMETHOD(QueryInterface)(REFIID iid, void** ppv) OVERRIDE; | 94 STDMETHOD(QueryInterface)(REFIID iid, void** ppv) OVERRIDE; |
95 STDMETHOD(AdviseSink)(REFIID iid, IUnknown* unknown, DWORD mask) OVERRIDE; | 95 STDMETHOD(AdviseSink)(REFIID iid, IUnknown* unknown, DWORD mask) OVERRIDE; |
96 STDMETHOD(FindNextAttrTransition)(LONG acp_start, | 96 STDMETHOD(FindNextAttrTransition)(LONG acp_start, |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 // attributes of the composition string. | 288 // attributes of the composition string. |
289 base::win::ScopedComPtr<ITfCategoryMgr> category_manager_; | 289 base::win::ScopedComPtr<ITfCategoryMgr> category_manager_; |
290 base::win::ScopedComPtr<ITfDisplayAttributeMgr> display_attribute_manager_; | 290 base::win::ScopedComPtr<ITfDisplayAttributeMgr> display_attribute_manager_; |
291 | 291 |
292 DISALLOW_COPY_AND_ASSIGN(TSFTextStore); | 292 DISALLOW_COPY_AND_ASSIGN(TSFTextStore); |
293 }; | 293 }; |
294 | 294 |
295 } // namespace ui | 295 } // namespace ui |
296 | 296 |
297 #endif // UI_BASE_IME_WIN_TSF_TEXT_STORE_H_ | 297 #endif // UI_BASE_IME_WIN_TSF_TEXT_STORE_H_ |
OLD | NEW |