blob: 65451c9386ff6ab96d5edc8cce507c30040501dd [file] [log] [blame]
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_LIB_UI_TEXT_PARAGRAPH_IMPL_TXT_H_
#define FLUTTER_LIB_UI_TEXT_PARAGRAPH_IMPL_TXT_H_
#include "flutter/lib/ui/painting/canvas.h"
#include "flutter/lib/ui/text/paragraph_impl.h"
#include "flutter/lib/ui/text/paragraph_impl_blink.h"
#include "flutter/lib/ui/text/text_box.h"
#include "flutter/third_party/txt/src/txt/paragraph.h"
namespace blink {
class ParagraphImplTxt : public ParagraphImpl {
public:
~ParagraphImplTxt() override;
explicit ParagraphImplTxt(std::unique_ptr<txt::Paragraph> paragraph);
double width() override;
double height() override;
double minIntrinsicWidth() override;
double maxIntrinsicWidth() override;
double alphabeticBaseline() override;
double ideographicBaseline() override;
bool didExceedMaxLines() override;
void layout(double width) override;
void paint(Canvas* canvas, double x, double y) override;
std::vector<TextBox> getRectsForRange(unsigned start, unsigned end) override;
Dart_Handle getPositionForOffset(double dx, double dy) override;
Dart_Handle getWordBoundary(unsigned offset) override;
private:
std::unique_ptr<txt::Paragraph> m_paragraph;
double m_width = -1.0;
};
} // namespace blink
#endif // FLUTTER_LIB_UI_TEXT_PARAGRAPH_IMPL_TXT_H_