## **Overview**
**Related Modules:**
[Graphic](Graphic.md)
**Description:**
Provides the functions related to an analog clock.
**Since:**
1.0
**Version:**
1.0
## **Summary**
## Data Structures
Defines the basic attributes of the analog clock hands. This is an inner class of UIAbstractClock. |
## Public Types
HandType { HandType::HOUR_HAND, HandType::MINUTE_HAND, HandType::SECOND_HAND } | Enumerates the clock hand types. |
DrawType { DrawType::DRAW_LINE, DrawType::DRAW_IMAGE } | Enumerates the drawing types of a clock hand. |
WorkMode { ALWAYS_ON, NORMAL } | Enumerates the working modes of this clock. |
## Public Member Functions
A default constructor used to create a UIAnalogClock instance. | |
A destructor used to delete the UIAnalogClock instance. | |
GetViewType () const override | |
SetHandImage (HandType type, const UIImageView &img, Point position, Point center) | Sets the image used to draw a clock hand. |
SetHandLine (HandType type, Point position, Point center, ColorType color, uint16_t width, uint16_t height, OpacityType opacity) | Sets the line used to draw a clock hand. |
GetHandRotateCenter (HandType type) const | Obtains the rotation center of a specified clock hand. |
GetHandPosition (HandType type) const | Obtains the position of a specified clock hand. |
GetHandInitAngle (HandType type) const | Obtains the initial rotation angle of the specified clock hand. |
GetHandCurrentAngle (HandType type) const | Obtains the current rotation angle of the specified clock hand. |
SetInitTime24Hour (uint8_t hour, uint8_t minute, uint8_t second) | Sets the initial time in the 24-hour format. |
SetInitTime12Hour (uint8_t hour, uint8_t minute, uint8_t second, bool am) | Sets the initial time in the 12-hour format. |
OnDraw (const Rect &invalidatedArea) override | |
OnPostDraw (const Rect &invalidatedArea) override | Performs the operations needed after the drawing. |
SetPosition (int16_t x, int16_t y) override | Sets the position for this analog clock. |
SetPosition (int16_t x, int16_t y, int16_t width, int16_t height) override | Sets the position and size for this analog clock. |
SetWorkMode (WorkMode newMode) override | Sets the working mode for this analog clock. |
UpdateClock (bool clockInit) override | Updates the time of this analog clock. |
A default constructor used to create a UIAbstractClock instance. | |
UIAbstractClock (uint8_t hour, uint8_t minute, uint8_t second) | A constructor used to create a UIAbstractClock instance with time elements (hour, minute and second). |
A destructor used to delete the UIAbstractClock instance. | |
SetTime24Hour (uint8_t hour, uint8_t minute, uint8_t second) | Sets the time in 24-hour format. |
SetTime12Hour (uint8_t hour, uint8_t minute, uint8_t second, bool am) | Sets the time in 12-hour format. |
GetCurrentHour () const | Obtains the current number of hours. |
GetCurrentMinute () const | Obtains the current number of minutes. |
GetCurrentSecond () const | Obtains the current number of seconds. |
IncOneSecond () | Increases the time by one second. |
GetWorkMode () const | virtual WorkMode Obtains the working mode of this clock. |
UIViewGroup () | A default constructor used to create a UIViewGroup instance. |
~UIViewGroup () | A destructor used to delete the UIViewGroup instance. |
GetViewType () const override | |
Insert (UIView *prevView, UIView *insertView) | Inserts a new child view behind the current one. |
RemoveAll () | |
GetTargetView (const Point &point, UIView **last) override | Obtains the target child view that is visible and can respond to touch events based on given coordinates. |
MoveChildByOffset (int16_t x, int16_t y) | |
GetChildrenHead () const | UIView * Obtains the first child view in this view group. |
GetChildrenTail () const | UIView * Obtains the last child view in this view group. |
SetDisallowIntercept (bool flag) | Sets whether this view group is intercepted upon touch events. |
GetChildById (const char *id) const override | UIView * Obtains the target child view with a specified ID. |
SetAutoSize (bool state) | Sets whether the size of this view group is adaptive to that of all child views. |
UIView () | A default constructor used to create an UIView instance. |
UIView (const char *id) | A constructor used to create an UIView instance. |
~UIView () | A destructor used to delete the UIView instance. |
OnPreDraw (const Rect &invalidatedArea) | Called before a view is drawn. This function is used to check whether the parent view of this view needs to be redrawn so as to optimize the drawing process. |
ReMeasure () | |
Invalidate () | Refreshes the invalidated area of the view. |
InvalidateRect (const Rect &invalidatedArea) | Refreshes a view in a specified invalidated area. |
OnLongPressEvent (const LongPressEvent &event) | Called when the view is long pressed. |
OnDragStartEvent (const DragEvent &event) | Called when the view starts to drag. |
OnDragEvent (const DragEvent &event) | Called when the view is being dragged. |
OnDragEndEvent (const DragEvent &event) | Called when the view stops dragging. |
OnClickEvent (const ClickEvent &event) | Called when the view is clicked. |
OnPressEvent (const PressEvent &event) | Called when the view is pressed. |
OnReleaseEvent (const ReleaseEvent &event) | Called when the view is released. |
OnCancelEvent (const CancelEvent &event) | Called when a click event on the view is canceled. |
SetOnDragListener (OnDragListener *onDragListener) | Sets a drag event listener for the view. |
Obtains the drag event listener for the view. | |
SetOnClickListener (OnClickListener *onClickListener) | Sets a click event listener for the view. |
Obtains the click event listener for the view. | |
SetOnLongPressListener (OnLongPressListener *onLongPressListener) | Sets a long-press event listener for the view. |
Obtains the long-press event listener for the view. | |
SetOnTouchListener (OnTouchListener *onTouchListener) | Sets a touch event listener for the view. |
Obtains the touch event listener for the view. | |
Sets the parent view for the view. | |
GetParent () const | UIView * Obtains the parent view of the view. |
SetNextSibling (UIView *sibling) | Sets the next sibling view for the view. |
GetNextSibling () const | UIView * Obtains the next sibling view of the view. |
SetVisible (bool visible) | Sets whether the view is visible. |
IsVisible () const | Checks whether the view is visible. |
SetTouchable (bool touch) | Sets whether the view is touchable. |
IsTouchable () const | Checks whether the view is touchable. |
SetDraggable (bool draggable) | Sets whether the view is draggable. |
IsDraggable () const | Checks whether the view is draggable. |
SetDragParentInstead (bool dragParentInstead) | Sets whether to transfer the drag event to the parent view for processing when the view is being dragged. |
IsDragParentInstead () const | Obtains whether the view transfers a drag event to the parent view for processing. |
GetRect () const | Obtains the absolute rectangle area of the view. When the view has deformation such as rotation, the rectangle area is the intersection set of the absolute rectangle area and deformation matrix. |
GetVisibleRect () const | Obtains the visible absolute rectangle area of the view. |
GetMaskedRect () const | Obtains the valid absolute rectangle area of the view. The valid area refers to the area where the view can be displayed. Generally, the valid area is the same as the visible view area, but they may be different in the grid layout. |
GetOrigRect () const | Obtains the absolute rectangle area of the view. |
virtual Rect Obtains the content of the absolute rectangle area of the view. This area excludes padding. | |
GetRelativeRect () const | Obtains the rectangular area of the view relative to the parent view, that is, the rectangular area relative to the coordinates of the parent view. |
ResizeVisibleArea (int16_t x, int16_t y, int16_t width, int16_t height) | Adjusts the size of the visible area. This operation may affect the final display size. |
SetWidth (int16_t width) | |
GetWidth () | Obtains the width for the view. |
SetHeight (int16_t height) | |
GetHeight () | Obtains the height for the view. |
Resize (int16_t width, int16_t height) | |
SetX (int16_t x) | Sets the x-coordinate for the view. |
GetX () const | Obtains the x-coordinate for the view. |
SetY (int16_t y) | Sets the y-coordinate for the view. |
GetY () const | Obtains the y-coordinate for the view. |
IsViewGroup () const | Checks whether the view is a container view. |
SetIntercept (bool isIntercept) | Sets whether to intercept the drag event. If intercepted, the view does not transfer the drag event to the parent view after local processing. |
SetTransformMap (const TransformMap &transMap) | Sets the affine transformation matrix. |
Obtains an affine transformation matrix. | |
SetViewId (const char *id) | |
GetViewId () const | |
SetViewIndex (int16_t index) | |
GetViewIndex () const | |
LayoutChildren (bool neeInvalidate=false) | Lays out all child views according to the preset arrangement mode. |
LayoutCenterOfParent (int16_t xOffSet=0, int16_t yOffset=0) | Lays out the view in the center of the parent view. |
LayoutLeftOfParent (int16_t offset=0) | Lays out the view on the left of the parent view. |
LayoutRightOfParent (int16_t offset=0) | Lays out the view on the right of the parent view. |
LayoutTopOfParent (int16_t offset=0) | Lays out the view on the top of the parent view. |
LayoutBottomOfParent (int16_t offset=0) | Lays out the view on the bottom of the parent view. |
AlignLeftToSibling (const char *id, int16_t offset=0) | Aligns the view with the left of a sibling view. |
AlignRightToSibling (const char *id, int16_t offset=0) | Aligns the view with the right of a sibling view. |
AlignTopToSibling (const char *id, int16_t offset=0) | Aligns the view with the top of a sibling view. |
AlignBottomToSibling (const char *id, int16_t offset=0) | Aligns the view with the bottom of a sibling view. |
AlignHorCenterToSibling (const char *id, int16_t offset=0) | Aligns the view with the center of a sibling view in the x-axis. |
AlignVerCenterToSibling (const char *id, int16_t offset=0) | Aligns the view with the center of a sibling view in the y-axis. |
LayoutLeftToSibling (const char *id, int16_t offset=0) | Lays out the view on the left of a sibling view. |
LayoutRightToSibling (const char *id, int16_t offset=0) | Lays out the view on the right of a sibling view. |
LayoutTopToSibling (const char *id, int16_t offset=0) | Lays out the view on the above of a sibling view. |
LayoutBottomToSibling (const char *id, int16_t offset=0) | Lays out the view on the below of a sibling view. |
SetStyle (uint8_t key, int64_t value) | |
GetStyle (uint8_t key) const | |
GetStyleConst () const | const Style & Obtains the view style. This function applies to scenarios where the style does not need to be modified, which saves memory. |
operator new (size_t size) | |
operator delete (void *p) | Overrides the delete function. |
## Additional Inherited Members
Additional Inherited Member Name | |
---|---|
ONE_MINUTE_IN_SECOND = 60 | Represents 60 seconds per minute. |
ONE_HOUR_IN_MINUTE = 60 | Represents 60 minutes per hour. |
ONE_DAY_IN_HOUR = 24 | |
HALF_DAY_IN_HOUR = 12 | Represents 12 hours every half day. |
GetAllChildRelativeRect () const | Obtains the rectangle area of a new view group after being adaptive to the size of all child views. |
Performs operations needed after a child view is added or removed. | |
Represents the current number of hours. | |
Represents the current number of minutes. | |
Represents the current number of seconds. | |
Represents the current working mode of this clock. | |
Indicates the pointer to the first child view of this view group. | |
Indicates the pointer to the last child view of this view group. | |
Represents the number of child views. | |
Specifies the sliding state of this view group. | |
Specifies whether this view group is intercepted upon touch events. | |
Specifies whether the size of this view group is adaptive to that of all child views. |