Flutter Engine
The Flutter Engine
shell
platform
common
text_editing_delta.cc
Go to the documentation of this file.
1
// Copyright 2013 The Flutter 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
#include "flutter/shell/platform/common/text_editing_delta.h"
6
7
#include "flutter/fml/string_conversion.h"
8
9
namespace
flutter
{
10
11
TextEditingDelta::TextEditingDelta
(
const
std::u16string& text_before_change,
12
const
TextRange
& range,
13
const
std::u16string&
text
)
14
: old_text_(text_before_change),
15
delta_text_(
text
),
16
delta_start_(range.
start
()),
17
delta_end_(range.
start
() + range.
length
()) {}
18
19
TextEditingDelta::TextEditingDelta
(
const
std::string& text_before_change,
20
const
TextRange
& range,
21
const
std::string&
text
)
22
: old_text_(
fml
::
Utf8ToUtf16
(text_before_change)),
23
delta_text_(
fml
::
Utf8ToUtf16
(
text
)),
24
delta_start_(range.
start
()),
25
delta_end_(range.
start
() + range.
length
()) {}
26
27
TextEditingDelta::TextEditingDelta
(
const
std::u16string&
text
)
28
: old_text_(
text
), delta_text_(u
""
), delta_start_(-1), delta_end_(-1) {}
29
30
TextEditingDelta::TextEditingDelta
(
const
std::string&
text
)
31
: old_text_(
fml
::
Utf8ToUtf16
(
text
)),
32
delta_text_(u
""
),
33
delta_start_(-1),
34
delta_end_(-1) {}
35
36
}
// namespace flutter
flutter::TextRange
Definition:
text_range.h:19
start
glong start
Definition:
fl_accessible_text_field.cc:39
length
size_t length
Definition:
key_event_handler.cc:41
text
std::u16string text
Definition:
keyboard_unittests.cc:332
flutter
Definition:
asset_manager.cc:10
fml
Definition:
ascii_trie.cc:9
fml::Utf8ToUtf16
std::u16string Utf8ToUtf16(const std::string_view string)
Definition:
string_conversion.cc:42
flutter::TextEditingDelta::TextEditingDelta
TextEditingDelta(const std::u16string &text_before_change, const TextRange &range, const std::u16string &text)
Definition:
text_editing_delta.cc:11
Generated on Sun Jun 23 2024 21:55:11 for Flutter Engine by
1.9.4