1 Star 0 Fork 4.9K

Lin_bruin / docs

forked from OpenHarmony / docs 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
OHOS-TextAdapter.md 16.31 KB
一键复制 编辑 原始数据 按行查看 历史
wenjun 提交于 2020-09-08 10:08 . add OpenHarmony 1.0 baseline

OHOS::TextAdapter

Overview

Related Modules:

Graphic

Description:

Defines a text adapter, which implements UILabel instance construction and supports text data and continuous integer data.

Since:

1.0

Version:

1.0

Summary

Public Member Functions

Public Member Function Name

Description

TextAdapter ()

 

A constructor used to create a UILabel instance.

~TextAdapter ()

virtual 

A destructor used to delete the UILabel instance.

GetView (UIView *inView, int16_t index) override

UIView

Obtains a UILabel instance to convert adapter data into another UILabel instance.

SetData (List< const char * > *data)

void 

Sets the UILabel adapter data, which is a string linked list.

SetData (int16_t start, int16_t end)

void 

Sets continuously increasing data. For example, if you need to set data 0, 1, 2, 3, 4, use this function to set start to 0 and end to 4.

SetFontId (uint8_t fontId)

void 

Sets font ID.

GetFontId () const

uint8_t 

Obtains font ID.

SetFont (const char *name, uint8_t size)

void 

Sets the font.

GetStyle ()

Style

Obtains the UILabel adapter style.

GetCount () override

virtual uint16_t 

Obtains the data size of the UILabel adapter.

SetWidth (int16_t width)

void 

Sets the width of UILabel constructed by the adapter.

SetDirect (UITextLanguageDirect direct)

void 

Sets the direction of the UILabel constructed by the adapter.

SetHeight (int16_t height)

void 

Sets the height of the UILabel constructed by the adapter.

SetLineBreakMode (const uint8_t lineBreakMode)

void 

Sets the LineBreakMode attribute of UILabel constructed by the adapter. For details about the values of LineBreakMode, see LINE_BREAK_ADAPT, LINE_BREAK_WRAP, LINE_BREAK_ELLIPSIS, and LINE_BREAK_MARQUEE.

SetOnClickListener (UIView::OnClickListener *clickListener)

void 

Sets the callback function to be invoked upon a click event.

SetTextFormatter (TextFormatter *formatter)

void 

Sets the text formatter.

AbstractAdapter ()

 

A constructor used to create an AbstractAdapter instance.

~AbstractAdapter ()

virtual 

A destructor used to delete the AbstractAdapter instance.

operator new (size_t size)

void * 

Overrides the new function.

operator delete (void *p)

void 

Overrides the delete function.

1
https://gitee.com/dreaminghell/docs.git
git@gitee.com:dreaminghell/docs.git
dreaminghell
docs
docs
master

搜索帮助