summaryrefslogtreecommitdiff
path: root/xfa/fde/cfde_texteditengine.h
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-09-06 11:44:39 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-09-06 15:54:37 +0000
commiteb57e0d0b396606b39ef76a864b8bf9dd91a8ed8 (patch)
tree3d4ee88701eed1cbb56f456ea6ebc7c7c0f47f6c /xfa/fde/cfde_texteditengine.h
parent746552254ad113ef88b40aca4dbc0e57cefbac85 (diff)
downloadpdfium-eb57e0d0b396606b39ef76a864b8bf9dd91a8ed8.tar.xz
Implement word selection in CFDE_TextEditEngine
This CL implements the needed logic in CFDE_TextEditEngine to handle word selection. Change-Id: I6b388c23655037fec107d68ec07d33638b959374 Reviewed-on: https://pdfium-review.googlesource.com/13211 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
Diffstat (limited to 'xfa/fde/cfde_texteditengine.h')
-rw-r--r--xfa/fde/cfde_texteditengine.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/xfa/fde/cfde_texteditengine.h b/xfa/fde/cfde_texteditengine.h
index 35d9664f99..0277b0cc64 100644
--- a/xfa/fde/cfde_texteditengine.h
+++ b/xfa/fde/cfde_texteditengine.h
@@ -40,7 +40,7 @@ class CFDE_TextEditEngine {
public:
class Iterator : public IFX_CharIter {
public:
- explicit Iterator(CFDE_TextEditEngine* engine);
+ explicit Iterator(const CFDE_TextEditEngine* engine);
~Iterator() override;
bool Next(bool bPrev = false) override;
@@ -51,7 +51,7 @@ class CFDE_TextEditEngine {
std::unique_ptr<IFX_CharIter> Clone() const override;
private:
- CFX_UnownedPtr<CFDE_TextEditEngine> engine_;
+ CFX_UnownedPtr<const CFDE_TextEditEngine> engine_;
int32_t current_position_;
};
@@ -160,6 +160,8 @@ class CFDE_TextEditEngine {
size_t GetWidthOfChar(size_t idx);
// Non-const so we can force a Layout() if needed.
size_t GetIndexForPoint(const CFX_PointF& point);
+ // <start_idx, end_idx>
+ std::pair<size_t, size_t> BoundsForWordAt(size_t idx) const;
// Returns <bidi level, character rect>
std::pair<int32_t, CFX_RectF> GetCharacterInfo(int32_t start_idx);