You.i Engine
YiScrollingTextView.h
Go to the documentation of this file.
1 // © You i Labs Inc. 2000-2020. All rights reserved.
2 #ifndef _YI_SCROLLING_TEXT_VIEW_H_
3 #define _YI_SCROLLING_TEXT_VIEW_H_
4 
6 #include "view/YiListView.h"
7 
11 class CYISceneNodeProxy;
12 
13 namespace youi_private
14 {
15 class ScrollingTextListAdapter;
16 }
17 
44 {
45 public:
47 
48  virtual bool Init() override;
49 
53  bool SetListItemTemplateName(const CYIString &templateName);
54 
62  void SetText(const CYIString &text);
63 
69  const CYIString &GetText() const;
70 
80  void SetMarkedUpText(const CYIString &rMarkedUpText, CYITextMarkupParser *pMarkupParser = nullptr, const CYICustomMarkupTagsProvider *pExternalTagsProvider = nullptr);
81 
85  const CYIString &GetMarkedUpText() const;
86 
90  void Clear();
91 
109  void SetCurrentPercentage(float percentageScrolled, uint32_t durationMs = 0, CYITimeInterpolator *pInterpolator = nullptr);
110 
114  float GetCurrentPercentage() const;
115 
119  float GetContentSize() const;
120 
125  void SetXJustify(CYITextSceneNode::Justification xJustify);
126 
131  CYITextSceneNode::Justification GetXJustify() const;
132 
133  virtual bool HandleEvent(const std::shared_ptr<CYIEventDispatcher> &pDispatcher, CYIEvent *pEvent) override;
134  virtual bool HandlesFocusInDescendants() const override;
135  virtual bool RequestFocus(CYIFocus::Direction direction = CYIFocus::Direction::Forward, CYIFocus::FocusRootRule focusRootRule = CYIFocus::FocusRootRule::DescendantsUpdateContext, const CYIAABB &previousFocusRect = CYIAABB(), const CYIFocusSearchOptions &options = CYIFocusSearchOptions()) override;
136 
137 private:
138  virtual void SizeChanged() override;
139  virtual void WorldSurfaceScaleUpdated() override;
140  void UpdateScrollbarHeight();
141  void UpdateScrollbarPosition();
142  bool TryMoveInScrollDirection(bool reverse);
143 
144  std::shared_ptr<CYIAssetViewTemplate> m_pListItemTemplate;
145  bool m_gestureInProgress;
146  CYIString m_text;
147  CYIString m_markedUpText;
149  float m_scrollArea;
150  float m_scrollStart;
151  std::shared_ptr<CYISceneNodeProxy> m_pListScrollbar;
152  youi_private::ScrollingTextListAdapter *m_pAdapter;
153 
155 };
156 
159 #endif // _YI_SCROLLING_TEXT_VIEW_H_
Justification
Definition: YiTextSceneNode.h:83
Container for basic interpolator functions.
Definition: YiTimeInterpolator.h:20
A class containing focus search options.
Definition: YiFocusSearchOptions.h:23
Base class for events.
Definition: YiEvent.h:27
Container class for Unicode strings. Conceptually, a CYIString object is a sequence of Unicode charac...
Definition: YiString.h:36
Direction
Definition: YiFocus.h:44
A class used to proxy access to a CYISceneNode.
Definition: YiSceneNodeProxy.h:26
A class that provides streaming functionality in a scrolling view.
Definition: YiListView.h:35
Definition: YiTextMarkupParser.h:15
ViewTemplate asset. Wrapper around a CYIViewTemplate.
Definition: YiAssetViewTemplate.h:21
FocusRootRule
Definition: YiFocus.h:60
This class represents an Axis-Aligned Bounding Box.
Definition: YiAABB.h:24
Definition: YiKeyEventUtilities.h:7
#define YI_TYPE_BASES(CLASS, BASES...)
Definition: YiRtti.h:257
Definition: YiTextSceneNode.h:90
Definition: YiScrollingTextView.h:43
Definition: YiCustomMarkupTagsProvider.h:15