kodi
GUIFadeLabelControl.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2005-2018 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
16 #include "GUIControl.h"
17 #include "GUILabel.h"
19 
20 #include <vector>
21 
27 {
28 public:
29  CGUIFadeLabelControl(int parentID, int controlID, float posX, float posY, float width, float height, const CLabelInfo& labelInfo, bool scrollOut, unsigned int timeToDelayAtEnd, bool resetOnLabelChange, bool randomized);
31  ~CGUIFadeLabelControl(void) override;
32  CGUIFadeLabelControl* Clone() const override { return new CGUIFadeLabelControl(*this); }
33 
34  void Process(unsigned int currentTime, CDirtyRegionList &dirtyregions) override;
35  void Render() override;
36  bool CanFocus() const override;
37  bool OnMessage(CGUIMessage& message) override;
38 
39  void SetInfo(const std::vector<KODI::GUILIB::GUIINFO::CGUIInfoLabel> &vecInfo);
40  void SetScrolling(bool scroll) { m_scroll = scroll; }
41 
42  bool AllLabelsShown() const { return m_allLabelsShown; }
43 
44 protected:
45  bool UpdateColors(const CGUIListItem* item) override;
46  std::string GetDescription() const override;
47  void AddLabel(const std::string &label);
48 
57  std::string GetLabel();
58 
59  std::vector<KODI::GUILIB::GUIINFO::CGUIInfoLabel> m_infoLabels;
60  unsigned int m_currentLabel;
61  unsigned int m_lastLabel;
62 
63  CLabelInfo m_label;
64 
65  bool m_scroll; // true if we scroll the text
66  bool m_scrollOut; // true if we scroll the text all the way to the left before fading in the next label
67  bool m_shortText; // true if the text we have is shorter than the width of the control
68 
69  CScrollInfo m_scrollInfo;
70  CGUITextLayout m_textLayout;
71  CAnimation m_fadeAnim;
72  TransformMatrix m_fadeMatrix;
73  unsigned int m_scrollSpeed;
74  bool m_resetOnLabelChange;
75  bool m_randomized;
76  bool m_allLabelsShown = true;
77 };
78 
Definition: GUIListItem.h:29
Definition: VisibleEffect.h:151
Base class for controls.
Definition: GUIControl.h:83
Definition: GUIFont.h:61
Definition: GUITextLayout.h:56
Definition: TransformMatrix.h:25
Definition: GUIMessage.h:365
Definition: GUILabel.h:22
std::string GetLabel()
retrieve the current label for display
Definition: GUIFadeLabelControl.cpp:251
Definition: GUIFadeLabelControl.h:26