diff options
author | Dan Sinclair <dsinclair@chromium.org> | 2018-05-29 19:42:39 +0000 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2018-05-29 19:42:39 +0000 |
commit | 6af5369477ec05554ef9e73ae6762860095f09e9 (patch) | |
tree | 0a9d28f4e3f89ca5b141954913169fdff63bf59c /xfa/fde/cfde_texteditengine.h | |
parent | 162a31a6af1538acf7ac9835111626161287d742 (diff) | |
download | pdfium-6af5369477ec05554ef9e73ae6762860095f09e9.tar.xz |
[xfa] Propagate the xfa change data for text to JS and back.
This CL adds the necessary plumbing to propagate the change information
for a text widget from FWL out to JS and handle the returned value as
necessary.
Bug: pdfium:1066
Change-Id: I78fd81761b90294f1836e9f09dba12ed238963cc
Reviewed-on: https://pdfium-review.googlesource.com/33070
Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fde/cfde_texteditengine.h')
-rw-r--r-- | xfa/fde/cfde_texteditengine.h | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/xfa/fde/cfde_texteditengine.h b/xfa/fde/cfde_texteditengine.h index 58f77edf31..868be8866a 100644 --- a/xfa/fde/cfde_texteditengine.h +++ b/xfa/fde/cfde_texteditengine.h @@ -61,21 +61,27 @@ class CFDE_TextEditEngine { virtual void Undo() const = 0; }; + struct TextChange { + WideString text; + WideString previous_text; + size_t selection_start; + size_t selection_end; + bool cancelled; + }; + class Delegate { public: virtual ~Delegate() = default; virtual void NotifyTextFull() = 0; virtual void OnCaretChanged() = 0; - virtual void OnTextChanged(const WideString& prevText) = 0; + virtual void OnTextWillChange(TextChange* change) = 0; + virtual void OnTextChanged() = 0; virtual void OnSelChanged() = 0; virtual bool OnValidate(const WideString& wsText) = 0; virtual void SetScrollOffset(float fScrollOffset) = 0; }; - enum class RecordOperation { - kInsertRecord, - kSkipRecord, - }; + enum class RecordOperation { kInsertRecord, kSkipRecord, kSkipNotify }; CFDE_TextEditEngine(); ~CFDE_TextEditEngine(); |