/* * Copyright (c) 2021-2023 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ /** * @file * @kit ArkUI */ /*** if arkts 1.2 */ import { ResourceColor, Length } from './units'; import { CommonMethod } from './common'; import { FontWeight, MarqueeUpdateStrategy } from './enums'; import { Resource } from './../../../api/global/resource'; /*** endif */ /** * Defines Marquee constructor options. * * Anonymous Object Rectification. * @interface MarqueeOptions * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @form * @atomicservice * @since arkts {'1.1':'18','1.2':'20'} * @arkts 1.1&1.2 */ interface MarqueeOptions { /** * Control whether the running lamp enters the playing state. * * @type { boolean } * @syscap SystemCapability.ArkUI.ArkUI.Full * @since 8 */ /** * Control whether the running lamp enters the playing state. * * @type { boolean } * @syscap SystemCapability.ArkUI.ArkUI.Full * @form * @since 9 */ /** * Control whether the running lamp enters the playing state. * * @type { boolean } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @form * @since 10 */ /** * Control whether the running lamp enters the playing state. * * @type { boolean } * @syscap SystemCapability.ArkUI.ArkUI.Full * @crossplatform * @form * @atomicservice * @since 11 */ /** * Control whether the running lamp enters the playing state. * * Anonymous Object Rectification. * *
NOTE:
*
true: Start scrolling.
*
false: Do not start scrolling.
*
This parameter cannot be used to restart scrolling that has been completed.
*
NOTE:
*
If the value is greater than the text width of the marquee, the default value is used.
*
NOTE:
*
If the value is less than or equal to 0, the marquee will scroll continuously.
*
Regardless of the value, the marquee scrolls only once on an ArkTS widget.
*
NOTE:
*
If fontSize is of the number type, the unit fp is used. The default font size is 16 fp.
*
This parameter cannot be set in percentage.
*
NOTE:
*
This parameter is effective only when fontSize is in fp units.
*
NOTE:
*
If the value is too large, the text may be clipped depending on the font.
*
For the number type, the value range is [100, 900], at an interval of 100.
*
The default value is 400.
*
A larger value indicates a heavier font weight.
*
For the string type, only strings that represent a number, for example, "400",
* and the following enumerated values of FontWeight are supported: "bold", "bolder", "lighter", "regular", and "medium".
*
NOTE:
*
Default font: 'HarmonyOS Sans'
*
The 'HarmonyOS Sans' font and registered custom fonts are supported for applications.
*
Only the 'HarmonyOS Sans' font is supported for widgets.
*
NOTE:
*
This attribute takes effect when the marquee is in the playing state
* and the text content width exceeds the width of the marquee component.
*
NOTE:
*
This event will be triggered for multiple times if the loop attribute is not set to 1.
*
NOTE:
*
To ensure that scrolling frame rates are not affected,
* it is recommended that the number of Marquee components in a scroll container does not exceed four, or alternatively,
* use the Text component's TextOverflow.MARQUEE as a substitute.
*
The text is scrolled only when its width exceeds the width of the Marquee component.
*