| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 WIN8_METRO_DRIVER_IME_TEXT_STORE_H_ | 5 #ifndef WIN8_METRO_DRIVER_IME_TEXT_STORE_H_ |
| 6 #define WIN8_METRO_DRIVER_IME_TEXT_STORE_H_ | 6 #define WIN8_METRO_DRIVER_IME_TEXT_STORE_H_ |
| 7 | 7 |
| 8 #include <atlbase.h> | 8 #include <atlbase.h> |
| 9 #include <atlcom.h> | 9 #include <atlcom.h> |
| 10 #include <initguid.h> | 10 #include <initguid.h> |
| 11 #include <inputscope.h> | 11 #include <inputscope.h> |
| 12 #include <msctf.h> | 12 #include <msctf.h> |
| 13 #include <stdint.h> |
| 13 | 14 |
| 14 #include <deque> | 15 #include <deque> |
| 15 #include <vector> | 16 #include <vector> |
| 16 | 17 |
| 17 #include "base/basictypes.h" | |
| 18 #include "base/compiler_specific.h" | 18 #include "base/compiler_specific.h" |
| 19 #include "base/macros.h" |
| 19 #include "base/memory/ref_counted.h" | 20 #include "base/memory/ref_counted.h" |
| 20 #include "base/strings/string16.h" | 21 #include "base/strings/string16.h" |
| 21 #include "base/win/scoped_comptr.h" | 22 #include "base/win/scoped_comptr.h" |
| 22 #include "ui/metro_viewer/ime_types.h" | 23 #include "ui/metro_viewer/ime_types.h" |
| 23 | 24 |
| 24 namespace metro_driver { | 25 namespace metro_driver { |
| 25 | 26 |
| 26 class TextStoreDelegate; | 27 class TextStoreDelegate; |
| 27 | 28 |
| 28 // TextStore is used to interact with the input method via TSF manager. | 29 // TextStore is used to interact with the input method via TSF manager. |
| (...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 bool HasReadWriteLock() const; | 239 bool HasReadWriteLock() const; |
| 239 | 240 |
| 240 // Gets the display attribute structure. | 241 // Gets the display attribute structure. |
| 241 bool GetDisplayAttribute(TfGuidAtom guid_atom, | 242 bool GetDisplayAttribute(TfGuidAtom guid_atom, |
| 242 TF_DISPLAYATTRIBUTE* attribute); | 243 TF_DISPLAYATTRIBUTE* attribute); |
| 243 | 244 |
| 244 // Gets the committed string size and underline information of the context. | 245 // Gets the committed string size and underline information of the context. |
| 245 bool GetCompositionStatus( | 246 bool GetCompositionStatus( |
| 246 ITfContext* context, | 247 ITfContext* context, |
| 247 const TfEditCookie read_only_edit_cookie, | 248 const TfEditCookie read_only_edit_cookie, |
| 248 uint32* committed_size, | 249 uint32_t* committed_size, |
| 249 std::vector<metro_viewer::UnderlineInfo>* undelines); | 250 std::vector<metro_viewer::UnderlineInfo>* undelines); |
| 250 | 251 |
| 251 // A pointer of ITextStoreACPSink, this instance is given in AdviseSink. | 252 // A pointer of ITextStoreACPSink, this instance is given in AdviseSink. |
| 252 base::win::ScopedComPtr<ITextStoreACPSink> text_store_acp_sink_; | 253 base::win::ScopedComPtr<ITextStoreACPSink> text_store_acp_sink_; |
| 253 | 254 |
| 254 // The current mask of |text_store_acp_sink_|. | 255 // The current mask of |text_store_acp_sink_|. |
| 255 DWORD text_store_acp_sink_mask_; | 256 DWORD text_store_acp_sink_mask_; |
| 256 | 257 |
| 257 // HWND of the attached window. | 258 // HWND of the attached window. |
| 258 HWND window_handle_; | 259 HWND window_handle_; |
| 259 | 260 |
| 260 // |string_buffer_| contains committed string and composition string. | 261 // |string_buffer_| contains committed string and composition string. |
| 261 // Example: "aoi" is committed, and "umi" is under composition. | 262 // Example: "aoi" is committed, and "umi" is under composition. |
| 262 // |string_buffer_|: "aoiumi" | 263 // |string_buffer_|: "aoiumi" |
| 263 // |committed_size_|: 3 | 264 // |committed_size_|: 3 |
| 264 base::string16 string_buffer_; | 265 base::string16 string_buffer_; |
| 265 uint32 committed_size_; | 266 uint32_t committed_size_; |
| 266 | 267 |
| 267 // |selection_start_| and |selection_end_| indicates the selection range. | 268 // |selection_start_| and |selection_end_| indicates the selection range. |
| 268 // Example: "iue" is selected | 269 // Example: "iue" is selected |
| 269 // |string_buffer_|: "aiueo" | 270 // |string_buffer_|: "aiueo" |
| 270 // |selection_start_|: 1 | 271 // |selection_start_|: 1 |
| 271 // |selection_end_|: 4 | 272 // |selection_end_|: 4 |
| 272 uint32 selection_start_; | 273 uint32_t selection_start_; |
| 273 uint32 selection_end_; | 274 uint32_t selection_end_; |
| 274 | 275 |
| 275 // |start_offset| and |end_offset| of |composition_undelines_| indicates | 276 // |start_offset| and |end_offset| of |composition_undelines_| indicates |
| 276 // the offsets in |string_buffer_|. | 277 // the offsets in |string_buffer_|. |
| 277 // Example: "aoi" is committed. There are two underlines in "umi" and "no". | 278 // Example: "aoi" is committed. There are two underlines in "umi" and "no". |
| 278 // |string_buffer_|: "aoiumino" | 279 // |string_buffer_|: "aoiumino" |
| 279 // |committed_size_|: 3 | 280 // |committed_size_|: 3 |
| 280 // underlines_[0].start_offset: 3 | 281 // underlines_[0].start_offset: 3 |
| 281 // underlines_[0].end_offset: 6 | 282 // underlines_[0].end_offset: 6 |
| 282 // underlines_[1].start_offset: 6 | 283 // underlines_[1].start_offset: 6 |
| 283 // underlines_[1].end_offset: 8 | 284 // underlines_[1].end_offset: 8 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 306 | 307 |
| 307 // The delegate attached to this text store. | 308 // The delegate attached to this text store. |
| 308 TextStoreDelegate* delegate_; | 309 TextStoreDelegate* delegate_; |
| 309 | 310 |
| 310 DISALLOW_COPY_AND_ASSIGN(TextStore); | 311 DISALLOW_COPY_AND_ASSIGN(TextStore); |
| 311 }; | 312 }; |
| 312 | 313 |
| 313 } // namespace metro_driver | 314 } // namespace metro_driver |
| 314 | 315 |
| 315 #endif // WIN8_METRO_DRIVER_IME_TEXT_STORE_H_ | 316 #endif // WIN8_METRO_DRIVER_IME_TEXT_STORE_H_ |
| OLD | NEW |