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

Side by Side Diff: content/common/dwrite_text_analysis_source_win.h

Issue 1846433005: Implement direct write fallback proxy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Style fixes Created 4 years, 8 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) 2016 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 CONTENT_COMMON_DWRITE_TEXT_ANALYSIS_SOURCE_WIN_H_
6 #define CONTENT_COMMON_DWRITE_TEXT_ANALYSIS_SOURCE_WIN_H_
7
8 #include <dwrite.h>
9 #include <wrl.h>
10
11 #include "base/macros.h"
12 #include "base/strings/string16.h"
13 #include "content/common/content_export.h"
14
15 namespace content {
16
17 // Implements an IDWriteTextAnalysisSource, describing a single pre-defined
18 // chunk of text with a uniform locale, reading direction, and number
19 // substitution.
20 class CONTENT_EXPORT TextAnalysisSource
21 : public Microsoft::WRL::RuntimeClass<
22 Microsoft::WRL::RuntimeClassFlags<Microsoft::WRL::ClassicCom>,
23 IDWriteTextAnalysisSource> {
24 public:
25 // IDWriteTextAnalysisSource:
26 HRESULT STDMETHODCALLTYPE GetLocaleName(UINT32 text_position,
27 UINT32* text_length,
28 const WCHAR** locale_name) override;
29 HRESULT STDMETHODCALLTYPE GetNumberSubstitution(
30 UINT32 text_position,
31 UINT32* text_length,
32 IDWriteNumberSubstitution** number_substitution) override;
33 DWRITE_READING_DIRECTION STDMETHODCALLTYPE
34 GetParagraphReadingDirection() override;
35 HRESULT STDMETHODCALLTYPE GetTextAtPosition(UINT32 text_position,
36 const WCHAR** text_string,
37 UINT32* text_length) override;
38 HRESULT STDMETHODCALLTYPE GetTextBeforePosition(UINT32 text_position,
39 const WCHAR** text_string,
40 UINT32* text_length) override;
41
42 HRESULT STDMETHODCALLTYPE
43 RuntimeClassInitialize(const base::string16& text,
44 const base::string16& locale_name,
45 IDWriteNumberSubstitution* number_substitution,
46 DWRITE_READING_DIRECTION reading_direction);
47
48 protected:
49 ~TextAnalysisSource();
50
51 private:
52 base::string16 text_;
53 base::string16 locale_name_;
54 Microsoft::WRL::ComPtr<IDWriteNumberSubstitution> number_substitution_;
55 DWRITE_READING_DIRECTION reading_direction_;
56
57 DISALLOW_ASSIGN(TextAnalysisSource);
58 };
59
60 } // namespace content
61
62 #endif // CONTENT_COMMON_DWRITE_TEXT_ANALYSIS_SOURCE_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698